Examples of queueQuery()


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()

      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()

      {
         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()

      {
         throw new Exception("You must start() this class instance before deploying");
      }
      String queueName = queueDeployment.getName();
      ClientSession session = sessionFactory.createSession(false, false, false);
      ClientSession.QueueQuery query = session.queueQuery(new SimpleString(queueName));
      if (!query.isExists())
      {
         session.createQueue(queueName, queueName, queueDeployment.isDurableSend());
      }
      session.close();
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("guest", "guest", false, false, false, false, 1);
        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()

         clientSession.createConsumer(queueName);
         clientSession.createConsumer(queueName);
         ClientProducer cp = clientSession.createProducer("a1");
         cp.send(clientSession.createMessage(false));
         cp.send(clientSession.createMessage(false));
         QueueQuery resp = clientSession.queueQuery(new SimpleString(queueName));
         Assert.assertEquals(new SimpleString("a1"), resp.getAddress());
         Assert.assertEquals(2, resp.getConsumerCount());
         Assert.assertEquals(2, resp.getMessageCount());
         Assert.assertEquals(null, resp.getFilterString());
         clientSession.close();
View Full Code Here

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

         ClientSessionFactory cf = createInVMFactory();
         ClientSession clientSession = cf.createSession(false, true, true);
         clientSession.createQueue("a1", queueName, "foo=bar", false);
         clientSession.createConsumer(queueName);
         clientSession.createConsumer(queueName);
         QueueQuery resp = clientSession.queueQuery(new SimpleString(queueName));
         Assert.assertEquals(new SimpleString("a1"), resp.getAddress());
         Assert.assertEquals(2, resp.getConsumerCount());
         Assert.assertEquals(0, resp.getMessageCount());
         Assert.assertEquals(new SimpleString("foo=bar"), resp.getFilterString());
         clientSession.close();
View Full Code Here

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

      try
      {
         server.start();
         ClientSessionFactory cf = createInVMFactory();
         ClientSession clientSession = cf.createSession(false, true, true);
         QueueQuery resp = clientSession.queueQuery(new SimpleString(queueName));
         Assert.assertFalse(resp.isExists());
         Assert.assertEquals(null, resp.getAddress());
         clientSession.close();
      }
      finally
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.