Class ArtemisJolokiaAdapter
java.lang.Object
com.kingsrook.qqq.esb.management.ArtemisJolokiaAdapter
- All Implemented Interfaces:
EsbBrokerAdapter
Broker adapter for ActiveMQ Artemis: runs the queue's QueueControl MBean
operations through the web console's Jolokia API (POSTs under
/console/jolokia/ on the provider's managementUrl - e.g.,
http://host:8161). Artemis supports every action.
Each call first searches for the queue's MBean by queue name (so it needn't
know the broker name, address, or routing type - a subscription queue's
address is its topic), then reads or execs on it. A queue name may also be
fully qualified, ADDRESS::QUEUE (as EsbBrokerNames names subscription
queues); then the search matches the address too.
Messages are selected by Artemis core filters: by JMS message id
(AMQUserID), or by JMS timestamp (AMQTimestamp). Ids are quoted literals in
the filter, so no id can widen it; and with no ids, nothing is sent - an
empty filter would select every message.
Requests carry the managementUrl's origin as their Origin header, as the
console's own browser requests do: Artemis's default Jolokia access policy
rejects requests whose Origin isn't allowed (see jolokia-access.xml). The
managementUsername needs a role the console lets manage queues.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionArtemisJolokiaAdapter(QEsbProviderMetaData provider) Constructor - for a provider with a managementUrl. -
Method Summary
Modifier and TypeMethodDescriptionThe actions this adapter's broker supports.intdeleteMessages(String brokerQueueName, List<String> messageIds) QueueControl.removeMessages(filter), by message id.intdeleteMessagesOlderThan(String brokerQueueName, Instant cutoff) QueueControl.removeMessages(filter), by timestamp.getQueueInfo(String brokerQueueName) Reads the queue MBean's MessageCount, ConsumerCount, and Paused attributes.intmoveMessages(String brokerQueueName, List<String> messageIds, String toBrokerQueueName) QueueControl.moveMessages(filter, otherQueueName), by message id.voidpauseQueue(String brokerQueueName) QueueControl.pause() - not persisted, so a broker restart resumes it.longpurgeQueue(String brokerQueueName) QueueControl.removeAllMessages()voidresumeQueue(String brokerQueueName) QueueControl.resume()
-
Field Details
-
CAPABILITIES
-
-
Constructor Details
-
ArtemisJolokiaAdapter
Constructor - for a provider with a managementUrl.
-
-
Method Details
-
capabilities
Description copied from interface:EsbBrokerAdapterThe actions this adapter's broker supports.- Specified by:
capabilitiesin interfaceEsbBrokerAdapter
-
getQueueInfo
Reads the queue MBean's MessageCount, ConsumerCount, and Paused attributes.- Specified by:
getQueueInfoin interfaceEsbBrokerAdapter- Throws:
QException
-
pauseQueue
QueueControl.pause() - not persisted, so a broker restart resumes it.- Specified by:
pauseQueuein interfaceEsbBrokerAdapter- Throws:
QException
-
resumeQueue
QueueControl.resume()- Specified by:
resumeQueuein interfaceEsbBrokerAdapter- Throws:
QException
-
purgeQueue
QueueControl.removeAllMessages()- Specified by:
purgeQueuein interfaceEsbBrokerAdapter- Throws:
QException
-
deleteMessages
QueueControl.removeMessages(filter), by message id.- Specified by:
deleteMessagesin interfaceEsbBrokerAdapter- Throws:
QException
-
deleteMessagesOlderThan
QueueControl.removeMessages(filter), by timestamp.- Specified by:
deleteMessagesOlderThanin interfaceEsbBrokerAdapter- Throws:
QException
-
moveMessages
public int moveMessages(String brokerQueueName, List<String> messageIds, String toBrokerQueueName) throws QException QueueControl.moveMessages(filter, otherQueueName), by message id.- Specified by:
moveMessagesin interfaceEsbBrokerAdapter- Throws:
QException
-