Package javax.jms

Examples of javax.jms.MessageListener


         log.trace("testStopConnectionWhileOnMessageIsExecuting");
      }

      final AtomicInteger messagesReceived = new AtomicInteger(0);

      MessageListener myListener = new MessageListener()
      {
         public void onMessage(final Message message)
         {
            messagesReceived.incrementAndGet();
            try
View Full Code Here


         MessageProducer queueProducer = producerSession.createProducer(HornetQServerTestCase.queue1);

         MessageConsumer queueConsumer = consumerSession.createConsumer(HornetQServerTestCase.queue1);

         MessageListener myListener = new MessageListener()
         {
            public void onMessage(final Message message)
            {
               try
               {
View Full Code Here

      final Result result = new Result();
      Connection conn = JMSTestCase.cf.createConnection();
      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      final MessageConsumer cons = s.createConsumer(HornetQServerTestCase.queue1);
      cons.setMessageListener(new MessageListener()
      {
         public void onMessage(final Message m)
         {
            // close the connection on the same thread that processed the message
            try
View Full Code Here

      final Result result = new Result();
      Connection conn = JMSTestCase.cf.createConnection();
      final Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      MessageConsumer cons = session.createConsumer(HornetQServerTestCase.queue1);
      cons.setMessageListener(new MessageListener()
      {
         public void onMessage(final Message m)
         {
            // close the connection on the same thread that processed the message
            try
View Full Code Here

      final Result result = new Result();
      final Connection conn = JMSTestCase.cf.createConnection();
      Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      MessageConsumer cons = s.createConsumer(HornetQServerTestCase.queue1);
      cons.setMessageListener(new MessageListener()
      {
         public void onMessage(final Message m)
         {
            // close the connection on the same thread that processed the message
            try
View Full Code Here

      final Result result = new Result();
      Connection conn = JMSTestCase.cf.createConnection();
      Session s = conn.createSession(true, Session.SESSION_TRANSACTED);
      final MessageConsumer cons = s.createConsumer(HornetQServerTestCase.queue1);
      cons.setMessageListener(new MessageListener()
      {
         public void onMessage(final Message m)
         {
            // close the connection on the same thread that processed the message
            try
View Full Code Here

      final Result result = new Result();
      Connection conn = JMSTestCase.cf.createConnection();
      final Session session = conn.createSession(true, Session.SESSION_TRANSACTED);
      MessageConsumer cons = session.createConsumer(HornetQServerTestCase.queue1);
      cons.setMessageListener(new MessageListener()
      {
         public void onMessage(final Message m)
         {
            // close the connection on the same thread that processed the message
            try
View Full Code Here

      final Result result = new Result();
      final Connection conn = JMSTestCase.cf.createConnection();
      Session s = conn.createSession(true, Session.SESSION_TRANSACTED);
      MessageConsumer cons = s.createConsumer(HornetQServerTestCase.queue1);
      cons.setMessageListener(new MessageListener()
      {
         public void onMessage(final Message m)
         {
            // close the connection on the same thread that processed the message
            try
View Full Code Here

         MessageConsumer cons = session.createConsumer(HornetQServerTestCase.queue1);

         final AtomicReference<Message> message = new AtomicReference<Message>();
         final CountDownLatch latch = new CountDownLatch(1);

         cons.setMessageListener(new MessageListener()
         {
            public void onMessage(final Message m)
            {
               message.set(m);
               latch.countDown();
View Full Code Here

            final CountDownLatch latch = new CountDownLatch(10);
            final List<String> result = new ArrayList<String>();

            // Set the async listener
            QueueReceiver recv = session.createReceiver(queue);
            recv.setMessageListener(new MessageListener() {

                @Override
                public void onMessage(Message message) {
                    TextMessage msg = (TextMessage)message;
                    try {
View Full Code Here

TOP

Related Classes of javax.jms.MessageListener

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.