Package org.hornetq.rest.queue.push

Examples of org.hornetq.rest.queue.push.PushConsumer


      ClientSession createSession = null;
      if (!query.isExists())
      {
         createSession = createSubscription(destination, reg.isDurable());
      }
      PushConsumer consumer = new PushConsumer(sessionFactory, reg.getDestination(), reg.getId(), reg);
      try
      {
         consumer.start();
      }
      catch (Exception e)
      {
         consumer.stop();
         throw new Exception("Failed starting push subscriber for " + destination + " of push subscriber: " + reg.getTarget(), e);
      }
      finally
      {
         closeSession(createSession);
View Full Code Here


      registration.setId(genId);
      registration.setTopic(destination);
      ClientSession createSession = createSubscription(genId, registration.isDurable());
      try
      {
         PushConsumer consumer = new PushConsumer(sessionFactory, genId, genId, registration);
         try
         {
            consumer.start();
            if (registration.isDurable() && pushStore != null)
            {
               pushStore.add(registration);
            }
         }
         catch (Exception e)
         {
            consumer.stop();
            throw new WebApplicationException(e, Response.serverError().entity("Failed to start consumer.").type("text/plain").build());
         }

         consumers.put(genId, consumer);
         UriBuilder location = uriInfo.getAbsolutePathBuilder();
View Full Code Here

   @GET
   @Path("{consumer-id}")
   @Produces("application/xml")
   public PushTopicRegistration getConsumer(@PathParam("consumer-id") String consumerId)
   {
      PushConsumer consumer = consumers.get(consumerId);
      if (consumer == null)
      {
         throw new WebApplicationException(Response.status(404).entity("Could not find consumer.").type("text/plain").build());
      }
      return (PushTopicRegistration) consumer.getRegistration();
   }
View Full Code Here

   @DELETE
   @Path("{consumer-id}")
   public void deleteConsumer(@PathParam("consumer-id") String consumerId)
   {
      PushConsumer consumer = consumers.remove(consumerId);
      if (consumer == null)
      {
         throw new WebApplicationException(Response.status(404).entity("Could not find consumer.").type("text/plain").build());
      }
      consumer.stop();
      deleteSubscriberQueue(consumer);
   }
View Full Code Here

   @Produces("application/xml")
   public PushTopicRegistration getConsumer(@Context UriInfo uriInfo, @PathParam("consumer-id") String consumerId)
   {
      HornetQRestLogger.LOGGER.debug("Handling GET request for \"" + uriInfo.getPath() + "\"");

      PushConsumer consumer = consumers.get(consumerId);
      if (consumer == null)
      {
         throw new WebApplicationException(Response.status(404).entity("Could not find consumer.").type("text/plain").build());
      }
      return (PushTopicRegistration) consumer.getRegistration();
   }
View Full Code Here

   @Path("{consumer-id}")
   public void deleteConsumer(@Context UriInfo uriInfo, @PathParam("consumer-id") String consumerId)
   {
      HornetQRestLogger.LOGGER.debug("Handling DELETE request for \"" + uriInfo.getPath() + "\"");

      PushConsumer consumer = consumers.remove(consumerId);
      if (consumer == null)
      {
         throw new WebApplicationException(Response.status(404).entity("Could not find consumer.").type("text/plain").build());
      }
      consumer.stop();
      deleteSubscriberQueue(consumer);
   }
View Full Code Here

TOP

Related Classes of org.hornetq.rest.queue.push.PushConsumer

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.