Package org.hornetq.rest.queue

Examples of org.hornetq.rest.queue.QueueConsumer


   @Path("auto-ack/{subscription-id}")
   public QueueConsumer findAutoAckSubscription(
      @PathParam("subscription-id") String subscriptionId)
   {
      QueueConsumer consumer = queueConsumers.get(subscriptionId);
      if (consumer == null)
      {
         consumer = recreateTopicConsumer(subscriptionId, true);
      }
      return consumer;
View Full Code Here


   @Path("acknowledged/{subscription-id}")
   public QueueConsumer findAcknoledgeSubscription(
      @PathParam("subscription-id") String subscriptionId)
   {
      QueueConsumer consumer = queueConsumers.get(subscriptionId);
      if (consumer == null)
      {
         consumer = recreateTopicConsumer(subscriptionId, false);
      }
      return consumer;
View Full Code Here

      }
   }

   private QueueConsumer recreateTopicConsumer(String subscriptionId, boolean autoAck)
   {
      QueueConsumer consumer;
      if (subscriptionExists(subscriptionId))
      {
         QueueConsumer tmp = null;
         try
         {
            tmp = createConsumer(true, autoAck, subscriptionId, null, consumerTimeoutSeconds * 1000, false);
         }
         catch (HornetQException e)
         {
            throw new RuntimeException(e);
         }
         consumer = queueConsumers.putIfAbsent(subscriptionId, tmp);
         if (consumer == null)
         {
            consumer = tmp;
            serviceManager.getTimeoutTask().add(this, subscriptionId);
         }
         else
         {
            tmp.shutdown();
         }
      }
      else
      {
         throw new WebApplicationException(Response.status(405)
View Full Code Here

      internalDeleteSubscription(consumerId);
   }

   private void internalDeleteSubscription(String consumerId)
   {
      QueueConsumer consumer = queueConsumers.remove(consumerId);
      if (consumer == null)
      {
         String msg = "Failed to match a subscription to URL " + consumerId;
         throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND)
                                              .entity(msg)
                                              .type("text/plain").build());
      }
      consumer.shutdown();
      deleteSubscriberQueue(consumer);
   }
View Full Code Here

TOP

Related Classes of org.hornetq.rest.queue.QueueConsumer

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.