public class QueueConsumer extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
autoAck |
protected boolean |
closed |
protected ClientConsumer |
consumer |
protected String |
destination |
protected 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 ClientSession |
session |
Constructor and Description |
---|
QueueConsumer(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() |
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 ClientMessage |
receive(long timeoutSecs) |
protected 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 ClientSessionFactory factory
protected ClientSession session
protected 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(ClientSessionFactory factory, String destination, String id, DestinationServiceManager serviceManager, String selector) throws ActiveMQException
ActiveMQException
public 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 ActiveMQException
ActiveMQException
protected ClientMessage receiveFromConsumer(long timeoutSecs) throws Exception
Exception
protected ClientMessage receive(long timeoutSecs) throws Exception
Exception
protected 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 ConnectionFactoryOptions getJmsOptions()
Copyright © 2016 The Apache Software Foundation. All rights reserved.