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 Apache Artemis ClientProducer bound to a specific address into a test.
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractActiveMQClientDelegate
AbstractActiveMQClientDelegate.ActiveMQClientResourceException -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedActiveMQProducerDelegate(String url, String address) protectedActiveMQProducerDelegate(String url, String username, String password) protectedActiveMQProducerDelegate(String url, String address, String username, String password) protectedActiveMQProducerDelegate(String url, SimpleString address) protectedActiveMQProducerDelegate(String url, SimpleString address, String username, String password) protectedActiveMQProducerDelegate(ServerLocator serverLocator) protectedActiveMQProducerDelegate(ServerLocator serverLocator, String address) protectedActiveMQProducerDelegate(ServerLocator serverLocator, String username, String password) protectedActiveMQProducerDelegate(ServerLocator serverLocator, String address, String username, String password) protectedActiveMQProducerDelegate(ServerLocator serverLocator, SimpleString address) protectedActiveMQProducerDelegate(ServerLocator serverLocator, SimpleString address, String username, String password) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCreate a ClientMessage.createMessage(byte[] body) Create a ClientMessage with the specified body.createMessage(byte[] body, Map<String, Object> properties) Create a ClientMessage with the specified body and message properties.createMessage(String body) Create a ClientMessage with the specified body.createMessage(String body, Map<String, Object> properties) Create a ClientMessage with the specified body and message properties.createMessage(Map<String, Object> properties) Create a ClientMessage with the specified message properties.booleansendMessage(byte[] body) Create a new ClientMessage with the specified body and send to the server.sendMessage(byte[] body, Map<String, Object> properties) Create a new ClientMessage with the specified body and and properties and send to the serversendMessage(String body) Create a new ClientMessage with the specified body and send to the server.sendMessage(String body, Map<String, Object> properties) Create a new ClientMessage with the specified body and and properties and send to the serversendMessage(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 voidMethods inherited from class AbstractActiveMQClientDelegate
addMessageProperties, isAutoCreateQueue, setAutoCreateQueue
-
Constructor Details
-
ActiveMQProducerDelegate
-
ActiveMQProducerDelegate
-
ActiveMQProducerDelegate
-
ActiveMQProducerDelegate
-
ActiveMQProducerDelegate
-
ActiveMQProducerDelegate
-
ActiveMQProducerDelegate
protected ActiveMQProducerDelegate(String url, SimpleString address, String username, String password) -
ActiveMQProducerDelegate
-
ActiveMQProducerDelegate
protected ActiveMQProducerDelegate(ServerLocator serverLocator, String address, String username, String password) -
ActiveMQProducerDelegate
-
ActiveMQProducerDelegate
protected ActiveMQProducerDelegate(ServerLocator serverLocator, SimpleString address, String username, String password) -
ActiveMQProducerDelegate
-
-
Method Details
-
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- iftrue, durable messages will be created
-
createClient
protected void createClient()- Specified by:
createClientin classAbstractActiveMQClientDelegate
-
stopClient
protected void stopClient()- Specified by:
stopClientin classAbstractActiveMQClientDelegate
-
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
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
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
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
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
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
Description copied from interface:ActiveMQProducerOperationsSend a ClientMessage to the server.- Specified by:
sendMessagein interfaceActiveMQProducerOperations- Parameters:
message- the message to send
-
sendMessage
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
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
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
Description copied from interface:ActiveMQProducerOperationsCreate a new ClientMessage with the specified body and and 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
Description copied from interface:ActiveMQProducerOperationsCreate a new ClientMessage with the specified body and and properties and send to the server- Specified by:
sendMessagein interfaceActiveMQProducerOperations- Parameters:
properties- the properties for the new message- Returns:
- the message that was sent
-