Examples of BindingQuery


Examples of org.hornetq.api.core.client.ClientSession.BindingQuery

               session = (ClientSessionInternal)csf.createSession(user, password, false, true, true, true, 1);
            }

            if (forwardingAddress != null)
            {
               BindingQuery query = null;

               try
               {
                  query = session.bindingQuery(forwardingAddress);
               }
               catch (Throwable e)
               {
                  HornetQServerLogger.LOGGER.errorQueryingBridge(e, name);
                  // This was an issue during startup, we will not count this retry
                  retryCount--;

                  scheduleRetryConnectFixedTimeout(100);
                  return;
               }

               if (forwardingAddress.startsWith(BridgeImpl.JMS_QUEUE_ADDRESS_PREFIX) || forwardingAddress.startsWith(BridgeImpl.JMS_TOPIC_ADDRESS_PREFIX))
               {
                  if (!query.isExists())
                  {
                     HornetQServerLogger.LOGGER.errorQueryingBridge(forwardingAddress, retryCount);
                     scheduleRetryConnect();
                     return;
                  }
               }
               else
               {
                  if (!query.isExists())
                  {
                     HornetQServerLogger.LOGGER.bridgeNoBindings(getName(), getForwardingAddress(), getForwardingAddress());
                  }
               }
            }
View Full Code Here

Examples of org.hornetq.api.core.client.ClientSession.BindingQuery

         clientSession.createQueue("a1", "q1", false);
         clientSession.createQueue("a1", "q2", false);
         clientSession.createQueue("a2", "q3", false);
         clientSession.createQueue("a2", "q4", false);
         clientSession.createQueue("a2", "q5", false);
         BindingQuery resp = clientSession.bindingQuery(new SimpleString("a"));
         List<SimpleString> queues = resp.getQueueNames();
         Assert.assertTrue(queues.isEmpty());
         resp = clientSession.bindingQuery(new SimpleString("a1"));
         queues = resp.getQueueNames();
         Assert.assertEquals(queues.size(), 2);
         Assert.assertTrue(queues.contains(new SimpleString("q1")));
         Assert.assertTrue(queues.contains(new SimpleString("q2")));
         resp = clientSession.bindingQuery(new SimpleString("a2"));
         queues = resp.getQueueNames();
         Assert.assertEquals(queues.size(), 3);
         Assert.assertTrue(queues.contains(new SimpleString("q3")));
         Assert.assertTrue(queues.contains(new SimpleString("q4")));
         Assert.assertTrue(queues.contains(new SimpleString("q5")));
         clientSession.close();
View Full Code Here

Examples of org.hornetq.api.core.client.ClientSession.BindingQuery

      {
         HornetQDestination jbd = (HornetQDestination)destination;

         if (jbd != null)
         {
            BindingQuery response = session.bindingQuery(jbd.getSimpleAddress());

            if (!response.isExists())
            {
               throw new InvalidDestinationException("Destination " + jbd.getName() + " does not exist");
            }
         }
View Full Code Here

Examples of org.hornetq.api.core.client.ClientSession.BindingQuery

         SimpleString autoDeleteQueueName = null;

         if (dest.isQueue())
         {
            BindingQuery response = session.bindingQuery(dest.getSimpleAddress());

            if (!response.isExists())
            {
               throw new InvalidDestinationException("Queue " + dest.getName() + " does not exist");
            }

            consumer = session.createConsumer(dest.getSimpleAddress(), coreFilterString, false);
         }
         else
         {
            BindingQuery response = session.bindingQuery(dest.getSimpleAddress());

            if (!response.isExists())
            {
               throw new InvalidDestinationException("Topic " + dest.getName() + " does not exist");
            }

            SimpleString queueName;
View Full Code Here

Examples of org.hornetq.api.core.client.ClientSession.BindingQuery

         throw new InvalidDestinationException("Cannot create a browser on a topic");
      }

      try
      {
         BindingQuery message = session.bindingQuery(new SimpleString(jbq.getAddress()));
         if (!message.isExists())
         {
            throw new InvalidDestinationException(jbq.getAddress() + " does not exist");
         }
      }
      catch (HornetQException e)
View Full Code Here

Examples of org.hornetq.api.core.client.ClientSession.BindingQuery

         throw new InvalidDestinationException("Not a temporary topic " + tempTopic);
      }

      try
      {
         BindingQuery response = session.bindingQuery(tempTopic.getSimpleAddress());

         if (!response.isExists())
         {
            throw new InvalidDestinationException("Cannot delete temporary topic " + tempTopic.getName() +
                                                  " does not exist");
         }

         if (response.getQueueNames().size() > 1)
         {
            throw new IllegalStateException("Cannot delete temporary topic " + tempTopic.getName() +
                                            " since it has subscribers");
         }
View Full Code Here

Examples of org.hornetq.api.core.client.ClientSession.BindingQuery

      else
      {
         topic = HornetQDestination.createTopic(topicName);
      }

      BindingQuery query = session.bindingQuery(topic.getSimpleAddress());

      if (!query.isExists())
      {
         return null;
      }
      else
      {
View Full Code Here

Examples of org.hornetq.api.core.client.ClientSession.BindingQuery

            session = (ClientSessionInternal)csf.createSession(user, password, false, true, true, true, 1);
         }

         if (forwardingAddress != null)
         {
            BindingQuery query = null;

            try
            {
               query = session.bindingQuery(forwardingAddress);
            }
            catch (Throwable e)
            {
               HornetQServerLogger.LOGGER.errorQueryingBridge(e, name);
               // This was an issue during startup, we will not count this retry
               retryCount--;

               scheduleRetryConnectFixedTimeout(100);
               return;
            }

            if (forwardingAddress.startsWith(BridgeImpl.JMS_QUEUE_ADDRESS_PREFIX) || forwardingAddress.startsWith(BridgeImpl.JMS_TOPIC_ADDRESS_PREFIX))
            {
               if (!query.isExists())
               {
                  HornetQServerLogger.LOGGER.errorQueryingBridge(forwardingAddress, retryCount);
                  scheduleRetryConnect();
                  return;
               }
            }
            else
            {
               if (!query.isExists())
               {
                  HornetQServerLogger.LOGGER.bridgeNoBindings(getName(), getForwardingAddress(), getForwardingAddress());
               }
            }
         }
View Full Code Here

Examples of org.hornetq.api.core.client.ClientSession.BindingQuery

            // Session is pre-acknowledge
            session = (ClientSessionInternal)csf.createSession(user, password, false, true, true, true, 1);

            if (forwardingAddress != null)
            {
               BindingQuery query = null;
              
               try
               {
                  query = session.bindingQuery(forwardingAddress);
               }
               catch (Throwable e)
               {
                  log.warn("Error on querying binding. Retrying", e);
                  retry = true;
                  Thread.sleep(100);
                  continue;
               }
  
               if (forwardingAddress.startsWith(BridgeImpl.JMS_QUEUE_ADDRESS_PREFIX) || forwardingAddress.startsWith(BridgeImpl.JMS_TOPIC_ADDRESS_PREFIX))
               {
                  if (!query.isExists())
                  {
                     retryCount ++;
                     if (serverLocator.getReconnectAttempts() > 0)
                     {
                        if (retryCount > serverLocator.getReconnectAttempts())
                        {
                           log.warn("Retried " + forwardingAddress + " up to the configured reconnectAttempts(" + serverLocator.getReconnectAttempts() + "). Giving up now. The bridge " + this.getName() + " will not be activated");
                           return false;
                        }
                     }
  
                     log.warn("Address " + forwardingAddress + " doesn't have any bindings yet, retry #(" + retryCount + ")");
                     Thread.sleep(serverLocator.getRetryInterval());
                     retry = true;
                     csf.close();
                     session.close();
                     continue;
                  }
               }
               else
               {
                  if (!query.isExists())
                  {
                     log.info("Bridge " + this.getName() + " connected to fowardingAddress=" + this.getForwardingAddress() + ". " + getForwardingAddress() + " doesn't have any bindings what means messages will be ignored until a binding is created.");
                  }
               }
            }
View Full Code Here

Examples of org.hornetq.api.core.client.ClientSession.BindingQuery

    @Test
    public void createQueue() throws HornetQException {
        final ClientSession clientSession = hornetQMixIn.getClientSession();
        final SimpleString queueName = new SimpleString("testQueue");
        clientSession.createQueue(queueName, queueName);
        final BindingQuery bindingQuery = clientSession.bindingQuery(queueName);
        Assert.assertTrue(bindingQuery.isExists());
        Assert.assertEquals(1, bindingQuery.getQueueNames().size());
        final SimpleString actualQueueName = bindingQuery.getQueueNames().get(0);
        Assert.assertEquals(queueName, actualQueueName);
    }
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.