use of org.apache.activemq.artemis.rest.queue.QueueConsumer in project activemq-artemis by apache.
the class SubscriptionsResource method createConsumer.
protected QueueConsumer createConsumer(boolean durable, boolean autoAck, String subscriptionName, String selector, long timeout, boolean deleteWhenIdle) throws ActiveMQException {
QueueConsumer consumer;
if (autoAck) {
SubscriptionResource subscription = new SubscriptionResource(sessionFactory, subscriptionName, subscriptionName, serviceManager, selector, durable, timeout);
subscription.setDurable(durable);
subscription.setDeleteWhenIdle(deleteWhenIdle);
consumer = subscription;
} else {
AcknowledgedSubscriptionResource subscription = new AcknowledgedSubscriptionResource(sessionFactory, subscriptionName, subscriptionName, serviceManager, selector, durable, timeout);
subscription.setDurable(durable);
subscription.setDeleteWhenIdle(deleteWhenIdle);
consumer = subscription;
}
return consumer;
}
use of org.apache.activemq.artemis.rest.queue.QueueConsumer in project activemq-artemis by apache.
the class SubscriptionsResource method internalHeadAutoAckSubscription.
private Response internalHeadAutoAckSubscription(UriInfo uriInfo, String consumerId) {
QueueConsumer consumer = findAutoAckSubscription(consumerId);
Response.ResponseBuilder builder = Response.noContent();
String pathToPullSubscriptions = uriInfo.getMatchedURIs().get(1);
headAutoAckSubscriptionResponse(uriInfo, consumer, builder, pathToPullSubscriptions);
return builder.build();
}
use of org.apache.activemq.artemis.rest.queue.QueueConsumer in project activemq-artemis by apache.
the class SubscriptionsResource method shutdown.
@Override
public void shutdown(String target) {
QueueConsumer consumer = queueConsumers.get(target);
if (consumer == null)
return;
shutdown(consumer);
}
Aggregations