Tabnine Logo
TextMessage.getJMSDestination
Code IndexAdd Tabnine to your IDE (free)

How to use
getJMSDestination
method
in
javax.jms.TextMessage

Best Java code snippets using javax.jms.TextMessage.getJMSDestination (Showing top 7 results out of 315)

origin: spring-projects/spring-integration

@Test
public void channelAdapter() throws Exception {
  Message<?> message1 = MessageBuilder.withPayload("test-1").setHeader("destinationNumber", 1).build();
  Message<?> message2 = MessageBuilder.withPayload("test-2").setHeader("destinationNumber", 2).build();
  channelAdapterChannel.send(message1);
  channelAdapterChannel.send(message2);
  Message<?> result1 = channelAdapterResults1.receive(5000);
  Message<?> result2 = channelAdapterResults2.receive(5000);
  assertNotNull(result1);
  assertNotNull(result2);
  TextMessage jmsResult1 = (TextMessage) result1.getPayload();
  TextMessage jmsResult2 = (TextMessage) result2.getPayload();
  assertEquals("test-1", jmsResult1.getText());
  assertEquals("queue://queue.test.dynamic.adapter.1", jmsResult1.getJMSDestination().toString());
  assertEquals("test-2", jmsResult2.getText());
  assertEquals("queue://queue.test.dynamic.adapter.2", jmsResult2.getJMSDestination().toString());
}
origin: apache/activemq-artemis

@Test
public void testMultipleSendingToCoreJms() throws Exception {
 final String text = "HelloWorld";
 final int num = 100;
 Connection jmsConn = null;
 try {
   jmsConn = coreCf.createConnection();
   jmsConn.start();
   Session session = jmsConn.createSession(false, Session.AUTO_ACKNOWLEDGE);
   Queue queue = session.createQueue(this.queueName);
   MessageConsumer coreConsumer = session.createConsumer(queue);
   //text messages
   sendMultipleTextMessagesUsingOpenWire(text, num);
   for (int i = 0; i < num; i++) {
    TextMessage txtMessage = (TextMessage) coreConsumer.receive(5000);
    assertEquals(txtMessage.getJMSDestination(), queue);
    assertEquals(text + i, txtMessage.getText());
   }
 } finally {
   if (jmsConn != null) {
    jmsConn.close();
   }
 }
}
origin: org.apache.beam/beam-sdks-java-io-jms

 @Override
 public JmsRecord mapMessage(Message message) throws Exception {
  TextMessage textMessage = (TextMessage) message;
  Map<String, Object> properties = new HashMap<>();
  @SuppressWarnings("rawtypes")
  Enumeration propertyNames = textMessage.getPropertyNames();
  while (propertyNames.hasMoreElements()) {
   String propertyName = (String) propertyNames.nextElement();
   properties.put(propertyName, textMessage.getObjectProperty(propertyName));
  }
  JmsRecord jmsRecord =
    new JmsRecord(
      textMessage.getJMSMessageID(),
      textMessage.getJMSTimestamp(),
      textMessage.getJMSCorrelationID(),
      textMessage.getJMSReplyTo(),
      textMessage.getJMSDestination(),
      textMessage.getJMSDeliveryMode(),
      textMessage.getJMSRedelivered(),
      textMessage.getJMSType(),
      textMessage.getJMSExpiration(),
      textMessage.getJMSPriority(),
      properties,
      textMessage.getText());
  return jmsRecord;
 }
})
origin: apache/activemq-artemis

@Test
public void testRedeployQueue() throws Exception {
 Connection conn = createConnection();
 Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
 MessageProducer p = s.createProducer(queue1);
 MessageConsumer c = s.createConsumer(queue1);
 conn.start();
 for (int i = 0; i < 500; i++) {
   p.send(s.createTextMessage("payload " + i));
 }
 conn.close();
 stop();
 startNoDelete();
 deployAndLookupAdministeredObjects();
 conn = createConnection();
 s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
 p = s.createProducer(queue1);
 c = s.createConsumer(queue1);
 conn.start();
 for (int i = 0; i < 500; i++) {
   TextMessage message = (TextMessage) c.receive(3000);
   ProxyAssertSupport.assertNotNull(message);
   ProxyAssertSupport.assertNotNull(message.getJMSDestination());
 }
}
origin: apache/activemq-artemis

@Test
public void testMutipleReceivingFromCore() throws Exception {
 final String text = "HelloWorld";
 final int num = 100;
 //text messages
 sendMultipleTextMessagesUsingCoreJms(queueName, text, 100);
 connection.start();
 Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 ActiveMQDestination destination = createDestination(session, ActiveMQDestination.QUEUE_TYPE);
 final ActiveMQMessageConsumer consumer = (ActiveMQMessageConsumer) session.createConsumer(destination);
 for (int i = 0; i < num; i++) {
   TextMessage textMessage = (TextMessage) consumer.receive(5000);
   assertEquals(text + i, textMessage.getText());
   assertEquals(destination, textMessage.getJMSDestination());
 }
}
origin: apache/activemq-artemis

assertEquals(txtMessage.getJMSDestination(), queue);
origin: apache/activemq-artemis

assertEquals(destination, textMessage.getJMSDestination());
javax.jmsTextMessagegetJMSDestination

Popular methods of TextMessage

  • getText
    Gets the string containing this message's data. The default value is null.
  • setText
    Sets the string containing this message's data.
  • setStringProperty
  • setJMSCorrelationID
  • setIntProperty
  • setLongProperty
  • getStringProperty
  • setBooleanProperty
  • setJMSReplyTo
  • getJMSCorrelationID
  • getJMSMessageID
  • getJMSReplyTo
  • getJMSMessageID,
  • getJMSReplyTo,
  • setDoubleProperty,
  • acknowledge,
  • setJMSType,
  • getJMSDeliveryMode,
  • setObjectProperty,
  • getIntProperty,
  • getJMSPriority,
  • clearBody

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSharedPreferences (Context)
  • putExtra (Intent)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • JOptionPane (javax.swing)
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now