Package org.hornetq.api.core.client.ClientSession

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


               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

               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

      {
         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

         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

         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

         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

      else
      {
         topic = HornetQDestination.createTopic(topicName);
      }
     
      BindingQuery query = session.bindingQuery(topic.getSimpleAddress());

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

            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

               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

TOP

Related Classes of org.hornetq.api.core.client.ClientSession.BindingQuery

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.