public class QueueConsumer extends Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
autoAck |
protected boolean |
closed |
protected org.apache.activemq.artemis.api.core.client.ClientConsumer |
consumer |
protected String |
destination |
protected org.apache.activemq.artemis.api.core.client.ClientSessionFactory |
factory |
protected String |
id |
protected ConsumedMessage |
lastConsumed |
protected long |
lastPing |
protected long |
previousIndex
token used to create consume-next links
|
protected String |
selector |
protected DestinationServiceManager |
serviceManager |
protected org.apache.activemq.artemis.api.core.client.ClientSession |
session |
| Constructor and Description |
|---|
QueueConsumer(org.apache.activemq.artemis.api.core.client.ClientSessionFactory factory,
String destination,
String id,
DestinationServiceManager serviceManager,
String selector) |
| Modifier and Type | Method and Description |
|---|---|
protected javax.ws.rs.core.Response |
checkIndexAndPoll(long wait,
javax.ws.rs.core.UriInfo info,
String basePath,
long index) |
protected void |
createSession() |
long |
getConsumeIndex() |
String |
getId() |
org.apache.activemq.artemis.jms.client.ConnectionFactoryOptions |
getJmsOptions() |
long |
getLastPingTime() |
protected javax.ws.rs.core.Response.ResponseBuilder |
getMessageResponse(ConsumedMessage msg,
javax.ws.rs.core.UriInfo info,
String basePath,
String index) |
DestinationServiceManager |
getServiceManager() |
boolean |
isClosed() |
protected void |
ping(long offsetSecs) |
javax.ws.rs.core.Response |
poll(long wait,
long index,
javax.ws.rs.core.UriInfo info) |
protected javax.ws.rs.core.Response |
pollWithIndex(long wait,
javax.ws.rs.core.UriInfo info,
String basePath,
long index) |
protected org.apache.activemq.artemis.api.core.client.ClientMessage |
receive(long timeoutSecs) |
protected org.apache.activemq.artemis.api.core.client.ClientMessage |
receiveFromConsumer(long timeoutSecs) |
static void |
setConsumeNextLink(LinkStrategy linkStrategy,
javax.ws.rs.core.Response.ResponseBuilder response,
javax.ws.rs.core.UriInfo info,
String basePath,
String index) |
protected void |
setMessageResponseLinks(javax.ws.rs.core.UriInfo info,
String basePath,
javax.ws.rs.core.Response.ResponseBuilder responseBuilder,
String index) |
protected void |
setPollTimeoutLinks(javax.ws.rs.core.UriInfo info,
String basePath,
javax.ws.rs.core.Response.ResponseBuilder builder,
String index) |
void |
setServiceManager(DestinationServiceManager serviceManager) |
void |
setSessionLink(javax.ws.rs.core.Response.ResponseBuilder response,
javax.ws.rs.core.UriInfo info,
String basePath) |
void |
shutdown() |
protected org.apache.activemq.artemis.api.core.client.ClientSessionFactory factory
protected org.apache.activemq.artemis.api.core.client.ClientSession session
protected org.apache.activemq.artemis.api.core.client.ClientConsumer consumer
protected String destination
protected boolean closed
protected String id
protected long lastPing
protected DestinationServiceManager serviceManager
protected boolean autoAck
protected String selector
protected long previousIndex
protected ConsumedMessage lastConsumed
public QueueConsumer(org.apache.activemq.artemis.api.core.client.ClientSessionFactory factory,
String destination,
String id,
DestinationServiceManager serviceManager,
String selector)
throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQExceptionpublic long getConsumeIndex()
public DestinationServiceManager getServiceManager()
public void setServiceManager(DestinationServiceManager serviceManager)
public long getLastPingTime()
protected void ping(long offsetSecs)
public String getId()
public boolean isClosed()
public void shutdown()
@Path(value="consume-next{index}")
@POST
public javax.ws.rs.core.Response poll(@HeaderParam(value="Accept-Wait") @DefaultValue(value="0")
long wait,
@PathParam(value="index")
long index,
@Context
javax.ws.rs.core.UriInfo info)
protected javax.ws.rs.core.Response checkIndexAndPoll(long wait,
javax.ws.rs.core.UriInfo info,
String basePath,
long index)
protected javax.ws.rs.core.Response pollWithIndex(long wait,
javax.ws.rs.core.UriInfo info,
String basePath,
long index)
protected void createSession()
throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQExceptionprotected org.apache.activemq.artemis.api.core.client.ClientMessage receiveFromConsumer(long timeoutSecs)
throws Exception
Exceptionprotected org.apache.activemq.artemis.api.core.client.ClientMessage receive(long timeoutSecs)
throws Exception
Exceptionprotected void setPollTimeoutLinks(javax.ws.rs.core.UriInfo info,
String basePath,
javax.ws.rs.core.Response.ResponseBuilder builder,
String index)
protected javax.ws.rs.core.Response.ResponseBuilder getMessageResponse(ConsumedMessage msg, javax.ws.rs.core.UriInfo info, String basePath, String index)
protected void setMessageResponseLinks(javax.ws.rs.core.UriInfo info,
String basePath,
javax.ws.rs.core.Response.ResponseBuilder responseBuilder,
String index)
public static void setConsumeNextLink(LinkStrategy linkStrategy, javax.ws.rs.core.Response.ResponseBuilder response, javax.ws.rs.core.UriInfo info, String basePath, String index)
public void setSessionLink(javax.ws.rs.core.Response.ResponseBuilder response,
javax.ws.rs.core.UriInfo info,
String basePath)
public org.apache.activemq.artemis.jms.client.ConnectionFactoryOptions getJmsOptions()
Copyright © 2023 The Apache Software Foundation. All Rights Reserved.