Package org.hornetq.core.postoffice

Examples of org.hornetq.core.postoffice.Bindings


      {
         bindingCount = 0;

         totConsumers = 0;

         Bindings bindings = po.getBindingsForAddress(new SimpleString(address));

         for (Binding binding : bindings.getBindings())
         {
            if (binding instanceof LocalQueueBinding && local || binding instanceof RemoteQueueBinding && !local)
            {
               QueueBinding qBinding = (QueueBinding)binding;

               bindingCount++;

               totConsumers += qBinding.consumerCount();
            }
         }

         if (bindingCount == expectedBindingCount && totConsumers == expectedConsumerCount)
         {
            return;
         }

         Thread.sleep(10);
      }
      while (System.currentTimeMillis() - start < ClusterTestBase.WAIT_TIMEOUT);

      String msg = "Timed out waiting for bindings (bindingCount = " + bindingCount +
                   " (expecting " +
                   expectedBindingCount +
                   ") " +
                   ", totConsumers = " +
                   totConsumers +
                   " (expecting " +
                   expectedConsumerCount +
                   ")" +
                   ")";

      log.error(msg);

      Bindings bindings = po.getBindingsForAddress(new SimpleString(address));

      System.out.println("=======================================================================");
      System.out.println("Binding information for address = " + address + " on node " + node);

      for (Binding binding : bindings.getBindings())
      {
         if (binding instanceof LocalQueueBinding && local || binding instanceof RemoteQueueBinding && !local)
         {
            QueueBinding qBinding = (QueueBinding)binding;
View Full Code Here


      if (po == null)
      {
         return "server is shutdown";
      }
      Bindings bindings = po.getBindingsForAddress(new SimpleString(address));

      out.println("=======================================================================");
      out.println("Binding information for address = " + address + " on " + server);

      for (Binding binding : bindings.getBindings())
      {
         QueueBinding qBinding = (QueueBinding)binding;

         out.println("Binding = " + qBinding + ", queue=" + qBinding.getQueue());
      }
View Full Code Here

         server.stop();

         server.start();

         Bindings bindings = server.getPostOffice().getBindingsForAddress(ADDRESS);

         q1 = null;
         q2 = null;

         for (Binding bind : bindings.getBindings())
         {
            if (bind instanceof LocalQueueBinding)
            {
               LocalQueueBinding qb = (LocalQueueBinding)bind;
               if (qb.getQueue().getName().equals(ADDRESS))
View Full Code Here

   {
      SimpleString expiryAddress = addressSettingsRepository.getMatch(address.toString()).getExpiryAddress();

      if (expiryAddress != null)
      {
         Bindings bindingList = postOffice.getBindingsForAddress(expiryAddress);

         if (bindingList.getBindings().isEmpty())
         {
            QueueImpl.log.warn("Message has expired. No bindings for Expiry Address " + expiryAddress +
                               " so dropping it");
         }
         else
View Full Code Here

   {
      SimpleString deadLetterAddress = addressSettingsRepository.getMatch(address.toString()).getDeadLetterAddress();

      if (deadLetterAddress != null)
      {
         Bindings bindingList = postOffice.getBindingsForAddress(deadLetterAddress);

         if (bindingList.getBindings().isEmpty())
         {
            QueueImpl.log.warn("Message has exceeded max delivery attempts. No bindings for Dead Letter Address " + deadLetterAddress +
                               " so dropping it");
         }
         else
View Full Code Here

      if (address.equals(managementAddress))
      {
         return new BindingQueryResult(true, names);
      }

      Bindings bindings = postOffice.getMatchingBindings(address);

      for (Binding binding : bindings.getBindings())
      {
         if (binding.getType() == BindingType.LOCAL_QUEUE || binding.getType() == BindingType.REMOTE_QUEUE)
         {
            names.add(binding.getUniqueName());
         }
View Full Code Here

      return binding;
   }

   public Bindings getBindingsForAddress(final SimpleString address) throws Exception
   {
      Bindings bindings = addressManager.getBindingsForRoutingAddress(address);

      if (bindings == null)
      {
         bindings = createBindings(address);
      }
View Full Code Here

         // but we don't do it every time, otherwise it wouldn't be optimal
         cleanupInternalPropertiesBeforeRouting(message);
      }


      Bindings bindings = addressManager.getBindingsForRoutingAddress(address);

      if (bindings != null)
      {
         bindings.route(message, context);
      }

      if (context.getQueueCount() == 0)
      {
         // Send to DLA if appropriate
View Full Code Here

      // We have to copy the message and store it separately, otherwise we may lose remote bindings in case of restart before the message
      // arrived the target node
      // as described on https://issues.jboss.org/browse/JBPAPP-6130
      ServerMessage copyRedistribute = message.copy(storageManager.generateUniqueID());
     
      Bindings bindings = addressManager.getBindingsForRoutingAddress(message.getAddress());

      boolean res = false;

      if (bindings != null)
      {
         RoutingContext context = new RoutingContextImpl(tx);

         boolean routed = bindings.redistribute(copyRedistribute, originatingQueue, context);

         if (routed)
         {
            processRoute(copyRedistribute, context, false);
View Full Code Here

      if (address.equals(managementAddress))
      {
         return new BindingQueryResult(true, names);
      }

      Bindings bindings = postOffice.getMatchingBindings(address);

      for (Binding binding : bindings.getBindings())
      {
         if (binding.getType() == BindingType.LOCAL_QUEUE || binding.getType() == BindingType.REMOTE_QUEUE)
         {
            names.add(binding.getUniqueName());
         }
View Full Code Here

TOP

Related Classes of org.hornetq.core.postoffice.Bindings

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.