org.apache.activemq.command
Class ConsumerInfo

java.lang.Object
  extended by org.apache.activemq.command.BaseCommand
      extended by org.apache.activemq.command.ConsumerInfo
All Implemented Interfaces:
Command, DataStructure

public class ConsumerInfo
extends BaseCommand


Field Summary
protected  BooleanExpression additionalPredicate
           
protected  BrokerId[] brokerPath
           
protected  boolean browser
           
protected  ConsumerId consumerId
           
protected  int currentPrefetchSize
           
static byte DATA_STRUCTURE_TYPE
           
protected  ActiveMQDestination destination
           
protected  boolean dispatchAsync
           
protected  boolean exclusive
           
static byte HIGH_PRIORITY
           
static byte LOW_PRIORITY
           
protected  int maximumPendingMessageLimit
           
static byte NETWORK_CONSUMER_PRIORITY
           
protected  java.util.List<ConsumerId> networkConsumerIds
           
protected  boolean networkSubscription
           
protected  boolean noLocal
           
protected  boolean noRangeAcks
           
static byte NORMAL_PRIORITY
           
protected  boolean optimizedAcknowledge
           
protected  int prefetchSize
           
protected  byte priority
           
protected  boolean retroactive
           
protected  java.lang.String selector
           
protected  java.lang.String subscriptionName
           
 
Fields inherited from class org.apache.activemq.command.BaseCommand
commandId, responseRequired
 
Constructor Summary
ConsumerInfo()
           
ConsumerInfo(ConsumerId consumerId)
           
ConsumerInfo(SessionInfo sessionInfo, long consumerId)
           
 
Method Summary
 void addNetworkConsumerId(ConsumerId networkConsumerId)
           
 ConsumerInfo copy()
           
 void copy(ConsumerInfo info)
           
 RemoveInfo createRemoveCommand()
           
 BooleanExpression getAdditionalPredicate()
          A transient additional predicate that can be used it inject additional predicates into the selector on the fly.
 BrokerId[] getBrokerPath()
          The route of brokers the command has moved through.
 ConsumerId getConsumerId()
          Is used to uniquely identify the consumer to the broker.
 int getCurrentPrefetchSize()
           
 byte getDataStructureType()
           
 ActiveMQDestination getDestination()
          The destination that the consumer is interested in receiving messages from.
 long getLastDeliveredSequenceId()
           
 int getMaximumPendingMessageLimit()
          How many messages a broker will keep around, above the prefetch limit, for non-durable topics before starting to discard older messages.
 java.util.List<ConsumerId> getNetworkConsumerIds()
           
 ConsumerId[] getNetworkConsumerPath()
          Tracks the original subscription id that causes a subscription to percolate through a network when networkTTL > 1.
 int getPrefetchSize()
          How many messages a broker will send to the client without receiving an ack before he stops dispatching messages to the client.
 byte getPriority()
          The broker will avoid dispatching to a lower priority consumer if there are other higher priority consumers available to dispatch to.
 java.lang.String getSelector()
          The JMS selector used to filter out messages that this consumer is interested in.
 java.lang.String getSubcriptionName()
          Deprecated.  
 java.lang.String getSubscriptionName()
          Used to identify the name of a durable subscription.
 boolean isBrowser()
          Is this consumer a queue browser?
 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.
 boolean isDurable()
           
 boolean isExclusive()
          An exclusive consumer locks out other consumers from being able to receive messages from the destination.
 boolean isNetworkConsumersEmpty()
           
 boolean isNetworkSubscription()
           
 boolean isNoLocal()
          Set noLocal to true to avoid receiving messages that were published locally on the same connection.
 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.
 boolean isOptimizedAcknowledge()
           
 boolean isRetroactive()
          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 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(java.lang.String selector)
           
 void setSubcriptionName(java.lang.String durableSubscriptionId)
          Deprecated.  
 void setSubscriptionName(java.lang.String durableSubscriptionId)
           
 Response visit(CommandVisitor visitor)
           
 
Methods inherited from class org.apache.activemq.command.BaseCommand
copy, getCommandId, getFrom, getTo, isBrokerInfo, isConnectionControl, isMarshallAware, isMessage, isMessageAck, isMessageDispatch, isMessageDispatchNotification, isResponse, isResponseRequired, isShutdownInfo, isWireFormatInfo, setCommandId, setFrom, setResponseRequired, setTo, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DATA_STRUCTURE_TYPE

public static final byte DATA_STRUCTURE_TYPE
See Also:
Constant Field Values

HIGH_PRIORITY

public static final byte HIGH_PRIORITY
See Also:
Constant Field Values

NORMAL_PRIORITY

public static final byte NORMAL_PRIORITY
See Also:
Constant Field Values

NETWORK_CONSUMER_PRIORITY

public static final byte NETWORK_CONSUMER_PRIORITY
See Also:
Constant Field Values

LOW_PRIORITY

public static final byte LOW_PRIORITY
See Also:
Constant Field Values

consumerId

protected ConsumerId consumerId

destination

protected ActiveMQDestination destination

prefetchSize

protected int prefetchSize

maximumPendingMessageLimit

protected int maximumPendingMessageLimit

browser

protected boolean browser

dispatchAsync

protected boolean dispatchAsync

selector

protected java.lang.String selector

subscriptionName

protected java.lang.String subscriptionName

noLocal

protected boolean noLocal

exclusive

protected boolean exclusive

retroactive

protected boolean retroactive

priority

protected byte priority

brokerPath

protected BrokerId[] brokerPath

optimizedAcknowledge

protected boolean optimizedAcknowledge

currentPrefetchSize

protected transient int currentPrefetchSize

noRangeAcks

protected boolean noRangeAcks

additionalPredicate

protected BooleanExpression additionalPredicate

networkSubscription

protected transient boolean networkSubscription

networkConsumerIds

protected transient java.util.List<ConsumerId> networkConsumerIds
Constructor Detail

ConsumerInfo

public ConsumerInfo()

ConsumerInfo

public ConsumerInfo(ConsumerId consumerId)

ConsumerInfo

public ConsumerInfo(SessionInfo sessionInfo,
                    long consumerId)
Method Detail

copy

public ConsumerInfo copy()

copy

public void copy(ConsumerInfo info)

isDurable

public boolean isDurable()

getDataStructureType

public byte getDataStructureType()
Returns:
The type of the data structure

getConsumerId

public ConsumerId getConsumerId()
Is used to uniquely identify the consumer to the broker.


setConsumerId

public void setConsumerId(ConsumerId consumerId)

isBrowser

public boolean isBrowser()
Is this consumer a queue browser?


setBrowser

public void setBrowser(boolean browser)

getDestination

public ActiveMQDestination getDestination()
The destination that the consumer is interested in receiving messages from. This destination could be a composite destination.


setDestination

public void setDestination(ActiveMQDestination destination)

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

public java.lang.String getSelector()
The JMS selector used to filter out messages that this consumer is interested in.


setSelector

public void setSelector(java.lang.String selector)

getSubscriptionName

public java.lang.String getSubscriptionName()
Used to identify the name of a durable subscription.


setSubscriptionName

public void setSubscriptionName(java.lang.String durableSubscriptionId)

getSubcriptionName

public java.lang.String getSubcriptionName()
Deprecated. 

Returns:
See Also:
getSubscriptionName

setSubcriptionName

public void setSubcriptionName(java.lang.String durableSubscriptionId)
Deprecated. 

Parameters:
durableSubscriptionId -
See Also:
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

public RemoveInfo 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

public BrokerId[] getBrokerPath()
The route of brokers the command has moved through.


setBrokerPath

public void setBrokerPath(BrokerId[] brokerPath)

getAdditionalPredicate

public BooleanExpression 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

public void setAdditionalPredicate(BooleanExpression additionalPredicate)

visit

public Response visit(CommandVisitor visitor)
               throws java.lang.Exception
Throws:
java.lang.Exception

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

public void addNetworkConsumerId(ConsumerId networkConsumerId)

removeNetworkConsumerId

public void removeNetworkConsumerId(ConsumerId networkConsumerId)

isNetworkConsumersEmpty

public boolean isNetworkConsumersEmpty()

getNetworkConsumerIds

public java.util.List<ConsumerId> getNetworkConsumerIds()

getNetworkConsumerPath

public ConsumerId[] 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

public void setNetworkConsumerPath(ConsumerId[] consumerPath)

setLastDeliveredSequenceId

public void setLastDeliveredSequenceId(long lastDeliveredSequenceId)

getLastDeliveredSequenceId

public long getLastDeliveredSequenceId()


Copyright © 2005-2011 FuseSource, Corp.. All Rights Reserved.