Java Code Examples for org.apache.activemq.command.ActiveMQTextMessage#setMessageId()

The following examples show how to use org.apache.activemq.command.ActiveMQTextMessage#setMessageId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BrokerNetworkWithStuckMessagesTest.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 2
Source File: QueueOptimizedDispatchExceptionTest.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
private Message getMessage(int i) throws Exception {
   ActiveMQTextMessage message = new ActiveMQTextMessage();
   message.setMessageId(new MessageId(mesageIdRoot + i));
   message.setDestination(destination);
   message.setPersistent(false);
   message.setResponseRequired(true);
   message.setText("Msg:" + i + " " + text);
   assertEquals(message.getMessageId().getProducerSequenceId(), i);
   return message;
}
 
Example 3
Source File: StoreQueueCursorNoDuplicateTest.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
private ActiveMQTextMessage getMessage(int i) throws Exception {
   ActiveMQTextMessage message = new ActiveMQTextMessage();
   MessageId id = new MessageId(mesageIdRoot + i);
   id.setBrokerSequenceId(i);
   id.setProducerSequenceId(i);
   message.setMessageId(id);
   message.setDestination(destination);
   message.setPersistent(true);
   message.setResponseRequired(true);
   message.setText("Msg:" + i + " " + text);
   assertEquals(message.getMessageId().getProducerSequenceId(), i);
   return message;
}
 
Example 4
Source File: StoreQueueCursorOrderTest.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
private ActiveMQTextMessage getMessage(int i) throws Exception {
   ActiveMQTextMessage message = new ActiveMQTextMessage();
   MessageId id = new MessageId(mesageIdRoot + i);
   id.setBrokerSequenceId(i);
   id.setProducerSequenceId(i);
   message.setMessageId(id);
   message.setDestination(destination);
   message.setPersistent(true);
   message.setResponseRequired(true);
   message.setText("Msg:" + i + " " + text);
   assertEquals(message.getMessageId().getProducerSequenceId(), i);
   return message;
}
 
Example 5
Source File: QueueDuplicatesFromStoreTest.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
private Message getMessage(int i) throws Exception {
   ActiveMQTextMessage message = new ActiveMQTextMessage();
   message.setMessageId(new MessageId(mesageIdRoot + i));
   message.setDestination(destination);
   message.setPersistent(true);
   message.setResponseRequired(true);
   message.setText("Msg:" + i + " " + text);
   assertEquals(message.getMessageId().getProducerSequenceId(), i);
   return message;
}
 
Example 6
Source File: BrokerTestSupport.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 7
Source File: FanoutTransportBrokerTest.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 8
Source File: FailoverTransportBrokerTest.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
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;
}