Package org.hornetq.api.core

Examples of org.hornetq.api.core.SimpleString


      session.deleteQueue(queue);
   }

   public void testListMessageCounterAsHTML() throws Exception
   {
      SimpleString address = RandomUtil.randomSimpleString();
      SimpleString queue = RandomUtil.randomSimpleString();

      session.createQueue(address, queue, null, false);
      QueueControl queueControl = createManagementControl(address, queue);

      String history = queueControl.listMessageCounterAsHTML();
View Full Code Here


   }

   public void testListMessageCounterHistory() throws Exception
   {
      long counterPeriod = 1000;
      SimpleString address = RandomUtil.randomSimpleString();
      SimpleString queue = RandomUtil.randomSimpleString();

      session.createQueue(address, queue, null, false);
      QueueControl queueControl = createManagementControl(address, queue);

      HornetQServerControl serverControl = ManagementControlHelper.createHornetQServerControl(mbeanServer);
View Full Code Here

   }

   public void testListMessageCounterHistoryAsHTML() throws Exception
   {
      long counterPeriod = 1000;
      SimpleString address = RandomUtil.randomSimpleString();
      SimpleString queue = RandomUtil.randomSimpleString();

      session.createQueue(address, queue, null, false);
      QueueControl queueControl = createManagementControl(address, queue);

      HornetQServerControl serverControl = ManagementControlHelper.createHornetQServerControl(mbeanServer);
View Full Code Here

   }

   public void testMoveMessagesBack() throws Exception
   {
      server.createQueue(new SimpleString("q1"), new SimpleString("q1"), null, true, false);
      server.createQueue(new SimpleString("q2"), new SimpleString("q2"), null, true, false);

      ServerLocator locator = createInVMNonHALocator();

      ClientSessionFactory sf = locator.createSessionFactory();

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

      ClientProducer prod1 = session.createProducer("q1");

      for (int i = 0; i < 10; i++)
      {
         ClientMessage msg = session.createMessage(true);

         msg.putStringProperty(org.hornetq.api.core.Message.HDR_DUPLICATE_DETECTION_ID, new SimpleString("dupl-" + i));

         prod1.send(msg);
      }

      session.commit();

      ClientConsumer consumer = session.createConsumer("q1", true);
      session.start();

      assertNotNull(consumer.receive(5000));
      consumer.close();

      QueueControl q1Control = ManagementControlHelper.createQueueControl(new SimpleString("q1"),
                                                                          new SimpleString("q1"),
                                                                          mbeanServer);

      QueueControl q2Control = ManagementControlHelper.createQueueControl(new SimpleString("q2"),
                                                                          new SimpleString("q2"),
                                                                          mbeanServer);

      assertEquals(10, q1Control.moveMessages(null, "q2"));

      consumer = session.createConsumer("q2", true);
View Full Code Here

   }

   public void testMoveMessagesBack2() throws Exception
   {
      server.createQueue(new SimpleString("q1"), new SimpleString("q1"), null, true, false);
      server.createQueue(new SimpleString("q2"), new SimpleString("q2"), null, true, false);

      ServerLocator locator = createInVMNonHALocator();

      ClientSessionFactory sf = locator.createSessionFactory();

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

      ClientProducer prod1 = session.createProducer("q1");

      int NUMBER_OF_MSGS = 10;

      for (int i = 0; i < NUMBER_OF_MSGS; i++)
      {
         ClientMessage msg = session.createMessage(true);

         msg.putStringProperty(org.hornetq.api.core.Message.HDR_DUPLICATE_DETECTION_ID, new SimpleString("dupl-" + i));

         prod1.send(msg);
      }

      session.commit();

      ClientConsumer consumer = session.createConsumer("q1", true);
      session.start();

      assertNotNull(consumer.receive(5000));
      consumer.close();

      QueueControl q1Control = ManagementControlHelper.createQueueControl(new SimpleString("q1"),
                                                                          new SimpleString("q1"),
                                                                          mbeanServer);

      QueueControl q2Control = ManagementControlHelper.createQueueControl(new SimpleString("q2"),
                                                                          new SimpleString("q2"),
                                                                          mbeanServer);

      assertEquals(NUMBER_OF_MSGS, q1Control.moveMessages(null, "q2"));

      long messageIDs[] = new long[NUMBER_OF_MSGS];
View Full Code Here

   }

   public void testPauseAndResume()
   {
      long counterPeriod = 1000;
      SimpleString address = RandomUtil.randomSimpleString();
      SimpleString queue = RandomUtil.randomSimpleString();

      try
      {
         session.createQueue(address, queue, null, false);
         QueueControl queueControl = createManagementControl(address, queue);
View Full Code Here

      if (notificationService != null)
      {
         TypedProperties props = new TypedProperties();

         props.putSimpleStringProperty(new SimpleString("name"), new SimpleString(name));

         Notification notification = new Notification(nodeID, NotificationType.DISCOVERY_GROUP_STARTED, props);

         notificationService.sendNotification(notification);
      }
View Full Code Here

      thread = null;

      if (notificationService != null)
      {
         TypedProperties props = new TypedProperties();
         props.putSimpleStringProperty(new SimpleString("name"), new SimpleString(name));
         Notification notification = new Notification(nodeID, NotificationType.DISCOVERY_GROUP_STOPPED, props);
         try
         {
            notificationService.sendNotification(notification);
         }
View Full Code Here

      buffer.writeNullableSimpleString(SimpleString.toSimpleString(str));
   }

   public static String readNullableSimpleStringAsString(HornetQBuffer buffer)
   {
      SimpleString str = buffer.readNullableSimpleString();
      return str != null ? str.toString() : null;
   }
View Full Code Here

      return str != null ? str.toString() : null;
   }

   public static void writeAsSimpleString(HornetQBuffer buffer, String str)
   {
      buffer.writeSimpleString(new SimpleString(str));
   }
View Full Code Here

TOP

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

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.