Examples of queueQuery()


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

      {
         String queueName = name;
         ClientSession session = manager.getSessionFactory().createSession(false, false, false);
         try
         {
            ClientSession.QueueQuery query = session.queueQuery(new SimpleString(queueName));
            if (!query.isExists())
            {
               throw new WebApplicationException(Response.status(404).type("text/plain").entity("Queue '" + name + "' does not exist").build());
            }
            DestinationSettings queueSettings = manager.getDefaultSettings();
View Full Code Here

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

    }

    static boolean queueExists(final String queueName, final ClientSessionFactory sf) throws HornetQException {
        final ClientSession session = sf.createSession(false, false, false);
        try {
            final QueueQuery query = session.queueQuery(new SimpleString(queueName));
            return query.isExists();
        } finally {
            session.close();
        }
    }
View Full Code Here

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

      assertEquals(1,activations.size());

      HornetQActivation activation = activations.values().iterator().next();
      SimpleString tempQueueName = activation.getTopicTemporaryQueue();

      QueueQuery query = session.queueQuery(tempQueueName);
      assertTrue(query.isExists());

      //this should be enough to simulate the crash
      qResourceAdapter.getDefaultHornetQConnectionFactory().close();
      qResourceAdapter.stop();
View Full Code Here

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

      //this should be enough to simulate the crash
      qResourceAdapter.getDefaultHornetQConnectionFactory().close();
      qResourceAdapter.stop();

      query = session.queueQuery(tempQueueName);

      assertFalse(query.isExists());
   }

   public void testSelectorChangedWithTopic() throws Exception
View Full Code Here

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

            ClientSession session = factory.createSession(true, true);
            session.start();

            for (int i = 0; i < queues.length; i++) {
                long msgCount =
                    session.queueQuery(new SimpleString(queues[i])).getMessageCount();
                if (msgCount == 0) {
                    log.debug(String.format("found queue '%s' with 0 messages. deleting",
                        queues[i]));
                    session.deleteQueue(queues[i]);
                }
View Full Code Here

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

   public void addRegistration(PushTopicRegistration reg) throws Exception
   {
      if (reg.isEnabled() == false) return;
      String destination = reg.getDestination();
      ClientSession session = sessionFactory.createSession(false, false, false);
      ClientSession.QueueQuery query = session.queueQuery(new SimpleString(destination));
      ClientSession createSession = null;
      if (!query.isExists())
      {
         createSession = createSubscription(destination, reg.isDurable());
      }
View Full Code Here

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

      ClientSession session = null;
      try
      {
         session = sessionFactory.createSession();

         ClientSession.QueueQuery query = session.queueQuery(new SimpleString(subscriptionId));
         return query.isExists();
      }
      catch (HornetQException e)
      {
         throw new RuntimeException(e);
View Full Code Here

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

         String queueName = hqQueue.getAddress();
         ClientSession session = manager.getSessionFactory().createSession(false, false, false);
         try
         {

            ClientSession.QueueQuery query = session.queueQuery(new SimpleString(queueName));
            if (!query.isExists())
            {
               if (queue.getSelector() != null)
               {
                  session.createQueue(queueName, queueName, queue.getSelector(), queue.isDurable());
View Full Code Here

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

      ClientSession session = manager.getSessionFactory().createSession(false, false, false);
      try
      {

         SimpleString queueName = new SimpleString(name);
         ClientSession.QueueQuery query = session.queueQuery(queueName);
         if (query.isExists())
         {
            session.deleteQueue(queueName);
         }
         else
View Full Code Here

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

      {
         String queueName = name;
         ClientSession session = manager.getSessionFactory().createSession(false, false, false);
         try
         {
            ClientSession.QueueQuery query = session.queueQuery(new SimpleString(queueName));
            if (!query.isExists())
            {
               throw new WebApplicationException(Response.status(404).type("text/plain").entity("Queue '" + name + "' does not exist").build());
            }
            DestinationSettings queueSettings = manager.getDefaultSettings();
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.