Examples of PushConsumer


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

   @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

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

   @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

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

   @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

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

   @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

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

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

      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

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

   @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

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

   @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

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

   @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

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

   @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
TOP
Copyright © 2018 www.massapi.com. 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.