public class AmqpConsumer extends AmqpAbstractResource<JmsConsumerInfo,org.apache.qpid.proton.engine.Receiver>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
deferredClose |
protected int |
deliveredCount |
protected int |
dispatchedCount |
protected long |
incomingSequence |
protected AsyncResult |
pullRequest |
protected AmqpSession |
session |
protected AsyncResult |
stopRequest |
closeRequest, closeTimeoutTask| Constructor and Description |
|---|
AmqpConsumer(AmqpSession session,
JmsConsumerInfo info,
org.apache.qpid.proton.engine.Receiver receiver) |
| Modifier and Type | Method and Description |
|---|---|
void |
acknowledge(JmsInboundMessageDispatch envelope,
ProviderConstants.ACK_TYPE ackType)
Called to acknowledge a given delivery.
|
void |
acknowledge(ProviderConstants.ACK_TYPE ackType)
Called to acknowledge all messages that have been marked as delivered but
have not yet been marked consumed.
|
void |
close(AsyncResult request) |
protected void |
closeOrDetachEndpoint()
Perform the close operation on the managed endpoint.
|
protected void |
deliver(JmsInboundMessageDispatch envelope) |
AmqpConnection |
getConnection() |
JmsConsumerId |
getConsumerId() |
JmsDestination |
getDestination() |
int |
getDrainTimeout() |
protected long |
getNextIncomingSequenceNumber() |
AmqpSession |
getSession() |
void |
handleResourceClosure(AmqpProvider provider,
ProviderException cause) |
boolean |
isStopping() |
void |
postCommit() |
void |
postRollback() |
void |
preCommit() |
void |
preRollback() |
void |
processDeliveryUpdates(AmqpProvider provider,
org.apache.qpid.proton.engine.Delivery delivery)
Called when the Proton Engine signals an Delivery related event has been triggered
for the given endpoint.
|
void |
processFlowUpdates(AmqpProvider provider)
Called when the Proton Engine signals an Flow related event has been triggered
for the given endpoint.
|
void |
pull(long timeout,
AsyncResult request)
Request a remote peer send a Message to this client.
|
void |
recover()
Recovers all previously delivered but not acknowledged messages.
|
void |
start(AsyncResult request)
Starts the consumer by setting the link credit to the given prefetch value.
|
void |
stop(AsyncResult request)
Stops the consumer, using all link credit and waiting for in-flight messages to arrive.
|
String |
toString() |
closeResource, getEndpoint, getLocalState, getParent, getRemoteState, getResourceInfo, isAwaitingClose, isClosed, isOpen, processRemoteClose, processRemoteDetach, processRemoteOpenprotected final AmqpSession session
protected AsyncResult stopRequest
protected AsyncResult pullRequest
protected long incomingSequence
protected int deliveredCount
protected int dispatchedCount
protected boolean deferredClose
public AmqpConsumer(AmqpSession session, JmsConsumerInfo info, org.apache.qpid.proton.engine.Receiver receiver)
public void close(AsyncResult request)
close in class AmqpAbstractResource<JmsConsumerInfo,org.apache.qpid.proton.engine.Receiver>public void start(AsyncResult request)
request - The request that awaits completion of the consumer start.public void stop(AsyncResult request)
request - The request that awaits completion of the consumer stop.public void processFlowUpdates(AmqpProvider provider) throws ProviderException
AmqpEventSinkprocessFlowUpdates in interface AmqpEventSinkprocessFlowUpdates in class AmqpAbstractResource<JmsConsumerInfo,org.apache.qpid.proton.engine.Receiver>provider - the AmqpProvider instance for easier access to fire events.ProviderException - if an error occurs while processing the update.public void acknowledge(ProviderConstants.ACK_TYPE ackType)
ackType - the type of acknowledgement to performpublic void acknowledge(JmsInboundMessageDispatch envelope, ProviderConstants.ACK_TYPE ackType)
envelope - the delivery that is to be acknowledged.ackType - the type of acknowledgement to perform.public void recover()
throws Exception
Exception - if an error occurs while performing the recover.public void pull(long timeout,
AsyncResult request)
timeout - the amount of time to tell the remote peer to keep this pull request valid.request - the asynchronous request object waiting to be notified of the pull having completed.public void processDeliveryUpdates(AmqpProvider provider, org.apache.qpid.proton.engine.Delivery delivery) throws ProviderException
AmqpEventSinkprocessDeliveryUpdates in interface AmqpEventSinkprocessDeliveryUpdates in class AmqpAbstractResource<JmsConsumerInfo,org.apache.qpid.proton.engine.Receiver>provider - the AmqpProvider instance for easier access to fire events.delivery - the Delivery that has an update to its state which needs handled.ProviderException - if an error occurs while processing the update.protected long getNextIncomingSequenceNumber()
protected void closeOrDetachEndpoint()
AmqpAbstractResourcecloseOrDetachEndpoint in class AmqpAbstractResource<JmsConsumerInfo,org.apache.qpid.proton.engine.Receiver>public AmqpConnection getConnection()
public AmqpSession getSession()
public JmsConsumerId getConsumerId()
public JmsDestination getDestination()
public boolean isStopping()
public int getDrainTimeout()
protected void deliver(JmsInboundMessageDispatch envelope) throws Exception
Exceptionpublic void preCommit()
public void preRollback()
public void postCommit()
public void postRollback()
public void handleResourceClosure(AmqpProvider provider, ProviderException cause)
handleResourceClosure in class AmqpAbstractResource<JmsConsumerInfo,org.apache.qpid.proton.engine.Receiver>Copyright © 2013–2019 The Apache Software Foundation. All rights reserved.