Class ConsumerInfo

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

public class ConsumerInfo extends BaseCommand implements TransientInitializer
  • 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

      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 String selector
    • clientId

      protected String clientId
    • subscriptionName

      protected 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 List<ConsumerId> networkConsumerIds
  • Constructor Details

    • ConsumerInfo

      public ConsumerInfo()
    • ConsumerInfo

      public ConsumerInfo(ConsumerId consumerId)
    • ConsumerInfo

      public ConsumerInfo(SessionInfo sessionInfo, long consumerId)
  • Method Details

    • copy

      public ConsumerInfo copy()
    • copy

      public void copy(ConsumerInfo info)
    • isDurable

      public boolean isDurable()
    • getDataStructureType

      public byte getDataStructureType()
      Specified by:
      getDataStructureType in interface DataStructure
      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 String getSelector()
      The JMS selector used to filter out messages that this consumer is interested in.
    • setSelector

      public void setSelector(String selector)
    • getClientId

      public String getClientId()
      Used to identify the id of a client connection.
    • setClientId

      public void setClientId(String clientId)
    • getSubscriptionName

      public String getSubscriptionName()
      Used to identify the name of a durable subscription.
    • setSubscriptionName

      public void setSubscriptionName(String durableSubscriptionId)
    • 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 Exception
      Specified by:
      visit in interface Command
      Throws:
      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 List<ConsumerId> getNetworkConsumerIds()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • 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()
    • incrementAssignedGroupCount

      public void incrementAssignedGroupCount(ActiveMQDestination dest)
    • clearAssignedGroupCount

      public void clearAssignedGroupCount(ActiveMQDestination dest)
    • decrementAssignedGroupCount

      public void decrementAssignedGroupCount(ActiveMQDestination dest)
    • getAssignedGroupCount

      public long getAssignedGroupCount(ActiveMQDestination dest)
    • initTransients

      public void initTransients()
      Specified by:
      initTransients in interface TransientInitializer
    • toString

      public String toString()
      Overrides:
      toString in class BaseCommand