Class ActiveMQProducerDelegate
- java.lang.Object
-
- org.apache.activemq.artemis.junit.AbstractActiveMQClientDelegate
-
- org.apache.activemq.artemis.junit.ActiveMQProducerDelegate
-
- All Implemented Interfaces:
ActiveMQProducerOperations
- Direct Known Subclasses:
ActiveMQDynamicProducerDelegate
public class ActiveMQProducerDelegate extends AbstractActiveMQClientDelegate implements ActiveMQProducerOperations
Base class to embed an ActiveMQ Artemis ClientProducer bound to a specific address into a test.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.activemq.artemis.junit.AbstractActiveMQClientDelegate
AbstractActiveMQClientDelegate.ActiveMQClientResourceException
-
-
Constructor Summary
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreateClient()ClientMessagecreateMessage()Create a ClientMessage.ClientMessagecreateMessage(byte[] body)Create a ClientMessage with the specified body.ClientMessagecreateMessage(byte[] body, Map<String,Object> properties)Create a ClientMessage with the specified body and message properties.ClientMessagecreateMessage(String body)Create a ClientMessage with the specified body.ClientMessagecreateMessage(String body, Map<String,Object> properties)Create a ClientMessage with the specified body and message properties.ClientMessagecreateMessage(Map<String,Object> properties)Create a ClientMessage with the specified message properties.booleanisUseDurableMessage()ClientMessagesendMessage(byte[] body)Create a new ClientMessage with the specified body and send to the server.ClientMessagesendMessage(byte[] body, Map<String,Object> properties)Create a new ClientMessage with the specified body and and properties and send to the serverClientMessagesendMessage(String body)Create a new ClientMessage with the specified body and send to the server.ClientMessagesendMessage(String body, Map<String,Object> properties)Create a new ClientMessage with the specified body and and properties and send to the serverClientMessagesendMessage(Map<String,Object> properties)Create a new ClientMessage with the specified properties and send to the servervoidsendMessage(ClientMessage message)Send a ClientMessage to the server.voidsetUseDurableMessage(boolean useDurableMessage)Disables/Enables creating durable messages.protected voidstopClient()-
Methods inherited from class org.apache.activemq.artemis.junit.AbstractActiveMQClientDelegate
addMessageProperties, isAutoCreateQueue, setAutoCreateQueue
-
-
-
-
Constructor Detail
-
ActiveMQProducerDelegate
protected ActiveMQProducerDelegate(String url, String username, String password)
-
ActiveMQProducerDelegate
protected ActiveMQProducerDelegate(String url)
-
ActiveMQProducerDelegate
protected ActiveMQProducerDelegate(ServerLocator serverLocator, String username, String password)
-
ActiveMQProducerDelegate
protected ActiveMQProducerDelegate(ServerLocator serverLocator)
-
ActiveMQProducerDelegate
protected ActiveMQProducerDelegate(String url, String address, String username, String password)
-
ActiveMQProducerDelegate
protected ActiveMQProducerDelegate(String url, SimpleString address, String username, String password)
-
ActiveMQProducerDelegate
protected ActiveMQProducerDelegate(String url, SimpleString address)
-
ActiveMQProducerDelegate
protected ActiveMQProducerDelegate(ServerLocator serverLocator, String address, String username, String password)
-
ActiveMQProducerDelegate
protected ActiveMQProducerDelegate(ServerLocator serverLocator, String address)
-
ActiveMQProducerDelegate
protected ActiveMQProducerDelegate(ServerLocator serverLocator, SimpleString address, String username, String password)
-
ActiveMQProducerDelegate
protected ActiveMQProducerDelegate(ServerLocator serverLocator, SimpleString address)
-
-
Method Detail
-
isUseDurableMessage
public boolean isUseDurableMessage()
- Specified by:
isUseDurableMessagein interfaceActiveMQProducerOperations
-
setUseDurableMessage
public void setUseDurableMessage(boolean useDurableMessage)
Description copied from interface:ActiveMQProducerOperationsDisables/Enables creating durable messages. By default, durable messages are created.- Specified by:
setUseDurableMessagein interfaceActiveMQProducerOperations- Parameters:
useDurableMessage- if true, durable messages will be created
-
createClient
protected void createClient()
- Specified by:
createClientin classAbstractActiveMQClientDelegate
-
stopClient
protected void stopClient()
- Specified by:
stopClientin classAbstractActiveMQClientDelegate
-
createMessage
public ClientMessage createMessage()
Description copied from interface:ActiveMQProducerOperationsCreate a ClientMessage.If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created.
- Specified by:
createMessagein interfaceActiveMQProducerOperations- Returns:
- a new ClientMessage
-
createMessage
public ClientMessage createMessage(byte[] body)
Description copied from interface:ActiveMQProducerOperationsCreate a ClientMessage with the specified body.If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created.
- Specified by:
createMessagein interfaceActiveMQProducerOperations- Parameters:
body- the body for the new message- Returns:
- a new ClientMessage with the specified body
-
createMessage
public ClientMessage createMessage(String body)
Description copied from interface:ActiveMQProducerOperationsCreate a ClientMessage with the specified body.If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created.
- Specified by:
createMessagein interfaceActiveMQProducerOperations- Parameters:
body- the body for the new message- Returns:
- a new ClientMessage with the specified body
-
createMessage
public ClientMessage createMessage(Map<String,Object> properties)
Description copied from interface:ActiveMQProducerOperationsCreate a ClientMessage with the specified message properties.If useDurableMessage is false, a non-durable message is created. Otherwise, a durable message is created.
- Specified by:
createMessagein interfaceActiveMQProducerOperations- Parameters:
properties- message properties for the new message- Returns:
- a new ClientMessage with the specified message properties
-
createMessage
public ClientMessage createMessage(byte[] body, Map<String,Object> properties)
Description copied from interface:ActiveMQProducerOperationsCreate 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.
- Specified by:
createMessagein interfaceActiveMQProducerOperations- 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
-
createMessage
public ClientMessage createMessage(String body, Map<String,Object> properties)
Description copied from interface:ActiveMQProducerOperationsCreate 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.
- Specified by:
createMessagein interfaceActiveMQProducerOperations- 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
public void sendMessage(ClientMessage message)
Description copied from interface:ActiveMQProducerOperationsSend a ClientMessage to the server.- Specified by:
sendMessagein interfaceActiveMQProducerOperations- Parameters:
message- the message to send
-
sendMessage
public ClientMessage sendMessage(byte[] body)
Description copied from interface:ActiveMQProducerOperationsCreate a new ClientMessage with the specified body and send to the server.- Specified by:
sendMessagein interfaceActiveMQProducerOperations- Parameters:
body- the body for the new message- Returns:
- the message that was sent
-
sendMessage
public ClientMessage sendMessage(String body)
Description copied from interface:ActiveMQProducerOperationsCreate a new ClientMessage with the specified body and send to the server.- Specified by:
sendMessagein interfaceActiveMQProducerOperations- Parameters:
body- the body for the new message- Returns:
- the message that was sent
-
sendMessage
public ClientMessage sendMessage(Map<String,Object> properties)
Description copied from interface:ActiveMQProducerOperationsCreate a new ClientMessage with the specified properties and send to the server- Specified by:
sendMessagein interfaceActiveMQProducerOperations- Parameters:
properties- the properties for the new message- Returns:
- the message that was sent
-
sendMessage
public ClientMessage sendMessage(byte[] body, Map<String,Object> properties)
Description copied from interface:ActiveMQProducerOperationsCreate a new ClientMessage with the specified body and and properties and send to the server- Specified by:
sendMessagein interfaceActiveMQProducerOperationsproperties- the properties for the new message- Returns:
- the message that was sent
-
sendMessage
public ClientMessage sendMessage(String body, Map<String,Object> properties)
Description copied from interface:ActiveMQProducerOperationsCreate a new ClientMessage with the specified body and and properties and send to the server- Specified by:
sendMessagein interfaceActiveMQProducerOperationsproperties- the properties for the new message- Returns:
- the message that was sent
-
-