Search in sources :

Example 6 with MessageId

use of org.apache.activemq.command.MessageId in project activemq-artemis by apache.

the class BrokerNetworkWithStuckMessagesTest method createMessage.

protected Message createMessage(ProducerInfo producerInfo, ActiveMQDestination destination) {
    ActiveMQTextMessage message = new ActiveMQTextMessage();
    message.setMessageId(new MessageId(producerInfo, ++msgIdGenerator));
    message.setDestination(destination);
    message.setPersistent(false);
    try {
        message.setText("Test Message Payload.");
    } catch (MessageNotWriteableException e) {
    }
    return message;
}
Also used : MessageNotWriteableException(javax.jms.MessageNotWriteableException) ActiveMQTextMessage(org.apache.activemq.command.ActiveMQTextMessage) MessageId(org.apache.activemq.command.MessageId)

Example 7 with MessageId

use of org.apache.activemq.command.MessageId in project activemq-artemis by apache.

the class MessageIdTest method populateObject.

@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    MessageId info = (MessageId) object;
    info.setProducerId(createProducerId("ProducerId:1"));
    info.setProducerSequenceId(1);
    info.setBrokerSequenceId(2);
}
Also used : MessageId(org.apache.activemq.command.MessageId)

Example 8 with MessageId

use of org.apache.activemq.command.MessageId in project activemq-artemis by apache.

the class MessageIdTest method populateObject.

@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    MessageId info = (MessageId) object;
    info.setProducerId(createProducerId("ProducerId:1"));
    info.setProducerSequenceId(1);
    info.setBrokerSequenceId(2);
}
Also used : MessageId(org.apache.activemq.command.MessageId)

Example 9 with MessageId

use of org.apache.activemq.command.MessageId in project activemq-artemis by apache.

the class MessageIdTest method populateObject.

@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    MessageId info = (MessageId) object;
    info.setProducerId(createProducerId("ProducerId:1"));
    info.setProducerSequenceId(1);
    info.setBrokerSequenceId(2);
}
Also used : MessageId(org.apache.activemq.command.MessageId)

Example 10 with MessageId

use of org.apache.activemq.command.MessageId in project activemq-artemis by apache.

the class MessageIdTest method createObject.

@Override
public Object createObject() throws Exception {
    MessageId info = new MessageId();
    populateObject(info);
    return info;
}
Also used : MessageId(org.apache.activemq.command.MessageId)

Aggregations

MessageId (org.apache.activemq.command.MessageId)38 ActiveMQTextMessage (org.apache.activemq.command.ActiveMQTextMessage)10 ActiveMQMessage (org.apache.activemq.command.ActiveMQMessage)5 MessageNotWriteableException (javax.jms.MessageNotWriteableException)4 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)4 ActiveMQDestination (org.apache.activemq.command.ActiveMQDestination)4 ProducerId (org.apache.activemq.command.ProducerId)4 ArrayList (java.util.ArrayList)3 ExecutorService (java.util.concurrent.ExecutorService)3 Message (org.apache.activemq.command.Message)3 ProducerInfo (org.apache.activemq.command.ProducerInfo)3 Connection (javax.jms.Connection)2 JMSException (javax.jms.JMSException)2 Message (javax.jms.Message)2 MessageConsumer (javax.jms.MessageConsumer)2 MessageProducer (javax.jms.MessageProducer)2 Session (javax.jms.Session)2 ActiveMQBuffer (org.apache.activemq.artemis.api.core.ActiveMQBuffer)2 MessageReference (org.apache.activemq.broker.region.MessageReference)2 ConsumerInfo (org.apache.activemq.command.ConsumerInfo)2