Search in sources :

Example 21 with ClientMessage

use of org.apache.activemq.artemis.api.core.client.ClientMessage in project activemq-artemis by apache.

the class ActiveMQDynamicProducerResource method sendMessage.

/**
 * Create a new ClientMessage with the specified body and send to the specified address on the server
 *
 * @param targetAddress the target address
 * @param body          the body for the new message
 * @return the message that was sent
 */
public ClientMessage sendMessage(SimpleString targetAddress, byte[] body) {
    ClientMessage message = createMessage(body);
    sendMessage(targetAddress, message);
    return message;
}
Also used : ClientMessage(org.apache.activemq.artemis.api.core.client.ClientMessage)

Example 22 with ClientMessage

use of org.apache.activemq.artemis.api.core.client.ClientMessage in project activemq-artemis by apache.

the class ActiveMQDynamicProducerResource method sendMessage.

/**
 * Create a new ClientMessage with the specified body and and properties and send to the server
 *
 * @param targetAddress the target address
 * @param properties    the properties for the new message
 * @return the message that was sent
 */
public ClientMessage sendMessage(SimpleString targetAddress, String body, Map<String, Object> properties) {
    ClientMessage message = createMessage(body);
    sendMessage(targetAddress, message);
    return message;
}
Also used : ClientMessage(org.apache.activemq.artemis.api.core.client.ClientMessage)

Example 23 with ClientMessage

use of org.apache.activemq.artemis.api.core.client.ClientMessage in project activemq-artemis by apache.

the class ActiveMQDynamicProducerResource method sendMessage.

/**
 * Create a new ClientMessage with the specified body and and properties and send to the server
 *
 * @param targetAddress the target address
 * @param properties    the properties for the new message
 * @return the message that was sent
 */
public ClientMessage sendMessage(SimpleString targetAddress, byte[] body, Map<String, Object> properties) {
    ClientMessage message = createMessage(body);
    sendMessage(targetAddress, message);
    return message;
}
Also used : ClientMessage(org.apache.activemq.artemis.api.core.client.ClientMessage)

Example 24 with ClientMessage

use of org.apache.activemq.artemis.api.core.client.ClientMessage in project activemq-artemis by apache.

the class EmbeddedActiveMQResource method sendMessageWithProperties.

/**
 * Create a new message with the specified properties, and send the message to an queueName
 *
 * @param address    the target queueName for the message
 * @param properties message properties for the new message
 * @return the message that was sent
 */
public ClientMessage sendMessageWithProperties(SimpleString address, Map<String, Object> properties) {
    ClientMessage message = createMessageWithProperties(properties);
    sendMessage(address, message);
    return message;
}
Also used : ClientMessage(org.apache.activemq.artemis.api.core.client.ClientMessage)

Example 25 with ClientMessage

use of org.apache.activemq.artemis.api.core.client.ClientMessage in project activemq-artemis by apache.

the class EmbeddedActiveMQResource method 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
 *
 * @param body       the body for the new message
 * @param properties message properties for the new message
 * @return a new ClientMessage with the specified body and message properties
 */
public ClientMessage createMessageWithProperties(byte[] body, Map<String, Object> properties) {
    ClientMessage message = createMessage(body);
    addMessageProperties(message, properties);
    return message;
}
Also used : ClientMessage(org.apache.activemq.artemis.api.core.client.ClientMessage)

Aggregations

ClientMessage (org.apache.activemq.artemis.api.core.client.ClientMessage)889 ClientProducer (org.apache.activemq.artemis.api.core.client.ClientProducer)708 Test (org.junit.Test)647 ClientConsumer (org.apache.activemq.artemis.api.core.client.ClientConsumer)623 ClientSession (org.apache.activemq.artemis.api.core.client.ClientSession)606 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)445 ClientSessionFactory (org.apache.activemq.artemis.api.core.client.ClientSessionFactory)363 ServerLocator (org.apache.activemq.artemis.api.core.client.ServerLocator)167 ActiveMQServer (org.apache.activemq.artemis.core.server.ActiveMQServer)140 AddressSettings (org.apache.activemq.artemis.core.settings.impl.AddressSettings)102 CountDownLatch (java.util.concurrent.CountDownLatch)99 Configuration (org.apache.activemq.artemis.core.config.Configuration)87 ActiveMQException (org.apache.activemq.artemis.api.core.ActiveMQException)85 Queue (org.apache.activemq.artemis.core.server.Queue)72 Xid (javax.transaction.xa.Xid)67 DivertConfiguration (org.apache.activemq.artemis.core.config.DivertConfiguration)63 StoreConfiguration (org.apache.activemq.artemis.core.config.StoreConfiguration)54 HashMap (java.util.HashMap)53 ArrayList (java.util.ArrayList)51 DatabaseStorageConfiguration (org.apache.activemq.artemis.core.config.storage.DatabaseStorageConfiguration)47