Package org.apache.activemq.command
Class ConsumerInfo
java.lang.Object
org.apache.activemq.command.BaseCommand
org.apache.activemq.command.ConsumerInfo
- All Implemented Interfaces:
Command
,DataStructure
,TransientInitializer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BooleanExpression
protected BrokerId[]
protected boolean
protected String
protected ConsumerId
protected int
static final byte
protected ActiveMQDestination
protected boolean
protected boolean
static final byte
static final byte
protected int
static final byte
protected List<ConsumerId>
protected boolean
protected boolean
protected boolean
static final byte
protected boolean
protected int
protected byte
protected boolean
protected String
protected String
Fields inherited from class org.apache.activemq.command.BaseCommand
commandId, responseRequired
-
Constructor Summary
ConstructorsConstructorDescriptionConsumerInfo
(ConsumerId consumerId) ConsumerInfo
(SessionInfo sessionInfo, long consumerId) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addNetworkConsumerId
(ConsumerId networkConsumerId) void
copy()
void
copy
(ConsumerInfo info) void
boolean
A transient additional predicate that can be used it inject additional predicates into the selector on the fly.long
BrokerId[]
The route of brokers the command has moved through.Used to identify the id of a client connection.Is used to uniquely identify the consumer to the broker.int
byte
The destination that the consumer is interested in receiving messages from.long
int
How many messages a broker will keep around, above the prefetch limit, for non-durable topics before starting to discard older messages.Tracks the original subscription id that causes a subscription to percolate through a network when networkTTL > 1.int
How many messages a broker will send to the client without receiving an ack before he stops dispatching messages to the client.byte
The broker will avoid dispatching to a lower priority consumer if there are other higher priority consumers available to dispatch to.The JMS selector used to filter out messages that this consumer is interested in.Used to identify the name of a durable subscription.int
hashCode()
void
void
boolean
Is this consumer a queue browser?boolean
Should the broker dispatch a message to the consumer async?boolean
boolean
An exclusive consumer locks out other consumers from being able to receive messages from the destination.boolean
boolean
boolean
Set noLocal to true to avoid receiving messages that were published locally on the same connection.boolean
The broker may be able to optimize it's processing or provides better QOS if it knows the consumer will not be sending ranged acks.boolean
boolean
A retroactive consumer only has meaning for Topics.void
removeNetworkConsumerId
(ConsumerId networkConsumerId) void
setAdditionalPredicate
(BooleanExpression additionalPredicate) void
setBrokerPath
(BrokerId[] brokerPath) void
setBrowser
(boolean browser) void
setClientId
(String clientId) void
setConsumerId
(ConsumerId consumerId) void
setCurrentPrefetchSize
(int currentPrefetchSize) void
setDestination
(ActiveMQDestination destination) void
setDispatchAsync
(boolean dispatchAsync) void
setExclusive
(boolean exclusive) void
setLastDeliveredSequenceId
(long lastDeliveredSequenceId) void
setMaximumPendingMessageLimit
(int maximumPendingMessageLimit) void
setNetworkConsumerPath
(ConsumerId[] consumerPath) void
setNetworkSubscription
(boolean networkSubscription) void
setNoLocal
(boolean noLocal) void
setNoRangeAcks
(boolean noRangeAcks) void
setOptimizedAcknowledge
(boolean optimizedAcknowledge) void
setPrefetchSize
(int prefetchSize) void
setPriority
(byte priority) void
setRetroactive
(boolean retroactive) void
setSelector
(String selector) void
setSubscriptionName
(String durableSubscriptionId) toString()
visit
(CommandVisitor visitor) Methods inherited from class org.apache.activemq.command.BaseCommand
copy, getCommandId, getFrom, getTo, isBrokerInfo, isConnectionControl, isConsumerControl, isMarshallAware, isMessage, isMessageAck, isMessageDispatch, isMessageDispatchNotification, isResponse, isResponseRequired, isShutdownInfo, isWireFormatInfo, setCommandId, setFrom, setResponseRequired, setTo, toString
-
Field Details
-
DATA_STRUCTURE_TYPE
public static final byte DATA_STRUCTURE_TYPE- See Also:
-
HIGH_PRIORITY
public static final byte HIGH_PRIORITY- See Also:
-
NORMAL_PRIORITY
public static final byte NORMAL_PRIORITY- See Also:
-
NETWORK_CONSUMER_PRIORITY
public static final byte NETWORK_CONSUMER_PRIORITY- See Also:
-
LOW_PRIORITY
public static final byte LOW_PRIORITY- See Also:
-
consumerId
-
destination
-
prefetchSize
protected int prefetchSize -
maximumPendingMessageLimit
protected int maximumPendingMessageLimit -
browser
protected boolean browser -
dispatchAsync
protected boolean dispatchAsync -
selector
-
clientId
-
subscriptionName
-
noLocal
protected boolean noLocal -
exclusive
protected boolean exclusive -
retroactive
protected boolean retroactive -
priority
protected byte priority -
brokerPath
-
optimizedAcknowledge
protected boolean optimizedAcknowledge -
currentPrefetchSize
protected transient int currentPrefetchSize -
noRangeAcks
protected boolean noRangeAcks -
additionalPredicate
-
networkSubscription
protected transient boolean networkSubscription -
networkConsumerIds
-
-
Constructor Details
-
ConsumerInfo
public ConsumerInfo() -
ConsumerInfo
-
ConsumerInfo
-
-
Method Details
-
copy
-
copy
-
isDurable
public boolean isDurable() -
getDataStructureType
public byte getDataStructureType()- Specified by:
getDataStructureType
in interfaceDataStructure
- Returns:
- The type of the data structure
-
getConsumerId
Is used to uniquely identify the consumer to the broker. -
setConsumerId
-
isBrowser
public boolean isBrowser()Is this consumer a queue browser? -
setBrowser
public void setBrowser(boolean browser) -
getDestination
The destination that the consumer is interested in receiving messages from. This destination could be a composite destination. -
setDestination
-
getPrefetchSize
public int getPrefetchSize()How many messages a broker will send to the client without receiving an ack before he stops dispatching messages to the client. -
setPrefetchSize
public void setPrefetchSize(int prefetchSize) -
getMaximumPendingMessageLimit
public int getMaximumPendingMessageLimit()How many messages a broker will keep around, above the prefetch limit, for non-durable topics before starting to discard older messages. -
setMaximumPendingMessageLimit
public void setMaximumPendingMessageLimit(int maximumPendingMessageLimit) -
isDispatchAsync
public boolean isDispatchAsync()Should the broker dispatch a message to the consumer async? If he does it async, then he uses a more SEDA style of processing while if it is not done async, then he broker use a STP style of processing. STP is more appropriate in high bandwidth situations or when being used by and in vm transport. -
setDispatchAsync
public void setDispatchAsync(boolean dispatchAsync) -
getSelector
The JMS selector used to filter out messages that this consumer is interested in. -
setSelector
-
getClientId
Used to identify the id of a client connection. -
setClientId
-
getSubscriptionName
Used to identify the name of a durable subscription. -
setSubscriptionName
-
isNoLocal
public boolean isNoLocal()Set noLocal to true to avoid receiving messages that were published locally on the same connection. -
setNoLocal
public void setNoLocal(boolean noLocal) -
isExclusive
public boolean isExclusive()An exclusive consumer locks out other consumers from being able to receive messages from the destination. If there are multiple exclusive consumers for a destination, the first one created will be the exclusive consumer of the destination. -
setExclusive
public void setExclusive(boolean exclusive) -
isRetroactive
public boolean isRetroactive()A retroactive consumer only has meaning for Topics. It allows a consumer to retroactively see messages sent prior to the consumer being created. If the consumer is not durable, it will be delivered the last message published to the topic. If the consumer is durable then it will receive all persistent messages that are still stored in persistent storage for that topic. -
setRetroactive
public void setRetroactive(boolean retroactive) -
createRemoveCommand
-
getPriority
public byte getPriority()The broker will avoid dispatching to a lower priority consumer if there are other higher priority consumers available to dispatch to. This allows letting the broker to have an affinity to higher priority consumers. Default priority is 0. -
setPriority
public void setPriority(byte priority) -
getBrokerPath
The route of brokers the command has moved through. -
setBrokerPath
-
getAdditionalPredicate
A transient additional predicate that can be used it inject additional predicates into the selector on the fly. Handy if if say a Security Broker interceptor wants to filter out messages based on security level of the consumer. -
setAdditionalPredicate
-
visit
-
isNetworkSubscription
public boolean isNetworkSubscription()- Returns:
- Returns the networkSubscription.
-
setNetworkSubscription
public void setNetworkSubscription(boolean networkSubscription) - Parameters:
networkSubscription
- The networkSubscription to set.
-
isOptimizedAcknowledge
public boolean isOptimizedAcknowledge()- Returns:
- Returns the optimizedAcknowledge.
-
setOptimizedAcknowledge
public void setOptimizedAcknowledge(boolean optimizedAcknowledge) - Parameters:
optimizedAcknowledge
- The optimizedAcknowledge to set.
-
getCurrentPrefetchSize
public int getCurrentPrefetchSize()- Returns:
- Returns the currentPrefetchSize.
-
setCurrentPrefetchSize
public void setCurrentPrefetchSize(int currentPrefetchSize) - Parameters:
currentPrefetchSize
- The currentPrefetchSize to set.
-
isNoRangeAcks
public boolean isNoRangeAcks()The broker may be able to optimize it's processing or provides better QOS if it knows the consumer will not be sending ranged acks.- Returns:
- true if the consumer will not send range acks.
-
setNoRangeAcks
public void setNoRangeAcks(boolean noRangeAcks) -
addNetworkConsumerId
-
removeNetworkConsumerId
-
isNetworkConsumersEmpty
public boolean isNetworkConsumersEmpty() -
getNetworkConsumerIds
-
hashCode
public int hashCode() -
equals
-
getNetworkConsumerPath
Tracks the original subscription id that causes a subscription to percolate through a network when networkTTL > 1. Tracking the original subscription allows duplicate suppression.- Returns:
- array of the current subscription path
-
setNetworkConsumerPath
-
setLastDeliveredSequenceId
public void setLastDeliveredSequenceId(long lastDeliveredSequenceId) -
getLastDeliveredSequenceId
public long getLastDeliveredSequenceId() -
incrementAssignedGroupCount
-
clearAssignedGroupCount
-
decrementAssignedGroupCount
-
getAssignedGroupCount
-
initTransients
public void initTransients()- Specified by:
initTransients
in interfaceTransientInitializer
-
toString
- Overrides:
toString
in classBaseCommand
-