public class TopicSubscription extends AbstractSubscription
| Modifier and Type | Field and Description | 
|---|---|
protected boolean | 
active  | 
protected ActiveMQMessageAudit | 
audit  | 
protected java.util.concurrent.atomic.AtomicLong | 
dispatchedCounter  | 
protected boolean | 
enableAudit  | 
protected PendingMessageCursor | 
matched  | 
protected int | 
maxAuditDepth  | 
protected int | 
maxProducersToAudit  | 
protected SystemUsage | 
usageManager  | 
broker, context, destinationFilter, destinations, info| Constructor and Description | 
|---|
TopicSubscription(Broker broker,
                 ConnectionContext context,
                 ConsumerInfo info,
                 SystemUsage usageManager)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
acknowledge(ConnectionContext context,
           MessageAck ack)
Used when client acknowledge receipt of dispatched message. 
 | 
void | 
add(MessageReference node)
Used to add messages that match the subscription. 
 | 
void | 
destroy()
Called when the subscription is destroyed. 
 | 
int | 
discarded()  | 
long | 
getDequeueCounter()  | 
long | 
getDispatchedCounter()  | 
int | 
getDispatchedQueueSize()  | 
long | 
getEnqueueCounter()  | 
int | 
getInFlightSize()  | 
PendingMessageCursor | 
getMatched()  | 
int | 
getMaxAuditDepth()  | 
int | 
getMaximumPendingMessages()  | 
int | 
getMaxProducersToAudit()  | 
int | 
getMemoryUsageHighWaterMark()  | 
MessageEvictionStrategy | 
getMessageEvictionStrategy()  | 
int | 
getPendingQueueSize()  | 
int | 
getPrefetchSize()  | 
SystemUsage | 
getUsageManager()  | 
void | 
init()  | 
boolean | 
isEnableAudit()  | 
boolean | 
isFull()  | 
boolean | 
isHighWaterMark()  | 
boolean | 
isLowWaterMark()  | 
int | 
matched()  | 
void | 
processMessageDispatchNotification(MessageDispatchNotification mdn)
Used by a Slave Broker to update dispatch infomation 
 | 
Response | 
pullMessage(ConnectionContext context,
           MessagePull pull)
Allows a consumer to pull a message on demand 
 | 
protected void | 
removeExpiredMessages()
Discard any expired messages from the matched list. 
 | 
void | 
setEnableAudit(boolean enableAudit)  | 
void | 
setMatched(PendingMessageCursor matched)  | 
void | 
setMaxAuditDepth(int maxAuditDepth)  | 
void | 
setMaximumPendingMessages(int maximumPendingMessages)
Sets the maximum number of pending messages that can be matched against
 this consumer before old messages are discarded. 
 | 
void | 
setMaxProducersToAudit(int maxProducersToAudit)  | 
void | 
setMemoryUsageHighWaterMark(int memoryUsageHighWaterMark)  | 
void | 
setMessageEvictionStrategy(MessageEvictionStrategy messageEvictionStrategy)
Sets the eviction strategy used to decide which message to evict when the
 slow consumer needs to discard messages 
 | 
void | 
setPrefetchSize(int newSize)  | 
java.lang.String | 
toString()  | 
void | 
updateConsumerPrefetch(int newPrefetch)
inform the MessageConsumer on the client to change it's prefetch 
 | 
add, addDestination, addRecoveredMessage, countBeforeFull, doAddRecoveredMessage, gc, getActiveMQDestination, getConsumedCount, getConsumerInfo, getContext, getCursorMemoryHighWaterMark, getInFlightUsage, getInfo, getObjectName, getSelector, getSelectorExpression, getTimeOfLastMessageAck, incrementConsumedCount, isBrowser, isRecoveryRequired, isSlowConsumer, matches, matches, remove, removeDestination, resetConsumedCount, setCursorMemoryHighWaterMark, setObjectName, setSelector, setSlowConsumer, setTimeOfLastMessageAck, unmatchedprotected PendingMessageCursor matched
protected final SystemUsage usageManager
protected java.util.concurrent.atomic.AtomicLong dispatchedCounter
protected int maxProducersToAudit
protected int maxAuditDepth
protected boolean enableAudit
protected ActiveMQMessageAudit audit
protected boolean active
public TopicSubscription(Broker broker, ConnectionContext context, ConsumerInfo info, SystemUsage usageManager) throws java.lang.Exception
java.lang.Exceptionpublic void init()
          throws java.lang.Exception
java.lang.Exceptionpublic void add(MessageReference node) throws java.lang.Exception
Subscriptionjava.lang.Exceptionjava.lang.InterruptedExceptionjava.io.IOExceptionprotected void removeExpiredMessages()
                              throws java.io.IOException
java.io.IOExceptionpublic void processMessageDispatchNotification(MessageDispatchNotification mdn)
Subscriptionpublic void acknowledge(ConnectionContext context, MessageAck ack) throws java.lang.Exception
Subscriptionacknowledge in interface Subscriptionacknowledge in class AbstractSubscriptionjava.io.IOExceptionjava.lang.Exceptionpublic Response pullMessage(ConnectionContext context, MessagePull pull) throws java.lang.Exception
Subscriptionjava.lang.Exceptionpublic int getPendingQueueSize()
public int getDispatchedQueueSize()
public int getMaximumPendingMessages()
public long getDispatchedCounter()
public long getEnqueueCounter()
public long getDequeueCounter()
public int discarded()
public int matched()
public void setMaximumPendingMessages(int maximumPendingMessages)
public MessageEvictionStrategy getMessageEvictionStrategy()
public void setMessageEvictionStrategy(MessageEvictionStrategy messageEvictionStrategy)
public int getMaxProducersToAudit()
public void setMaxProducersToAudit(int maxProducersToAudit)
public int getMaxAuditDepth()
public void setMaxAuditDepth(int maxAuditDepth)
public boolean isEnableAudit()
public void setEnableAudit(boolean enableAudit)
public boolean isFull()
public int getInFlightSize()
public boolean isLowWaterMark()
public boolean isHighWaterMark()
public void setMemoryUsageHighWaterMark(int memoryUsageHighWaterMark)
memoryUsageHighWaterMark - the memoryUsageHighWaterMark to setpublic int getMemoryUsageHighWaterMark()
public SystemUsage getUsageManager()
public PendingMessageCursor getMatched()
public void setMatched(PendingMessageCursor matched)
matched - the matched to setpublic void updateConsumerPrefetch(int newPrefetch)
newPrefetch - public java.lang.String toString()
toString in class java.lang.Objectpublic void destroy()
Subscriptionpublic int getPrefetchSize()
getPrefetchSize in interface SubscriptiongetPrefetchSize in class AbstractSubscriptionpublic void setPrefetchSize(int newSize)
setPrefetchSize in class AbstractSubscriptionCopyright © 2005-2014 Red Hat, Inc.. All Rights Reserved.