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)
            {
               log.warn("Error on querying binding on bridge " + this.name + ". Retrying in 100 milliseconds", e);
               // 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())
               {
                  log.warn("Address " + forwardingAddress +
                           " doesn't have any bindings yet, retry #(" +
                           retryCount +
                           ")");
                  scheduleRetryConnect();
                  return;
               }
            }
            else
            {
               if (!query.isExists())
               {
                  log.info("Bridge " + this.getName() +
                           " connected to fowardingAddress=" +
                           this.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

            // 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

            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 on bridge " + this.name + ". Retrying in 100 milliseconds", e);
               // 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())
               {
                  log.warn("Address " + forwardingAddress +
                           " doesn't have any bindings yet, retry #(" +
                           retryCount +
                           ")");
                  scheduleRetryConnect();
                  return;
               }
            }
            else
            {
               if (!query.isExists())
               {
                  log.info("Bridge " + this.getName() +
                           " connected to fowardingAddress=" +
                           this.getForwardingAddress() +
                           ". " +
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

      {
         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");
            }

            connection.addKnownDestination(jbd.getSimpleAddress());
View Full Code Here

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

         ClientConsumer consumer;

         SimpleString autoDeleteQueueName = null;

         BindingQuery response = session.bindingQuery(dest.getSimpleAddress());

         if (!response.isExists())
         {
            throw HornetQJMSClientBundle.BUNDLE.destinationDoesNotExist(dest.getSimpleAddress());
         }

         SimpleString queueName;
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");
            }

            connection.addKnownDestination(dest.getSimpleAddress());

            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");
            }

            connection.addKnownDestination(dest.getSimpleAddress());
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
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.