Package org.hornetq.core.server

Examples of org.hornetq.core.server.ServerConsumer


         for (Consumer consumer : consumers)
         {

            if (consumer instanceof ServerConsumer)
            {
               ServerConsumer serverConsumer = (ServerConsumer)consumer;

               JSONObject obj = new JSONObject();
               obj.put("consumerID", serverConsumer.getID());
               obj.put("connectionID", serverConsumer.getConnectionID().toString());
               obj.put("sessionID", serverConsumer.getSessionID());
               obj.put("browseOnly", serverConsumer.isBrowseOnly());
               obj.put("creationTime", serverConsumer.getCreationTime());

               jsonArray.put(obj);
            }

         }
View Full Code Here


         for (Consumer consumer : consumers)
         {

            if (consumer instanceof ServerConsumer)
            {
               ServerConsumer serverConsumer = (ServerConsumer)consumer;

               JSONObject obj = new JSONObject();
               obj.put("consumerID", serverConsumer.getID());
               obj.put("connectionID", serverConsumer.getConnectionID().toString());
               obj.put("sessionID", serverConsumer.getSessionID());
               obj.put("browseOnly", serverConsumer.isBrowseOnly());
               obj.put("creationTime", serverConsumer.getCreationTime());

               jsonArray.put(obj);
            }

         }
View Full Code Here

      securityStore.check(binding.getAddress(), CheckType.CONSUME, this);

      Filter filter = FilterImpl.createFilter(filterString);

      ServerConsumer consumer = new ServerConsumerImpl(consumerID,
                                                       this,
                                                       (QueueBinding)binding,
                                                       filter,
                                                       started,
                                                       browseOnly,
                                                       storageManager,
                                                       callback,
                                                       preAcknowledge,
                                                       strictUpdateDeliveryCount,
                                                       managementService,
                                                       supportLargeMessage,
                                                       credits);
      consumers.put(consumer.getID(), consumer);

      if (!browseOnly)
      {
         TypedProperties props = new TypedProperties();
View Full Code Here

      return new BindingQueryResult(!names.isEmpty(), names);
   }

   public void forceConsumerDelivery(final long consumerID, final long sequence) throws Exception
   {
      ServerConsumer consumer = consumers.get(consumerID);

      // this would be possible if the server consumer was closed by pings/pongs.. etc
      if (consumer != null)
      {
         consumer.forceDelivery(sequence);
      }
   }
View Full Code Here

      }
   }

   public void acknowledge(final long consumerID, final long messageID) throws Exception
   {
      ServerConsumer consumer = consumers.get(consumerID);

      if (consumer == null)
      {
         throw HornetQMessageBundle.BUNDLE.consumerDoesntExist(consumerID);
      }

      if (tx != null && tx.getState() == State.ROLLEDBACK)
      {
         // JBPAPP-8845 - if we let stuff to be acked on a rolled back TX, we will just
         // have these messages to be stuck on the limbo until the server is restarted
         // The tx has already timed out, so we need to ack and rollback immediately
         Transaction newTX = newTransaction();
         consumer.acknowledge(autoCommitAcks, newTX, messageID);
         newTX.rollback();
      }
      else
      {
         consumer.acknowledge(autoCommitAcks, tx, messageID);
      }
   }
View Full Code Here

      }
   }

   public void individualAcknowledge(final long consumerID, final long messageID) throws Exception
   {
      ServerConsumer consumer = consumers.get(consumerID);

      if (this.xa && tx == null)
      {
         throw new HornetQXAException(XAException.XAER_PROTO, "Invalid transaction state");
      }

      if (tx != null && tx.getState() == State.ROLLEDBACK)
      {
          // JBPAPP-8845 - if we let stuff to be acked on a rolled back TX, we will just
          // have these messages to be stuck on the limbo until the server is restarted
          // The tx has already timed out, so we need to ack and rollback immediately
         Transaction newTX = newTransaction();
         consumer.individualAcknowledge(autoCommitAcks, tx, messageID);
         newTX.rollback();
      }
      else
      {
         consumer.individualAcknowledge(autoCommitAcks, tx, messageID);
      }

   }
View Full Code Here

   }

   public void individualCancel(final long consumerID, final long messageID, boolean failed) throws Exception
   {
      ServerConsumer consumer = consumers.get(consumerID);

      if(consumer != null)
      {
         consumer.individualCancel(messageID, failed);
      }

   }
View Full Code Here

      });
   }

   public void closeConsumer(final long consumerID) throws Exception
   {
      final ServerConsumer consumer = consumers.get(consumerID);

      if (consumer != null)
      {
         consumer.close(false);
      }
      else
      {
         HornetQServerLogger.LOGGER.cannotFindConsumer(consumerID);
      }
View Full Code Here

      }
   }

   public void receiveConsumerCredits(final long consumerID, final int credits) throws Exception
   {
      ServerConsumer consumer = consumers.get(consumerID);

      if (consumer == null)
      {
         HornetQServerLogger.LOGGER.debug("There is no consumer with id " + consumerID);

         return;
      }

      consumer.receiveCredits(credits);
   }
View Full Code Here

         for (Consumer consumer : consumers)
         {

            if (consumer instanceof ServerConsumer)
            {
               ServerConsumer serverConsumer = (ServerConsumer)consumer;

               JSONObject obj = new JSONObject();
               obj.put("consumerID", serverConsumer.getID());
               obj.put("connectionID", serverConsumer.getConnectionID().toString());
               obj.put("sessionID", serverConsumer.getSessionID());
               obj.put("browseOnly", serverConsumer.isBrowseOnly());
               obj.put("creationTime", serverConsumer.getCreationTime());

               jsonArray.put(obj);
            }

         }
View Full Code Here

TOP

Related Classes of org.hornetq.core.server.ServerConsumer

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.