Package javax.jms

Examples of javax.jms.TextMessage.acknowledge()


            // 3rd and 5th message still in queue, but when they are delivered
            // they will be expired and won't be received by this consumer.
            TextMessage rm1 = (TextMessage)cons.receive(1000);
            assertNotNull(rm1);
            assertEquals("Message:0", rm1.getText());
            rm1.acknowledge();

            TextMessage rm2 = (TextMessage)cons.receive(1000);
            assertNotNull(rm2);
            assertEquals("Message:1", rm2.getText());
            rm2.acknowledge();
View Full Code Here


            rm1.acknowledge();

            TextMessage rm2 = (TextMessage)cons.receive(1000);
            assertNotNull(rm2);
            assertEquals("Message:1", rm2.getText());
            rm2.acknowledge();

            TextMessage rm3 = (TextMessage)cons.receive(1000);
            assertNotNull(rm3);
            assertEquals("Message:3", rm3.getText());
            rm3.acknowledge();
View Full Code Here

            rm2.acknowledge();

            TextMessage rm3 = (TextMessage)cons.receive(1000);
            assertNotNull(rm3);
            assertEquals("Message:3", rm3.getText());
            rm3.acknowledge();

            TextMessage rm4 = (TextMessage)cons.receive(1000);
            assertNull(rm4);

            // Message should all be in the default expiry queue - let's check
View Full Code Here

                     //ok
                     synchronized(rcvBuffer1)
                     {
                        rcvBuffer1.add(rm);
                     }
                     rm.acknowledge();
                  }
               }
              
               rm = (TextMessage)cons.receive(10000);
            }
View Full Code Here

         // failover complete
         assertEquals(0, getServerId(conn));

         // acknowledge the messages
         clik.acknowledge();
         clak.acknowledge();

         // make sure no messages are left in the queue
         checkEmpty(queue[1], 0);
      }
      finally
View Full Code Here

        CountDownLatch pubishDoneToQeueuB = asyncSendTo(queueB, "Message 1");
        assertTrue(pubishDoneToQeueuB.await(2, TimeUnit.SECONDS));

        TextMessage msg = (TextMessage)consumer.receive();
        assertEquals("Message 1", msg.getText());
        msg.acknowledge();

        pubishDoneToQeueuB = asyncSendTo(queueB, "Message 2");
        assertTrue(pubishDoneToQeueuB.await(2, TimeUnit.SECONDS));

        msg = (TextMessage)consumer.receive();
View Full Code Here

        pubishDoneToQeueuB = asyncSendTo(queueB, "Message 2");
        assertTrue(pubishDoneToQeueuB.await(2, TimeUnit.SECONDS));

        msg = (TextMessage)consumer.receive();
        assertEquals("Message 2", msg.getText());
        msg.acknowledge();
    }

    public void test2ndPubisherWithSyncSendConnectionThatIsBlocked() throws Exception {
        ActiveMQConnectionFactory factory = (ActiveMQConnectionFactory)createConnectionFactory();
        factory.setAlwaysSyncSend(true);
View Full Code Here

        CountDownLatch pubishDoneToQeueuB = asyncSendTo(queueB, "Message 1");
        assertTrue(pubishDoneToQeueuB.await(2, TimeUnit.SECONDS));

        TextMessage msg = (TextMessage)consumer.receive();
        assertEquals("Message 1", msg.getText());
        msg.acknowledge();

        pubishDoneToQeueuB = asyncSendTo(queueB, "Message 2");
        assertTrue(pubishDoneToQeueuB.await(2, TimeUnit.SECONDS));

        msg = (TextMessage)consumer.receive();
View Full Code Here

        pubishDoneToQeueuB = asyncSendTo(queueB, "Message 2");
        assertTrue(pubishDoneToQeueuB.await(2, TimeUnit.SECONDS));

        msg = (TextMessage)consumer.receive();
        assertEquals("Message 2", msg.getText());
        msg.acknowledge();
    }

    public void testSimpleSendReceive() throws Exception {
        ActiveMQConnectionFactory factory = (ActiveMQConnectionFactory)createConnectionFactory();
        factory.setAlwaysSyncSend(true);
View Full Code Here

        CountDownLatch pubishDoneToQeueuA = asyncSendTo(queueA, "Message 1");
        assertTrue(pubishDoneToQeueuA.await(2, TimeUnit.SECONDS));

        TextMessage msg = (TextMessage)consumer.receive();
        assertEquals("Message 1", msg.getText());
        msg.acknowledge();

        pubishDoneToQeueuA = asyncSendTo(queueA, "Message 2");
        assertTrue(pubishDoneToQeueuA.await(2, TimeUnit.SECONDS));

        msg = (TextMessage)consumer.receive();
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.