Interface EmbeddedActiveMQOperations
- All Known Implementing Classes:
EmbeddedActiveMQDelegate
public interface EmbeddedActiveMQOperations
-
Method Summary
Modifier and TypeMethodDescriptionbrowseMessage(String queueName) Browse a message (receive but do not consume) from the specified queue using the default receive timeoutbrowseMessage(String queueName, long timeout) Browse a message (receive but do not consume) a message from the specified queue using the specified receive timeoutbrowseMessage(SimpleString queueName) Browse a message (receive but do not consume) from the specified queue using the default receive timeoutbrowseMessage(SimpleString queueName, long timeout) Browse a message (receive but do not consume) a message from the specified queue using the specified receive timeoutCreate a ClientMessage.createMessage(byte[] body) Create a ClientMessage with the specified body.createMessage(String body) Create a ClientMessage with the specified body.createMessageWithProperties(byte[] body, Map<String, Object> properties) Create a ClientMessage with the specified body and message properties.createMessageWithProperties(String body, Map<String, Object> properties) Create a ClientMessage with the specified body and message properties.createMessageWithProperties(Map<String, Object> properties) Create a ClientMessage with the specified message properties.org.apache.activemq.artemis.core.server.QueuecreateQueue(String name) org.apache.activemq.artemis.core.server.QueuecreateQueue(String address, String name) org.apache.activemq.artemis.core.server.QueuecreateQueue(SimpleString address, SimpleString name) voidcreateSharedQueue(String name, String user) voidcreateSharedQueue(String address, String name, String user) voidcreateSharedQueue(SimpleString address, SimpleString name, SimpleString user) List<org.apache.activemq.artemis.core.server.Queue> getBoundQueues(String address) List<org.apache.activemq.artemis.core.server.Queue> getBoundQueues(SimpleString address) longlonggetMessageCount(String queueName) Get the number of messages in a specific queue.longgetMessageCount(SimpleString queueName) Get the number of messages in a specific queue.org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQGet the EmbeddedActiveMQ server.Get the name of the EmbeddedActiveMQ servergetVmURL()Get the VM URL for the embedded EmbeddedActiveMQ serverbooleanbooleanorg.apache.activemq.artemis.core.server.QueuelocateQueue(String queueName) org.apache.activemq.artemis.core.server.QueuelocateQueue(SimpleString queueName) receiveMessage(String queueName) Receive a message from the specified queue using the default receive timeoutreceiveMessage(String queueName, long timeout) Receive a message from the specified queue using the specified receive timeoutreceiveMessage(SimpleString queueName) Receive a message from the specified queue using the default receive timeoutreceiveMessage(SimpleString queueName, long timeout) Receive a message from the specified queue using the specified receive timeoutsendMessage(String address, byte[] body) Create a new message with the specified body, and send the message to an addresssendMessage(String address, String body) Create a new message with the specified body, and send the message to an addressvoidsendMessage(String address, ClientMessage message) Send a message to an addresssendMessage(SimpleString address, byte[] body) Create a new message with the specified body, and send the message to an queueNamesendMessage(SimpleString address, String body) Create a new message with the specified body, and send the message to an queueNamevoidsendMessage(SimpleString address, ClientMessage message) Send a message to an queueNamesendMessageWithProperties(String address, byte[] body, Map<String, Object> properties) Create a new message with the specified body and properties, and send the message to an addressCreate a new message with the specified body and properties, and send the message to an addresssendMessageWithProperties(String address, Map<String, Object> properties) Create a new message with the specified properties, and send the message to an addresssendMessageWithProperties(SimpleString address, byte[] body, Map<String, Object> properties) Create a new message with the specified body and properties, and send the message to an queueNamesendMessageWithProperties(SimpleString address, String body, Map<String, Object> properties) Create a new message with the specified body and properties, and send the message to an queueNamesendMessageWithProperties(SimpleString address, Map<String, Object> properties) Create a new message with the specified properties, and send the message to an queueNamevoidsetDefaultReceiveTimeout(long defaultReceiveTimeout) Sets the default timeout in milliseconds used when receiving messages.voidsetUseDurableMessage(boolean useDurableMessage) Disables/Enables creating durable messages.voidsetUseDurableQueue(boolean useDurableQueue) Disables/Enables creating durable queues.voidstart()Start the embedded ActiveMQ Artemis server.voidstop()Stop the embedded ActiveMQ Artemis server The server will normally be stopped by JUnit using the after() method.
-
Method Details
-
start
void start()Start the embedded ActiveMQ Artemis server. The server will normally be started by JUnit using the before() method. This method allows the server to be started manually to support advanced testing scenarios. -
stop
void stop()Stop the embedded ActiveMQ Artemis server The server will normally be stopped by JUnit using the after() method. This method allows the server to be stopped manually to support advanced testing scenarios. -
isUseDurableMessage
boolean isUseDurableMessage() -
setUseDurableMessage
void setUseDurableMessage(boolean useDurableMessage) Disables/Enables creating durable messages. By default, durable messages are created- Parameters:
useDurableMessage- if true, durable messages will be created
-
isUseDurableQueue
boolean isUseDurableQueue() -
setUseDurableQueue
void setUseDurableQueue(boolean useDurableQueue) Disables/Enables creating durable queues. By default, durable queues are created- Parameters:
useDurableQueue- if true, durable messages will be created
-
getDefaultReceiveTimeout
long getDefaultReceiveTimeout() -
setDefaultReceiveTimeout
void setDefaultReceiveTimeout(long defaultReceiveTimeout) Sets the default timeout in milliseconds used when receiving messages. Defaults to 50 milliseconds- Parameters:
defaultReceiveTimeout- received timeout in milliseconds
-
getServer
org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ getServer()Get the EmbeddedActiveMQ server. This may be required for advanced configuration of the EmbeddedActiveMQ server.- Returns:
- the embedded ActiveMQ broker
-
getServerName
String getServerName()Get the name of the EmbeddedActiveMQ server- Returns:
- name of the embedded server
-
getVmURL
String getVmURL()Get the VM URL for the embedded EmbeddedActiveMQ server- Returns:
- the VM URL for the embedded server
-
getMessageCount
Get the number of messages in a specific queue.- Parameters:
queueName- the name of the queue- Returns:
- the number of messages in the queue; -1 if queue is not found
-
getMessageCount
Get the number of messages in a specific queue.- Parameters:
queueName- the name of the queue- Returns:
- the number of messages in the queue; -1 if queue is not found
-
locateQueue
-
locateQueue
-
getBoundQueues
-
getBoundQueues
-
createQueue
-
createQueue
-
createQueue
-
createMessage
ClientMessage createMessage()Create a ClientMessage.If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created.
- Returns:
- a new ClientMessage
-
createMessage
Create a ClientMessage with the specified body.If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created.
- Parameters:
body- the body for the new message- Returns:
- a new ClientMessage with the specified body
-
createMessage
Create a ClientMessage with the specified body.If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created.
- Parameters:
body- the body for the new message- Returns:
- a new ClientMessage with the specified body
-
createMessageWithProperties
Create a ClientMessage with the specified message properties.If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created.
- Parameters:
properties- message properties for the new message- Returns:
- a new ClientMessage with the specified message properties
-
createMessageWithProperties
Create a ClientMessage with the specified body and message properties.If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created.
- Parameters:
body- the body for the new messageproperties- message properties for the new message- Returns:
- a new ClientMessage with the specified body and message properties
-
createMessageWithProperties
Create a ClientMessage with the specified body and message properties.If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created.
- Parameters:
body- the body for the new messageproperties- message properties for the new message- Returns:
- a new ClientMessage with the specified body and message properties
-
sendMessage
Send a message to an address- Parameters:
address- the target queueName for the messagemessage- the message to send
-
sendMessage
Create a new message with the specified body, and send the message to an address- Parameters:
address- the target queueName for the messagebody- the body for the new message- Returns:
- the message that was sent
-
sendMessage
Create a new message with the specified body, and send the message to an address- Parameters:
address- the target queueName for the messagebody- the body for the new message- Returns:
- the message that was sent
-
sendMessageWithProperties
Create a new message with the specified properties, and send the message to an address- Parameters:
address- the target queueName for the messageproperties- message properties for the new message- Returns:
- the message that was sent
-
sendMessageWithProperties
Create a new message with the specified body and properties, and send the message to an address- Parameters:
address- the target queueName for the messagebody- the body for the new messageproperties- message properties for the new message- Returns:
- the message that was sent
-
sendMessageWithProperties
Create a new message with the specified body and properties, and send the message to an address- Parameters:
address- the target queueName for the messagebody- the body for the new messageproperties- message properties for the new message- Returns:
- the message that was sent
-
sendMessage
Send a message to an queueName- Parameters:
address- the target queueName for the messagemessage- the message to send
-
sendMessage
Create a new message with the specified body, and send the message to an queueName- Parameters:
address- the target queueName for the messagebody- the body for the new message- Returns:
- the message that was sent
-
sendMessage
Create a new message with the specified body, and send the message to an queueName- Parameters:
address- the target queueName for the messagebody- the body for the new message- Returns:
- the message that was sent
-
sendMessageWithProperties
Create a new message with the specified properties, and send the message to an queueName- Parameters:
address- the target queueName for the messageproperties- message properties for the new message- Returns:
- the message that was sent
-
sendMessageWithProperties
ClientMessage sendMessageWithProperties(SimpleString address, byte[] body, Map<String, Object> properties) Create a new message with the specified body and properties, and send the message to an queueName- Parameters:
address- the target queueName for the messagebody- the body for the new messageproperties- message properties for the new message- Returns:
- the message that was sent
-
sendMessageWithProperties
ClientMessage sendMessageWithProperties(SimpleString address, String body, Map<String, Object> properties) Create a new message with the specified body and properties, and send the message to an queueName- Parameters:
address- the target queueName for the messagebody- the body for the new messageproperties- message properties for the new message- Returns:
- the message that was sent
-
receiveMessage
Receive a message from the specified queue using the default receive timeout- Parameters:
queueName- name of the source queue- Returns:
- the received ClientMessage, null if the receive timed-out
-
receiveMessage
Receive a message from the specified queue using the specified receive timeout- Parameters:
queueName- name of the source queuetimeout- receive timeout in milliseconds- Returns:
- the received ClientMessage, null if the receive timed-out
-
receiveMessage
Receive a message from the specified queue using the default receive timeout- Parameters:
queueName- name of the source queue- Returns:
- the received ClientMessage, null if the receive timed-out
-
receiveMessage
Receive a message from the specified queue using the specified receive timeout- Parameters:
queueName- name of the source queuetimeout- receive timeout in milliseconds- Returns:
- the received ClientMessage, null if the receive timed-out
-
browseMessage
Browse a message (receive but do not consume) from the specified queue using the default receive timeout- Parameters:
queueName- name of the source queue- Returns:
- the received ClientMessage, null if the receive timed-out
-
browseMessage
Browse a message (receive but do not consume) a message from the specified queue using the specified receive timeout- Parameters:
queueName- name of the source queuetimeout- receive timeout in milliseconds- Returns:
- the received ClientMessage, null if the receive timed-out
-
browseMessage
Browse a message (receive but do not consume) from the specified queue using the default receive timeout- Parameters:
queueName- name of the source queue- Returns:
- the received ClientMessage, null if the receive timed-out
-
browseMessage
Browse a message (receive but do not consume) a message from the specified queue using the specified receive timeout- Parameters:
queueName- name of the source queuetimeout- receive timeout in milliseconds- Returns:
- the received ClientMessage, null if the receive timed-out
-