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 BooleanExpressionprotected BrokerId[]protected booleanprotected Stringprotected ConsumerIdprotected intstatic final byteprotected ActiveMQDestinationprotected booleanprotected booleanstatic final bytestatic final byteprotected intstatic final byteprotected List<ConsumerId>protected booleanprotected booleanprotected booleanstatic final byteprotected booleanprotected intprotected byteprotected booleanprotected Stringprotected StringFields inherited from class org.apache.activemq.command.BaseCommand
commandId, responseRequired -
Constructor Summary
ConstructorsConstructorDescriptionConsumerInfo(ConsumerId consumerId) ConsumerInfo(SessionInfo sessionInfo, long consumerId) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNetworkConsumerId(ConsumerId networkConsumerId) voidcopy()voidcopy(ConsumerInfo info) voidbooleanA transient additional predicate that can be used it inject additional predicates into the selector on the fly.longBrokerId[]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.intbyteThe destination that the consumer is interested in receiving messages from.longintHow 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.intHow many messages a broker will send to the client without receiving an ack before he stops dispatching messages to the client.byteThe 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.inthashCode()voidvoidbooleanIs this consumer a queue browser?booleanShould the broker dispatch a message to the consumer async?booleanbooleanAn exclusive consumer locks out other consumers from being able to receive messages from the destination.booleanbooleanbooleanSet noLocal to true to avoid receiving messages that were published locally on the same connection.booleanThe broker may be able to optimize it's processing or provides better QOS if it knows the consumer will not be sending ranged acks.booleanbooleanA retroactive consumer only has meaning for Topics.voidremoveNetworkConsumerId(ConsumerId networkConsumerId) voidsetAdditionalPredicate(BooleanExpression additionalPredicate) voidsetBrokerPath(BrokerId[] brokerPath) voidsetBrowser(boolean browser) voidsetClientId(String clientId) voidsetConsumerId(ConsumerId consumerId) voidsetCurrentPrefetchSize(int currentPrefetchSize) voidsetDestination(ActiveMQDestination destination) voidsetDispatchAsync(boolean dispatchAsync) voidsetExclusive(boolean exclusive) voidsetLastDeliveredSequenceId(long lastDeliveredSequenceId) voidsetMaximumPendingMessageLimit(int maximumPendingMessageLimit) voidsetNetworkConsumerPath(ConsumerId[] consumerPath) voidsetNetworkSubscription(boolean networkSubscription) voidsetNoLocal(boolean noLocal) voidsetNoRangeAcks(boolean noRangeAcks) voidsetOptimizedAcknowledge(boolean optimizedAcknowledge) voidsetPrefetchSize(int prefetchSize) voidsetPriority(byte priority) voidsetRetroactive(boolean retroactive) voidsetSelector(String selector) voidsetSubscriptionName(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:
getDataStructureTypein 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:
initTransientsin interfaceTransientInitializer
-
toString
- Overrides:
toStringin classBaseCommand
-