Package javax.jms

Examples of javax.jms.QueueSession.createProducer()


      int received = 0;
     
      public void doRun() throws Exception
      {
         QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer producer = session.createProducer(queue);
         for (int i = 0; i < getIterationCount(); ++i)
         {
            Message message = session.createTextMessage("" + i);
            producer.send(message);
         }
View Full Code Here


        final Queue replyDestination = session.createTemporaryQueue();
        final QueueReceiver receiver = session.createReceiver(replyDestination);
        final Message message = session.createTextMessage("Test");
        message.setJMSReplyTo(replyDestination);
        final Destination destination = (Destination) ctx.lookup("queue/test");
        final MessageProducer producer = session.createProducer(destination);
        producer.send(message);
        producer.close();

        final Message reply = receiver.receive(1000);
        assertNotNull(reply);
View Full Code Here

            final Queue replyDestination = session.createTemporaryQueue();
            final QueueReceiver receiver = session.createReceiver(replyDestination);
            final Message message = session.createTextMessage("Test");
            message.setJMSReplyTo(replyDestination);
            final Destination destination = (Destination) ctx.lookup("queue/test");
            final MessageProducer producer = session.createProducer(destination);
            producer.send(message);
            producer.close();

            final Message reply = receiver.receive(1000);
            assertNotNull(reply);
View Full Code Here

      try
      {
         conn = cf.createQueueConnection();
         QueueSession sess = conn.createQueueSession(true, 0);
         JBossMessageProducer producer = (JBossMessageProducer)sess.createProducer(queue1);
         producer.enableOrderingGroup(null);

         QueueReceiver cons = sess.createReceiver(queue1);

         conn.start();
View Full Code Here

    MockControl mockSession = MockControl.createControl(QueueSession.class);
    final QueueSession session = (QueueSession) mockSession.getMock();
    session.createTextMessage(RESPONSE_TEXT);
    mockSession.setReturnValue(responseTextMessage);
    session.createProducer(destination);
    mockSession.setReturnValue(messageProducer);
    mockSession.replay();

    MockControl mockDelegate = MockControl.createControl(ResponsiveMessageDelegate.class);
    ResponsiveMessageDelegate delegate = (ResponsiveMessageDelegate) mockDelegate.getMock();
View Full Code Here

      int received = 0;
     
      public void doRun() throws Exception
      {
         QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer producer = session.createProducer(queue);
         for (int i = 0; i < getIterationCount(); ++i)
         {
            Message message = session.createTextMessage("" + i);
            producer.send(message);
         }
View Full Code Here

            final Queue replyDestination = session.createTemporaryQueue();
            final QueueReceiver receiver = session.createReceiver(replyDestination);
            final Message message = session.createTextMessage("Test");
            message.setJMSReplyTo(replyDestination);
            final Destination destination = (Destination) ctx.lookup("queue/myAwesomeQueue");
            final MessageProducer producer = session.createProducer(destination);
            producer.send(message);
            producer.close();

            final Message reply = receiver.receive(1000);
            assertNotNull(reply);
View Full Code Here

      final Queue replyDestination = session.createTemporaryQueue();
      final QueueReceiver receiver = session.createReceiver(replyDestination);
      final Message message = session.createTextMessage("Let's test it!");
      message.setJMSReplyTo(replyDestination);
      final Destination destination = (Destination) ctx.lookup("queue/myAwesomeQueue");
      final MessageProducer producer = session.createProducer(destination);
      producer.send(message);
      producer.close();

      final Message reply = receiver.receive(TimeoutUtil.adjust(5000));
      assertNotNull(reply);
View Full Code Here

            final Queue replyDestination = session.createTemporaryQueue();
            final String requestMessage = "test";
            final Message message = session.createTextMessage(requestMessage);
            message.setJMSReplyTo(replyDestination);
            final Destination destination = (Destination) ctx.lookup(Constants.QUEUE_JNDI_NAME);
            final MessageProducer producer = session.createProducer(destination);
            producer.send(message);
            producer.close();

            // wait for a reply
            final QueueReceiver receiver = session.createReceiver(replyDestination);
View Full Code Here

            final Queue replyDestination = session.createTemporaryQueue();
            final String requestMessage = "test";
            final Message message = session.createTextMessage(requestMessage);
            message.setJMSReplyTo(replyDestination);
            final Destination destination = (Destination) context.lookup(Constants.QUEUE_JNDI_NAME);
            final MessageProducer producer = session.createProducer(destination);
            producer.send(message);
            producer.close();

            // wait for a reply
            final QueueReceiver receiver = session.createReceiver(replyDestination);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.