Package org.hornetq.api.core

Examples of org.hornetq.api.core.Message


      {
         System.out.println("Iteration " + i);
         // Sending non transactionally, so it would test non transactional stuff on the journal
         for (int j = 0; j < 1000; j++)
         {
            Message msg = session.createMessage(true);
            msg.getBodyBuffer().writeBytes(new byte[1024]);

            prod.send(msg);
         }

         // I need to guarantee a roundtrip to the server, to make sure everything is persisted
         session.commit();

         for (int j = 0; j < 1000; j++)
         {
            ClientMessage msg = cons.receive(2000);
            Assert.assertNotNull(msg);
            msg.acknowledge();
         }

         // I need to guarantee a roundtrip to the server, to make sure everything is persisted
         session.commit();

      }

      Assert.assertNull(cons.receiveImmediate());

      session.close();

      server.stop();
     
      setupServer(journalType);

      server.start();

      session = sf.createSession(false, true, true);
      cons = session.createConsumer(CompactingStressTest.Q1);
      session.start();

      for (int i = 0; i < 500; i++)
      {
         ClientMessage msg = cons.receive(1000);
         Assert.assertNotNull(msg);
         msg.acknowledge();
      }

      Assert.assertNull(cons.receiveImmediate());

      prod = session.createProducer(CompactingStressTest.AD2);
View Full Code Here


      producer.send(message);

      ClientConsumer consumer = session.createConsumer(CoreClientOverSSLTest.QUEUE);
      session.start();

      Message m = consumer.receive(1000);
      Assert.assertNotNull(m);
      Assert.assertEquals(text, m.getBodyBuffer().readString());
      locator.close();
   }
View Full Code Here

   {
      String resource = RandomUtil.randomString();
      String operationName = RandomUtil.randomString();
      String param = RandomUtil.randomString();
      String[] params = new String[] { RandomUtil.randomString(), RandomUtil.randomString(), RandomUtil.randomString() };
      Message msg = new ClientMessageImpl((byte)0, false, 0, 0, (byte)4, 1000);
      ManagementHelper.putOperationInvocation(msg, resource, operationName, param, params);

      Object[] parameters = ManagementHelper.retrieveOperationParameters(msg);
      Assert.assertEquals(2, parameters.length);
      Assert.assertEquals(param, parameters[0]);
View Full Code Here

      String[] strArray = new String[] { strElem0, strElem1, strElem2 };

      Object[] params = new Object[] { i, s, d, b, l, map, strArray, maps };

      Message msg = new ClientMessageImpl((byte)0, false, 0, 0, (byte)4, 1000);
      ManagementHelper.putOperationInvocation(msg, resource, operationName, params);

      Object[] parameters = ManagementHelper.retrieveOperationParameters(msg);

      Assert.assertEquals(params.length, parameters.length);
View Full Code Here

      map.put(key1, val1);
      map.put(key2, val2);

      Object[] params = new Object[] { "hello", map };

      Message msg = new ClientMessageImpl((byte)0, false, 0, 0, (byte)4, 1000);
      ManagementHelper.putOperationInvocation(msg, resource, operationName, params);

      Object[] parameters = ManagementHelper.retrieveOperationParameters(msg);

      Assert.assertEquals(params.length, parameters.length);
View Full Code Here

         List<MessageReference> refs = queue.getScheduledMessages();
         Map<String, Object>[] messages = new Map[refs.size()];
         int i = 0;
         for (MessageReference ref : refs)
         {
            Message message = ref.getMessage();
            messages[i++] = message.toMap();
         }
         return messages;
      }
      finally
      {
View Full Code Here

            while (iterator.hasNext())
            {
               MessageReference ref = (MessageReference)iterator.next();
               if (filter == null || filter.match(ref.getMessage()))
               {
                  Message message = ref.getMessage();
                  messages.add(message.toMap());
               }
            }
            return (Map<String, Object>[])messages.toArray(new Map[messages.size()]);
         }
         finally
View Full Code Here

         session.createQueue(LargeMessageTest.ADDRESS, LargeMessageTest.ADDRESS, true);

         ClientProducer producer = session.createProducer(LargeMessageTest.ADDRESS);

         Message clientFile = createLargeClientMessage(session, messageSize, true);

         clientFile.setExpiration(System.currentTimeMillis());

         producer.send(clientFile);

         Thread.sleep(500);
View Full Code Here

         ClientProducer producer = session.createProducer(LargeMessageTest.ADDRESS);

         for (int i = 0; i < 20; i++)
         {
            Message clientFile = createLargeClientMessage(session, messageSize, true);

            clientFile.putIntProperty("value", i);

            producer.send(clientFile);
         }

         session.commit();
View Full Code Here

         session.createTemporaryQueue(LargeMessageTest.ADDRESS, LargeMessageTest.ADDRESS);

         ClientProducer producer = session.createProducer(LargeMessageTest.ADDRESS);

         Message clientFile = createLargeClientMessage(session, messageSize, true);

         producer.send(clientFile);

         session.commit();
View Full Code Here

TOP

Related Classes of org.hornetq.api.core.Message

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.