Java Code Examples for javax.jms.Message#DEFAULT_DELIVERY_MODE

The following examples show how to use javax.jms.Message#DEFAULT_DELIVERY_MODE . 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: ActiveMQMessageTest.java    From activemq-artemis with Apache License 2.0 6 votes vote down vote up
@Override
protected void setUp() throws Exception {
   super.setUp();
   this.jmsMessageID = "ID:TEST-ID:0:0:0:1";
   this.jmsCorrelationID = "testcorrelationid";
   this.jmsDestination = new ActiveMQTopic("test.topic");
   this.jmsReplyTo = new ActiveMQTempTopic("test.replyto.topic:001");
   this.jmsDeliveryMode = Message.DEFAULT_DELIVERY_MODE;
   this.jmsRedelivered = true;
   this.jmsType = "test type";
   this.jmsExpiration = 100000;
   this.jmsPriority = 5;
   this.jmsTimestamp = System.currentTimeMillis();
   this.readOnlyMessage = false;
   this.consumerIDs = new long[3];
   for (int i = 0; i < this.consumerIDs.length; i++) {
      this.consumerIDs[i] = i;
   }
}
 
Example 2
Source File: JmsMessageTest.java    From qpid-jms with Apache License 2.0 6 votes vote down vote up
@Before
public void setUp() throws Exception {
    this.jmsMessageID = "ID:TEST-ID:0:0:0:1";
    this.jmsCorrelationID = "testcorrelationid";
    this.jmsDestination = new JmsTopic("test.topic");
    this.jmsReplyTo = new JmsTopic("test.replyto.topic:001");
    this.jmsDeliveryMode = Message.DEFAULT_DELIVERY_MODE;
    this.jmsRedelivered = true;
    this.jmsType = "test type";
    this.jmsExpiration = 100000;
    this.jmsPriority = 5;
    this.jmsTimestamp = System.currentTimeMillis();
    this.consumerIDs = new long[3];
    for (int i = 0; i < this.consumerIDs.length; i++) {
        this.consumerIDs[i] = i;
    }
}
 
Example 3
Source File: ProducerConfig.java    From qpid-broker-j with Apache License 2.0 5 votes vote down vote up
public ProducerConfig()
{
    _deliveryMode = Message.DEFAULT_DELIVERY_MODE;
    _messageSize = 1024;
    _priority = Message.DEFAULT_PRIORITY;
    _timeToLive = Message.DEFAULT_TIME_TO_LIVE;
    _interval = 0;
    _messageProviderName = null;
}
 
Example 4
Source File: ActiveMQMessageTest.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
public void testCopy() throws Exception {
   this.jmsMessageID = "testid";
   this.jmsCorrelationID = "testcorrelationid";
   this.jmsDestination = new ActiveMQTopic("test.topic");
   this.jmsReplyTo = new ActiveMQTempTopic("test.replyto.topic:001");
   this.jmsDeliveryMode = Message.DEFAULT_DELIVERY_MODE;
   this.jmsRedelivered = true;
   this.jmsType = "test type";
   this.jmsExpiration = 100000;
   this.jmsPriority = 5;
   this.jmsTimestamp = System.currentTimeMillis();
   this.readOnlyMessage = false;

   ActiveMQMessage msg1 = new ActiveMQMessage();
   msg1.setJMSMessageID(this.jmsMessageID);
   msg1.setJMSCorrelationID(this.jmsCorrelationID);
   msg1.setJMSDestination(this.jmsDestination);
   msg1.setJMSReplyTo(this.jmsReplyTo);
   msg1.setJMSDeliveryMode(this.jmsDeliveryMode);
   msg1.setJMSRedelivered(this.jmsRedelivered);
   msg1.setJMSType(this.jmsType);
   msg1.setJMSExpiration(this.jmsExpiration);
   msg1.setJMSPriority(this.jmsPriority);
   msg1.setJMSTimestamp(this.jmsTimestamp);
   msg1.setReadOnlyProperties(true);
   ActiveMQMessage msg2 = new ActiveMQMessage();
   msg1.copy(msg2);
   assertEquals(msg1.getJMSMessageID(), msg2.getJMSMessageID());
   assertTrue(msg1.getJMSCorrelationID().equals(msg2.getJMSCorrelationID()));
   assertTrue(msg1.getJMSDestination().equals(msg2.getJMSDestination()));
   assertTrue(msg1.getJMSReplyTo().equals(msg2.getJMSReplyTo()));
   assertTrue(msg1.getJMSDeliveryMode() == msg2.getJMSDeliveryMode());
   assertTrue(msg1.getJMSRedelivered() == msg2.getJMSRedelivered());
   assertTrue(msg1.getJMSType().equals(msg2.getJMSType()));
   assertTrue(msg1.getJMSExpiration() == msg2.getJMSExpiration());
   assertTrue(msg1.getJMSPriority() == msg2.getJMSPriority());
   assertTrue(msg1.getJMSTimestamp() == msg2.getJMSTimestamp());

   LOG.info("Message is:  " + msg1);
}
 
Example 5
Source File: JmsMessageTest.java    From qpid-jms with Apache License 2.0 4 votes vote down vote up
@Test
public void testCopy() throws Exception {
    this.jmsMessageID = "testid";
    this.jmsCorrelationID = "testcorrelationid";
    this.jmsDestination = new JmsTopic("test.topic");
    this.jmsReplyTo = new JmsTopic("test.replyto.topic:001");
    this.jmsDeliveryMode = Message.DEFAULT_DELIVERY_MODE;
    this.jmsRedelivered = true;
    this.jmsType = "test type";
    this.jmsExpiration = 100000;
    this.jmsPriority = 5;
    this.jmsTimestamp = System.currentTimeMillis();

    JmsConnection connection = Mockito.mock(JmsConnection.class);

    JmsMessage msg1 = factory.createMessage();
    msg1.setJMSMessageID(this.jmsMessageID);
    msg1.setJMSCorrelationID(this.jmsCorrelationID);
    msg1.setJMSDestination(this.jmsDestination);
    msg1.setJMSReplyTo(this.jmsReplyTo);
    msg1.setJMSDeliveryMode(this.jmsDeliveryMode);
    msg1.setJMSRedelivered(this.jmsRedelivered);
    msg1.setJMSType(this.jmsType);
    msg1.setJMSExpiration(this.jmsExpiration);
    msg1.setJMSPriority(this.jmsPriority);
    msg1.setJMSTimestamp(this.jmsTimestamp);
    msg1.setReadOnlyProperties(true);
    msg1.setConnection(connection);
    boolean isValidate = !msg1.isValidatePropertyNames();
    msg1.setValidatePropertyNames(isValidate);
    JmsMessage msg2 = msg1.copy();
    assertEquals(msg1.getJMSMessageID(), msg2.getJMSMessageID());
    assertTrue(msg2.isReadOnlyProperties());
    assertTrue(msg1.getJMSCorrelationID().equals(msg2.getJMSCorrelationID()));
    assertTrue(msg1.getJMSDestination().equals(msg2.getJMSDestination()));
    assertTrue(msg1.getJMSReplyTo().equals(msg2.getJMSReplyTo()));
    assertEquals(msg1.getJMSDeliveryMode(), msg2.getJMSDeliveryMode());
    assertEquals(msg1.getJMSRedelivered(), msg2.getJMSRedelivered());
    assertEquals(msg1.getJMSType(), msg2.getJMSType());
    assertEquals(msg1.getJMSExpiration(), msg2.getJMSExpiration());
    assertEquals(msg1.getJMSPriority(), msg2.getJMSPriority());
    assertEquals(msg1.getJMSTimestamp(), msg2.getJMSTimestamp());
    assertEquals(msg1.getConnection(), msg2.getConnection());
    assertEquals(msg1.isValidatePropertyNames(), msg2.isValidatePropertyNames());

    LOG.info("Message is:  " + msg1);
}
 
Example 6
Source File: QosSettings.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Create a new instance with the default settings.
 * @see Message#DEFAULT_DELIVERY_MODE
 * @see Message#DEFAULT_PRIORITY
 * @see Message#DEFAULT_TIME_TO_LIVE
 */
public QosSettings() {
	this(Message.DEFAULT_DELIVERY_MODE, Message.DEFAULT_PRIORITY, Message.DEFAULT_TIME_TO_LIVE);
}
 
Example 7
Source File: QosSettings.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Create a new instance with the default settings.
 * @see Message#DEFAULT_DELIVERY_MODE
 * @see Message#DEFAULT_PRIORITY
 * @see Message#DEFAULT_TIME_TO_LIVE
 */
public QosSettings() {
	this(Message.DEFAULT_DELIVERY_MODE, Message.DEFAULT_PRIORITY, Message.DEFAULT_TIME_TO_LIVE);
}