Search in sources :

Example 16 with ClientMessage

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

the class ActiveMQProducerResource method createMessage.

/**
 * Create a ClientMessage with the specified body and message properties
 * <p>
 * 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 createMessage(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)

Example 17 with ClientMessage

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

the class ActiveMQProducerResource method sendMessage.

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

Example 18 with ClientMessage

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

the class ActiveMQProducerResource method sendMessage.

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

Example 19 with ClientMessage

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

the class ActiveMQProducerResource method createMessage.

/**
 * Create a ClientMessage with the specified message properties
 * <p>
 * If useDurableMessage is false, a non-durable message is created.  Otherwise, a durable message is created
 *
 * @param properties message properties for the new message
 * @return a new ClientMessage with the specified message properties
 */
public ClientMessage createMessage(Map<String, Object> properties) {
    ClientMessage message = createMessage();
    addMessageProperties(message, properties);
    return message;
}
Also used : ClientMessage(org.apache.activemq.artemis.api.core.client.ClientMessage)

Example 20 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 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, String body) {
    ClientMessage message = createMessage(body);
    sendMessage(targetAddress, message);
    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