Interface Consumer
-
- All Superinterfaces:
PriorityAware
- All Known Subinterfaces:
Bridge,ServerConsumer
- All Known Implementing Classes:
BridgeImpl,ClusterConnectionBridge,Redistributor,ServerConsumerImpl
public interface Consumer extends PriorityAware
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Stringdebug()voiddisconnect()disconnect the consumerdefault voiderrorProcessing(Throwable e, MessageReference reference)voidfailed(Throwable t)default BindinggetBinding()List<MessageReference>getDeliveringMessages()FiltergetFilter()default intgetPriority()HandleStatushandle(MessageReference reference)There was a change on semantic during 2.3 here.
We now first accept the message, and the actual deliver is done as part ofproceedDeliver(MessageReference).default booleanisClosed()voidproceedDeliver(MessageReference reference)This will proceed with the actual delivery.default voidpromptDelivery()wakes up internal threads to deliver more messageslongsequentialID()an unique sequential ID for this consumerdefault booleansupportsDirectDelivery()StringtoManagementString()This method will create a string representation meant for management operations.
-
-
-
Method Detail
-
supportsDirectDelivery
default boolean supportsDirectDelivery()
- See Also:
SessionCallback.supportsDirectDelivery()
-
handle
HandleStatus handle(MessageReference reference) throws Exception
There was a change on semantic during 2.3 here.
We now first accept the message, and the actual deliver is done as part ofproceedDeliver(MessageReference). This is to avoid holding a lock on the queues while the delivery is being accomplished To avoid a lock on the queue in case of misbehaving consumers.This should return busy if handle is called before proceed deliver is called
- Parameters:
reference-- Returns:
- Throws:
Exception
-
promptDelivery
default void promptDelivery()
wakes up internal threads to deliver more messages
-
isClosed
default boolean isClosed()
-
proceedDeliver
void proceedDeliver(MessageReference reference) throws Exception
This will proceed with the actual delivery. Notice that handle should hold a readLock and proceedDelivery should release the readLock any lock operation on Consumer should also get a writeLock on the readWriteLock to guarantee there are no pending deliveries- Throws:
Exception
-
getBinding
default Binding getBinding()
-
getFilter
Filter getFilter()
-
getDeliveringMessages
List<MessageReference> getDeliveringMessages()
- Returns:
- the list of messages being delivered
-
debug
String debug()
-
toManagementString
String toManagementString()
This method will create a string representation meant for management operations. This is different from the toString method that's meant for debugging and will contain information that regular users won't understand well- Returns:
-
disconnect
void disconnect()
disconnect the consumer
-
failed
void failed(Throwable t)
-
sequentialID
long sequentialID()
an unique sequential ID for this consumer
-
getPriority
default int getPriority()
- Specified by:
getPriorityin interfacePriorityAware
-
errorProcessing
default void errorProcessing(Throwable e, MessageReference reference)
-
-