Package org.hornetq.core.postoffice

Examples of org.hornetq.core.postoffice.Bindings


      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);
      }
      else
      {
       // this is a debug and not warn because this could be a regular scenario on publish-subscribe queues (or topic subscriptions on JMS)
       if (log.isDebugEnabled())
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

      HornetQServer server = HornetQServers.newHornetQServer(conf, false);

      server.start();

      Bindings bindings = server.getPostOffice().getBindingsForAddress(new SimpleString(testAddress));

      Assert.assertEquals(2, bindings.getBindings().size());

      ClientSessionFactory sf = HornetQClient.createClientSessionFactory(new TransportConfiguration("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory"));

      ClientSession session = sf.createSession(false, true, true);
View Full Code Here

   protected List<QueueBinding> getLocalQueueBindings(final PostOffice postOffice, final String address) throws Exception
   {
      ArrayList<QueueBinding> bindingsFound = new ArrayList<QueueBinding>();

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

      for (Binding binding : bindings.getBindings())
      {
         if (binding instanceof LocalQueueBinding)
         {
            bindingsFound.add((QueueBinding)binding);
         }
View Full Code Here

            // We can only guarantee round robing with WindowSize = -1, after the ServerConsumer object received
            // SessionConsumerFlowCreditMessage(-1)
            // Since that is done asynchronously we verify that the information was received before we proceed on
            // sending messages or else the distribution won't be
            // even as expected by the test
            Bindings bindings = server.getPostOffice().getBindingsForAddress(ADDRESS);

            Assert.assertEquals(1, bindings.getBindings().size());

            for (Binding binding : bindings.getBindings())
            {
               Collection<Consumer> consumers = ((QueueBinding)binding).getQueue().getConsumers();

               for (Consumer consumer : consumers)
               {
View Full Code Here

      {
         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 == count && totConsumers == consumerCount)
         {
            return;
         }

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

      // System.out.println(threadDump(" - fired by ClusterTestBase::waitForBindings"));

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

      ClusterTestBase.log.error(msg);

      // Sending thread dump into junit report.. trying to get some information about the server case the binding didn't
      // arrive
      System.out.println(UnitTestCase.threadDump(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 (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

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

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

         if (bindingList.getBindings().isEmpty())
         {
            HornetQServerLogger.LOGGER.errorExpiringReferencesNoBindings(expiryAddress);
         }
         else
         {
View Full Code Here

   private void sendToDeadLetterAddress(final MessageReference ref, final  SimpleString deadLetterAddress) throws Exception
   {
      if (deadLetterAddress != null)
      {
         Bindings bindingList = postOffice.getBindingsForAddress(deadLetterAddress);

         if (bindingList.getBindings().isEmpty())
         {
            HornetQServerLogger.LOGGER.messageExceededMaxDelivery(ref, deadLetterAddress);
            acknowledge(ref);
         }
         else
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.