org.apache.activemq.artemis.rest.queue.push.PushConsumer

Here are the examples of the java api class org.apache.activemq.artemis.rest.queue.push.PushConsumer taken from open source projects.

1. PushSubscriptionsResource#deleteConsumer()

View license
@DELETE
@Path("{consumer-id}")
public void deleteConsumer(@Context UriInfo uriInfo, @PathParam("consumer-id") String consumerId) {
    ActiveMQRestLogger.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);
}

2. PushSubscriptionsResource#getConsumer()

View license
@GET
@Path("{consumer-id}")
@Produces("application/xml")
public PushTopicRegistration getConsumer(@Context UriInfo uriInfo, @PathParam("consumer-id") String consumerId) {
    ActiveMQRestLogger.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();
}

3. PushSubscriptionsResource#stop()

View license
public void stop() {
    for (PushConsumer consumer : consumers.values()) {
        consumer.stop();
        if (consumer.getRegistration().isDurable() == false) {
            deleteSubscriberQueue(consumer);
        }
    }
}