Package org.hornetq.api.core.client

Examples of org.hornetq.api.core.client.ClientSession.createConsumer()


         sf = locator.createSessionFactory();

         session = sf.createSession(null, null, false, false, false, false, 0);

         consumer = session.createConsumer(PagingTest.ADDRESS);

         session.start();
         for (int i = 347; i < numberOfMessages; i++)
         {
            System.out.println("Received " + i);
View Full Code Here


            message.getBodyBuffer().writeBytes(body);

            producer.send(message);
         }

         ClientConsumer consumer = session.createConsumer(PagingTest.ADDRESS);

         session.start();

         for (int i = 0; i < 6; i++)
         {
View Full Code Here

            producer.send(message);
         }

         session.commit();

         consumer = session.createConsumer(PagingTest.ADDRESS);

         session.start();

         for (int i = 0; i < 6; i++)
         {
View Full Code Here

                  e.printStackTrace();
               }
            }
         }

         ClientConsumer consumer = session.createConsumer(PagingTest.ADDRESS);

         session.start();

         consumer.setMessageHandler(new MyHandler());
View Full Code Here

         for (int msg = 0; msg < NUMBER_OF_MESSAGES; msg++)
         {

            for (int i = 0; i < NUMBER_OF_BINDINGS; i++)
            {
               ClientConsumer consumer = session.createConsumer(new SimpleString("someQueue" + i));

               ClientMessage message2 = consumer.receive(PagingTest.RECEIVE_TIMEOUT);

               Assert.assertNotNull(message2);
View Full Code Here

         session = sf.createSession(false, true, false);

         session.start();

         ClientConsumer consumerNonPaged = session.createConsumer(NON_PAGED_ADDRESS);
         ClientConsumer consumerPaged = session.createConsumer(PAGED_ADDRESS);

         ClientMessage ackList[] = new ClientMessage[NUMBER_OF_MESSAGES];

         for (int i = 0; i < NUMBER_OF_MESSAGES; i++)
View Full Code Here

         session = sf.createSession(false, true, false);

         session.start();

         ClientConsumer consumerNonPaged = session.createConsumer(NON_PAGED_ADDRESS);
         ClientConsumer consumerPaged = session.createConsumer(PAGED_ADDRESS);

         ClientMessage ackList[] = new ClientMessage[NUMBER_OF_MESSAGES];

         for (int i = 0; i < NUMBER_OF_MESSAGES; i++)
         {
View Full Code Here

            message.putIntProperty(new SimpleString("id"), i);

            // Consume messages to force an eventual out of order delivery
            if (i == 5)
            {
               ClientConsumer consumer = session.createConsumer(PagingTest.ADDRESS);
               for (int j = 0; j < numberOfMessages; j++)
               {
                  ClientMessage msg = consumer.receive(PagingTest.RECEIVE_TIMEOUT);
                  msg.acknowledge();
                  assertEquals(j, msg.getIntProperty("id").intValue());
View Full Code Here

            Assert.assertEquals(messageID.intValue(), i);

            producerTransacted.send(message);
         }

         ClientConsumer consumer = session.createConsumer(PagingTest.ADDRESS);

         Assert.assertNull(consumer.receiveImmediate());

         sessionTransacted.commit();
View Full Code Here

               assertTrue(server.getPostOffice().getPagingManager().getPageStore(PagingTest.ADDRESS).isPaging());
            }
            else
            {
               System.out.println("Consuming 20 msgs to make it page");
               ClientConsumer consumer = sessionNonTX.createConsumer(PagingTest.ADDRESS);
               for (int j = 0; j < 20; j++)
               {
                  ClientMessage msgReceived = consumer.receive(10000);
                  assertNotNull(msgReceived);
                  msgReceived.acknowledge();
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.