public class EmbeddedActiveMQResource
extends org.junit.rules.ExternalResource
public class SimpleTest {| Modifier and Type | Class and Description |
|---|---|
static class |
EmbeddedActiveMQResource.EmbeddedActiveMQResourceException |
| Constructor and Description |
|---|
EmbeddedActiveMQResource()
Create a default EmbeddedActiveMQResource
|
EmbeddedActiveMQResource(org.apache.activemq.artemis.core.config.Configuration configuration)
Creates an EmbeddedActiveMQResource using the specified configuration
|
EmbeddedActiveMQResource(int serverId)
Create a default EmbeddedActiveMQResource with the specified serverId
|
EmbeddedActiveMQResource(String filename)
Creates an EmbeddedActiveMQResource using the specified configuration file
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addMessageProperties(org.apache.activemq.artemis.api.core.client.ClientMessage message,
Map<String,Object> properties)
Adds properties to a ClientMessage
|
protected void |
after()
Invoked by JUnit to tear down the resource - stops the embedded ActiveMQ Artemis server
|
protected void |
before()
Invoked by JUnit to setup the resource - start the embedded ActiveMQ Artemis server
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
browseMessage(org.apache.activemq.artemis.api.core.SimpleString queueName)
Browse a message (receive but do not consume) from the specified queue using the default receive timeout
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
browseMessage(org.apache.activemq.artemis.api.core.SimpleString queueName,
long timeout)
Browse a message (receive but do not consume) a message from the specified queue using the specified receive timeout
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
browseMessage(String queueName)
Browse a message (receive but do not consume) from the specified queue using the default receive timeout
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
browseMessage(String queueName,
long timeout)
Browse a message (receive but do not consume) a message from the specified queue using the specified receive timeout
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
createMessage()
Create a ClientMessage
If useDurableMessage is false, a non-durable message is created.
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
createMessage(byte[] body)
Create a ClientMessage with the specified body
If useDurableMessage is false, a non-durable message is created.
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
createMessage(String body)
Create a ClientMessage with the specified body
If useDurableMessage is false, a non-durable message is created.
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
createMessageWithProperties(byte[] body,
Map<String,Object> properties)
Create a ClientMessage with the specified body and message properties
If useDurableMessage is false, a non-durable message is created.
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
createMessageWithProperties(Map<String,Object> properties)
Create a ClientMessage with the specified message properties
If useDurableMessage is false, a non-durable message is created.
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
createMessageWithProperties(String body,
Map<String,Object> properties)
Create a ClientMessage with the specified body and message properties
If useDurableMessage is false, a non-durable message is created.
|
org.apache.activemq.artemis.core.server.Queue |
createQueue(org.apache.activemq.artemis.api.core.SimpleString address,
org.apache.activemq.artemis.api.core.SimpleString name) |
org.apache.activemq.artemis.core.server.Queue |
createQueue(String name) |
org.apache.activemq.artemis.core.server.Queue |
createQueue(String address,
String name) |
void |
createSharedQueue(org.apache.activemq.artemis.api.core.SimpleString address,
org.apache.activemq.artemis.api.core.SimpleString name,
org.apache.activemq.artemis.api.core.SimpleString user) |
void |
createSharedQueue(String name,
String user) |
void |
createSharedQueue(String address,
String name,
String user) |
List<org.apache.activemq.artemis.core.server.Queue> |
getBoundQueues(org.apache.activemq.artemis.api.core.SimpleString address) |
List<org.apache.activemq.artemis.core.server.Queue> |
getBoundQueues(String address) |
long |
getDefaultReceiveTimeout() |
long |
getMessageCount(org.apache.activemq.artemis.api.core.SimpleString queueName)
Get the number of messages in a specific queue.
|
long |
getMessageCount(String queueName) |
org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ |
getServer()
Get the EmbeddedActiveMQ server.
|
String |
getServerName()
Get the name of the EmbeddedActiveMQ server
|
String |
getVmURL()
Get the VM URL for the embedded EmbeddedActiveMQ server
|
boolean |
isUseDurableMessage() |
boolean |
isUseDurableQueue() |
org.apache.activemq.artemis.core.server.Queue |
locateQueue(org.apache.activemq.artemis.api.core.SimpleString queueName) |
org.apache.activemq.artemis.core.server.Queue |
locateQueue(String queueName) |
org.apache.activemq.artemis.api.core.client.ClientMessage |
receiveMessage(org.apache.activemq.artemis.api.core.SimpleString queueName)
Receive a message from the specified queue using the default receive timeout
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
receiveMessage(org.apache.activemq.artemis.api.core.SimpleString queueName,
long timeout)
Receive a message from the specified queue using the specified receive timeout
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
receiveMessage(String queueName)
Receive a message from the specified queue using the default receive timeout
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
receiveMessage(String queueName,
long timeout)
Receive a message from the specified queue using the specified receive timeout
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
sendMessage(org.apache.activemq.artemis.api.core.SimpleString address,
byte[] body)
Create a new message with the specified body, and send the message to an queueName
|
void |
sendMessage(org.apache.activemq.artemis.api.core.SimpleString address,
org.apache.activemq.artemis.api.core.client.ClientMessage message)
Send a message to an queueName
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
sendMessage(org.apache.activemq.artemis.api.core.SimpleString address,
String body)
Create a new message with the specified body, and send the message to an queueName
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
sendMessage(String address,
byte[] body)
Create a new message with the specified body, and send the message to an address
|
void |
sendMessage(String address,
org.apache.activemq.artemis.api.core.client.ClientMessage message)
Send a message to an address
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
sendMessage(String address,
String body)
Create a new message with the specified body, and send the message to an address
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
sendMessageWithProperties(org.apache.activemq.artemis.api.core.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
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
sendMessageWithProperties(org.apache.activemq.artemis.api.core.SimpleString address,
Map<String,Object> properties)
Create a new message with the specified properties, and send the message to an queueName
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
sendMessageWithProperties(org.apache.activemq.artemis.api.core.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
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
sendMessageWithProperties(String address,
byte[] body,
Map<String,Object> properties)
Create a new message with the specified body and properties, and send the message to an address
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
sendMessageWithProperties(String address,
Map<String,Object> properties)
Create a new message with the specified properties, and send the message to an address
|
org.apache.activemq.artemis.api.core.client.ClientMessage |
sendMessageWithProperties(String address,
String body,
Map<String,Object> properties)
Create a new message with the specified body and properties, and send the message to an address
|
void |
setDefaultReceiveTimeout(long defaultReceiveTimeout)
Sets the default timeout in milliseconds used when receiving messages.
|
void |
setUseDurableMessage(boolean useDurableMessage)
Disables/Enables creating durable messages.
|
void |
setUseDurableQueue(boolean useDurableQueue)
Disables/Enables creating durable queues.
|
void |
start()
Start the embedded ActiveMQ Artemis server.
|
void |
stop()
Stop the embedded ActiveMQ Artemis server
The server will normally be stopped by JUnit using the after() method.
|
public EmbeddedActiveMQResource()
public EmbeddedActiveMQResource(int serverId)
serverId - server idpublic EmbeddedActiveMQResource(org.apache.activemq.artemis.core.config.Configuration configuration)
configuration - ActiveMQServer configurationpublic EmbeddedActiveMQResource(String filename)
filename - ActiveMQServer configuration file namepublic static void addMessageProperties(org.apache.activemq.artemis.api.core.client.ClientMessage message,
Map<String,Object> properties)
message - properties - public void start()
public void stop()
protected void before()
throws Throwable
before in class org.junit.rules.ExternalResourceThrowableprotected void after()
after in class org.junit.rules.ExternalResourcepublic boolean isUseDurableMessage()
public void setUseDurableMessage(boolean useDurableMessage)
useDurableMessage - if true, durable messages will be createdpublic boolean isUseDurableQueue()
public void setUseDurableQueue(boolean useDurableQueue)
useDurableQueue - if true, durable messages will be createdpublic long getDefaultReceiveTimeout()
public void setDefaultReceiveTimeout(long defaultReceiveTimeout)
defaultReceiveTimeout - received timeout in millisecondspublic org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ getServer()
public String getServerName()
public String getVmURL()
public long getMessageCount(String queueName)
public long getMessageCount(org.apache.activemq.artemis.api.core.SimpleString queueName)
queueName - the name of the queuepublic org.apache.activemq.artemis.core.server.Queue locateQueue(String queueName)
public org.apache.activemq.artemis.core.server.Queue locateQueue(org.apache.activemq.artemis.api.core.SimpleString queueName)
public List<org.apache.activemq.artemis.core.server.Queue> getBoundQueues(String address)
public List<org.apache.activemq.artemis.core.server.Queue> getBoundQueues(org.apache.activemq.artemis.api.core.SimpleString address)
public org.apache.activemq.artemis.core.server.Queue createQueue(String name)
public org.apache.activemq.artemis.core.server.Queue createQueue(String address, String name)
public org.apache.activemq.artemis.core.server.Queue createQueue(org.apache.activemq.artemis.api.core.SimpleString address,
org.apache.activemq.artemis.api.core.SimpleString name)
public void createSharedQueue(org.apache.activemq.artemis.api.core.SimpleString address,
org.apache.activemq.artemis.api.core.SimpleString name,
org.apache.activemq.artemis.api.core.SimpleString user)
public org.apache.activemq.artemis.api.core.client.ClientMessage createMessage()
public org.apache.activemq.artemis.api.core.client.ClientMessage createMessage(byte[] body)
body - the body for the new messagepublic org.apache.activemq.artemis.api.core.client.ClientMessage createMessage(String body)
body - the body for the new messagepublic org.apache.activemq.artemis.api.core.client.ClientMessage createMessageWithProperties(Map<String,Object> properties)
properties - message properties for the new messagepublic org.apache.activemq.artemis.api.core.client.ClientMessage createMessageWithProperties(byte[] body,
Map<String,Object> properties)
body - the body for the new messageproperties - message properties for the new messagepublic org.apache.activemq.artemis.api.core.client.ClientMessage createMessageWithProperties(String body, Map<String,Object> properties)
body - the body for the new messageproperties - message properties for the new messagepublic void sendMessage(String address, org.apache.activemq.artemis.api.core.client.ClientMessage message)
address - the target queueName for the messagemessage - the message to sendpublic org.apache.activemq.artemis.api.core.client.ClientMessage sendMessage(String address, byte[] body)
address - the target queueName for the messagebody - the body for the new messagepublic org.apache.activemq.artemis.api.core.client.ClientMessage sendMessage(String address, String body)
address - the target queueName for the messagebody - the body for the new messagepublic org.apache.activemq.artemis.api.core.client.ClientMessage sendMessageWithProperties(String address, Map<String,Object> properties)
address - the target queueName for the messageproperties - message properties for the new messagepublic org.apache.activemq.artemis.api.core.client.ClientMessage sendMessageWithProperties(String address, byte[] body, Map<String,Object> properties)
address - the target queueName for the messagebody - the body for the new messageproperties - message properties for the new messagepublic org.apache.activemq.artemis.api.core.client.ClientMessage sendMessageWithProperties(String address, String body, Map<String,Object> properties)
address - the target queueName for the messagebody - the body for the new messageproperties - message properties for the new messagepublic void sendMessage(org.apache.activemq.artemis.api.core.SimpleString address,
org.apache.activemq.artemis.api.core.client.ClientMessage message)
address - the target queueName for the messagemessage - the message to sendpublic org.apache.activemq.artemis.api.core.client.ClientMessage sendMessage(org.apache.activemq.artemis.api.core.SimpleString address,
byte[] body)
address - the target queueName for the messagebody - the body for the new messagepublic org.apache.activemq.artemis.api.core.client.ClientMessage sendMessage(org.apache.activemq.artemis.api.core.SimpleString address,
String body)
address - the target queueName for the messagebody - the body for the new messagepublic org.apache.activemq.artemis.api.core.client.ClientMessage sendMessageWithProperties(org.apache.activemq.artemis.api.core.SimpleString address,
Map<String,Object> properties)
address - the target queueName for the messageproperties - message properties for the new messagepublic org.apache.activemq.artemis.api.core.client.ClientMessage sendMessageWithProperties(org.apache.activemq.artemis.api.core.SimpleString address,
byte[] body,
Map<String,Object> properties)
address - the target queueName for the messagebody - the body for the new messageproperties - message properties for the new messagepublic org.apache.activemq.artemis.api.core.client.ClientMessage sendMessageWithProperties(org.apache.activemq.artemis.api.core.SimpleString address,
String body,
Map<String,Object> properties)
address - the target queueName for the messagebody - the body for the new messageproperties - message properties for the new messagepublic org.apache.activemq.artemis.api.core.client.ClientMessage receiveMessage(String queueName)
queueName - name of the source queuepublic org.apache.activemq.artemis.api.core.client.ClientMessage receiveMessage(String queueName, long timeout)
queueName - name of the source queuetimeout - receive timeout in millisecondspublic org.apache.activemq.artemis.api.core.client.ClientMessage receiveMessage(org.apache.activemq.artemis.api.core.SimpleString queueName)
queueName - name of the source queuepublic org.apache.activemq.artemis.api.core.client.ClientMessage receiveMessage(org.apache.activemq.artemis.api.core.SimpleString queueName,
long timeout)
queueName - name of the source queuetimeout - receive timeout in millisecondspublic org.apache.activemq.artemis.api.core.client.ClientMessage browseMessage(String queueName)
queueName - name of the source queuepublic org.apache.activemq.artemis.api.core.client.ClientMessage browseMessage(String queueName, long timeout)
queueName - name of the source queuetimeout - receive timeout in millisecondspublic org.apache.activemq.artemis.api.core.client.ClientMessage browseMessage(org.apache.activemq.artemis.api.core.SimpleString queueName)
queueName - name of the source queuepublic org.apache.activemq.artemis.api.core.client.ClientMessage browseMessage(org.apache.activemq.artemis.api.core.SimpleString queueName,
long timeout)
queueName - name of the source queuetimeout - receive timeout in millisecondsCopyright © 2023 The Apache Software Foundation. All Rights Reserved.