Package javax.jms

Examples of javax.jms.MessageProducer


      RedelMessageListenerImpl listener = new RedelMessageListenerImpl(true);
      listener.sess = sess;

      cons.setMessageListener(listener);

      MessageProducer prod = sessSend.createProducer(queue2);
      TextMessage m1 = sess.createTextMessage("a");
      TextMessage m2 = sess.createTextMessage("b");
      TextMessage m3 = sess.createTextMessage("c");

      prod.send(m1);
      prod.send(m2);
      prod.send(m3);

      listener.waitForMessages();

      assertFalse(listener.failed);
View Full Code Here


      ExceptionRedelMessageListenerImpl listener = new ExceptionRedelMessageListenerImpl(sess);

      cons.setMessageListener(listener);

      MessageProducer prod = sessSend.createProducer(queue2);
      TextMessage m1 = sess.createTextMessage("a");
      TextMessage m2 = sess.createTextMessage("b");
      TextMessage m3 = sess.createTextMessage("c");

      prod.send(m1);
      prod.send(m2);
      prod.send(m3);

      listener.waitForMessages();

      assertFalse(listener.failed);
View Full Code Here

      ExceptionRedelMessageListenerImpl listener = new ExceptionRedelMessageListenerImpl(sess);

      cons.setMessageListener(listener);

      MessageProducer prod = sessSend.createProducer(queue2);
      TextMessage m1 = sess.createTextMessage("a");
      TextMessage m2 = sess.createTextMessage("b");
      TextMessage m3 = sess.createTextMessage("c");

      prod.send(m1);
      prod.send(m2);
      prod.send(m3);

      listener.waitForMessages();

      assertFalse(listener.failed);
View Full Code Here

      ExceptionRedelMessageListenerImpl listener = new ExceptionRedelMessageListenerImpl(sess);

      cons.setMessageListener(listener);

      MessageProducer prod = sessSend.createProducer(queue2);
      TextMessage m1 = sess.createTextMessage("a");
      TextMessage m2 = sess.createTextMessage("b");
      TextMessage m3 = sess.createTextMessage("c");

      prod.send(m1);
      prod.send(m2);
      prod.send(m3);

      listener.waitForMessages();

      assertFalse(listener.failed);
View Full Code Here

      ExceptionRedelMessageListenerImpl listener = new ExceptionRedelMessageListenerImpl(sess);

      cons.setMessageListener(listener);

      MessageProducer prod = sessSend.createProducer(queue2);
      TextMessage m1 = sess.createTextMessage("a");
      TextMessage m2 = sess.createTextMessage("b");
      TextMessage m3 = sess.createTextMessage("c");

      prod.send(m1);
      prod.send(m2);
      prod.send(m3);

      listener.waitForMessages();

      assertFalse(listener.failed);
View Full Code Here

         assertEquals(0, ((JBossConnection)conn).getServerID());

         // send a message

         Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer p = s.createProducer(queue0);
         p.setDeliveryMode(DeliveryMode.PERSISTENT);
         p.send(s.createTextMessage("blip"));

         conn.close();

         // create a connection to a different node
View Full Code Here

   {

      Connection conn = cf.createConnection();

      Session producerSess = conn.createSession(true, Session.SESSION_TRANSACTED);
      MessageProducer producer = producerSess.createProducer(queue);

      Session consumerSess = conn.createSession(true, Session.SESSION_TRANSACTED);
      MessageConsumer consumer = consumerSess.createConsumer(queue);
      conn.start();

      final int NUM_MESSAGES = 20;

      //Send some messages
      for (int i = 0; i < NUM_MESSAGES; i++)
      {
         Message m = producerSess.createMessage();
         producer.send(m);
      }

      assertRemainingMessages(0);
     
      producerSess.rollback();
     
      //Send some messages
      for (int i = 0; i < NUM_MESSAGES; i++)
      {
         Message m = producerSess.createMessage();
         producer.send(m);
      }
      assertRemainingMessages(0);
     
      producerSess.commit();
View Full Code Here

  public void testClientAcknowledgeNoAcknowledgement() throws Exception
   {
    Connection conn = cf.createConnection();

    Session producerSess = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
    MessageProducer producer = producerSess.createProducer(queue);

    Session consumerSess = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
    MessageConsumer consumer = consumerSess.createConsumer(queue);
    conn.start();

    final int NUM_MESSAGES = 20;

    //Send some messages
    for (int i = 0; i < NUM_MESSAGES; i++)
    {
      Message m = producerSess.createMessage();
      producer.send(m);
    }
     
      assertRemainingMessages(NUM_MESSAGES);

    log.trace("Sent messages");
View Full Code Here

    Connection conn = cf.createConnection();
      for (int i=0; i<20; i++) System.out.println("*******************************************");
      System.out.println("clientID = " + conn.getClientID());

      Session producerSess = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
    MessageProducer producer = producerSess.createProducer(queue);
   
    Session consumerSess = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
    MessageConsumer consumer = consumerSess.createConsumer(queue);
    conn.start();
   
    final int NUM_MESSAGES = 20;
   
    for (int i = 0; i < NUM_MESSAGES; i++)
    {
      Message m = producerSess.createMessage();
      producer.send(m);
    }
     
      assertRemainingMessages(NUM_MESSAGES);
   
    log.trace("Sent " + NUM_MESSAGES + " messages");
View Full Code Here

   {

    Connection conn = cf.createConnection();

    Session producerSess = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
    MessageProducer producer = producerSess.createProducer(queue);

    Session consumerSess = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
    MessageConsumer consumer = consumerSess.createConsumer(queue);
    conn.start();

    final int NUM_MESSAGES = 20;

    //Send some messages
    for (int i = 0; i < NUM_MESSAGES; i++)
    {
      Message m = producerSess.createMessage();
      producer.send(m);
    }
     
      assertRemainingMessages(NUM_MESSAGES);

    log.trace("Sent messages");
View Full Code Here

TOP

Related Classes of javax.jms.MessageProducer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.