public class QueueImpl extends Object implements Queue
Modifier and Type | Class and Description |
---|---|
class |
QueueImpl.RefsOperation |
Modifier and Type | Field and Description |
---|---|
static int |
CHECK_QUEUE_SIZE_PERIOD |
static int |
DEFAULT_FLUSH_LIMIT |
protected AtomicInteger |
deliveringCount |
static int |
DELIVERY_TIMEOUT
If The system gets slow for any reason, this is the maximum time an Delivery or
or depage executor should be hanging on
|
static int |
MAX_DELIVERIES_IN_LOOP |
static int |
NUM_PRIORITIES |
static int |
REDISTRIBUTOR_BATCH_SIZE |
Constructor and Description |
---|
QueueImpl(long id,
SimpleString address,
SimpleString name,
Filter filter,
boolean durable,
boolean temporary,
ScheduledExecutorService scheduledExecutor,
PostOffice postOffice,
StorageManager storageManager,
HierarchicalRepository<AddressSettings> addressSettingsRepository,
Executor executor) |
QueueImpl(long id,
SimpleString address,
SimpleString name,
Filter filter,
PageSubscription pageSubscription,
boolean durable,
boolean temporary,
ScheduledExecutorService scheduledExecutor,
PostOffice postOffice,
StorageManager storageManager,
HierarchicalRepository<AddressSettings> addressSettingsRepository,
Executor executor) |
Modifier and Type | Method and Description |
---|---|
void |
acknowledge(MessageReference ref) |
void |
acknowledge(Transaction tx,
MessageReference ref) |
void |
addConsumer(Consumer consumer) |
void |
addHead(List<MessageReference> refs) |
void |
addHead(MessageReference ref) |
void |
addRedistributor(long delay) |
void |
addTail(MessageReference ref) |
void |
addTail(MessageReference ref,
boolean direct) |
void |
cancel(MessageReference reference,
long timeBase) |
void |
cancel(Transaction tx,
MessageReference reference) |
void |
cancel(Transaction tx,
MessageReference reference,
boolean ignoreRedeliveryCheck) |
void |
cancelRedistributor() |
boolean |
changeReferencePriority(long messageID,
byte newPriority) |
int |
changeReferencesPriority(Filter filter,
byte newPriority) |
boolean |
checkRedelivery(MessageReference reference,
long timeBase,
boolean ignoreRedeliveryDelay) |
void |
close() |
String |
debug() |
int |
deleteAllReferences() |
int |
deleteAllReferences(int flushLimit) |
int |
deleteMatchingReferences(Filter filter) |
int |
deleteMatchingReferences(int flushLimit,
Filter filter1) |
void |
deleteQueue() |
void |
deleteQueue(boolean removeConsumers) |
boolean |
deleteReference(long messageID) |
void |
deliverAsync() |
void |
deliverNow() |
void |
destroyPaging() |
boolean |
equals(Object other) |
void |
expire(MessageReference ref) |
boolean |
expireReference(long messageID) |
void |
expireReferences() |
int |
expireReferences(Filter filter)
Expire all the references in the queue which matches the filter
|
protected void |
finalize() |
boolean |
flushExecutor() |
void |
forceDelivery()
This method will make sure that any pending message (including paged message) will be delivered
|
SimpleString |
getAddress() |
int |
getConsumerCount() |
Set<Consumer> |
getConsumers() |
ReferenceCounter |
getConsumersRefCount() |
int |
getDeliveringCount() |
Map<String,List<MessageReference>> |
getDeliveringMessages()
Return a Map consisting of consumer.toString and its messages
Delivering message is a property of the consumer, this method will aggregate the results per Server's consumer object
|
Executor |
getExecutor() |
SimpleString |
getExpiryAddress() |
Filter |
getFilter() |
List<SimpleString> |
getGroupsUsed()
For testing only
|
long |
getID() |
long |
getInstantMessageCount()
Return the current message count without waiting for scheduled executors to finish
|
long |
getInstantMessagesAdded() |
long |
getMessageCount()
It will wait for up to 10 seconds for a flush on the executors and return the number of messages added.
|
long |
getMessageCount(long timeout)
This method will return the messages added after waiting some time on the flush executors.
|
long |
getMessagesAdded()
It will wait for up to 10 seconds for a flush on the executors and return the number of messages added.
|
long |
getMessagesAdded(long timeout)
This method will return the messages added after waiting some time on the flush executors.
|
SimpleString |
getName() |
int |
getNumberOfReferences()
Used on testing only *
|
PageSubscription |
getPageSubscription() |
float |
getRate() |
MessageReference |
getReference(long id1) |
SimpleString |
getRoutingName() |
int |
getScheduledCount() |
List<MessageReference> |
getScheduledMessages() |
SimpleString |
getUniqueName() |
int |
hashCode() |
boolean |
hasMatchingConsumer(ServerMessage message) |
boolean |
isDirectDeliver() |
boolean |
isDurable() |
boolean |
isExclusive() |
boolean |
isInternalQueue()
We can't send stuff to DLQ on queues used on clustered-bridge-communication
|
boolean |
isPaused() |
boolean |
isTemporary() |
LinkedListIterator<MessageReference> |
iterator() |
boolean |
moveReference(long messageID,
SimpleString toAddress) |
boolean |
moveReference(long messageID,
SimpleString toAddress,
boolean rejectDuplicate) |
int |
moveReferences(Filter filter,
SimpleString toAddress) |
int |
moveReferences(int flushLimit,
Filter filter,
SimpleString toAddress,
boolean rejectDuplicates) |
void |
pause()
Pauses the queue.
|
protected void |
postAcknowledge(MessageReference ref) |
void |
reacknowledge(Transaction tx,
MessageReference ref) |
protected void |
refAdded(MessageReference ref) |
void |
referenceHandled() |
protected void |
refRemoved(MessageReference ref) |
void |
reload(MessageReference ref) |
void |
removeConsumer(Consumer consumer) |
MessageReference |
removeReferenceWithID(long id1) |
void |
resetAllIterators() |
void |
resetMessagesAdded() |
void |
resume()
Resumes the delivery of message for the queue.
|
void |
route(ServerMessage message,
RoutingContext context) |
int |
sendMessagesToDeadLetterAddress(Filter filter) |
boolean |
sendMessageToDeadLetterAddress(long messageID) |
void |
setConsumersRefCount(HornetQServer server)
This will set a reference counter for every consumer present on the queue.
|
void |
setInternalQueue(boolean internalQueue) |
String |
toString() |
org.hornetq.core.server.impl.QueueImpl.TotalQueueIterator |
totalIterator() |
void |
unproposed(SimpleString groupID) |
public static final int REDISTRIBUTOR_BATCH_SIZE
public static final int NUM_PRIORITIES
public static final int MAX_DELIVERIES_IN_LOOP
public static final int CHECK_QUEUE_SIZE_PERIOD
public static final int DELIVERY_TIMEOUT
public static final int DEFAULT_FLUSH_LIMIT
protected final AtomicInteger deliveringCount
public QueueImpl(long id, SimpleString address, SimpleString name, Filter filter, boolean durable, boolean temporary, ScheduledExecutorService scheduledExecutor, PostOffice postOffice, StorageManager storageManager, HierarchicalRepository<AddressSettings> addressSettingsRepository, Executor executor)
public QueueImpl(long id, SimpleString address, SimpleString name, Filter filter, PageSubscription pageSubscription, boolean durable, boolean temporary, ScheduledExecutorService scheduledExecutor, PostOffice postOffice, StorageManager storageManager, HierarchicalRepository<AddressSettings> addressSettingsRepository, Executor executor)
public List<SimpleString> getGroupsUsed()
public String debug()
public SimpleString getRoutingName()
public SimpleString getUniqueName()
public boolean isExclusive()
public void route(ServerMessage message, RoutingContext context) throws Exception
public void setConsumersRefCount(HornetQServer server)
Queue
setConsumersRefCount
in interface Queue
public ReferenceCounter getConsumersRefCount()
getConsumersRefCount
in interface Queue
public boolean isTemporary()
isTemporary
in interface Queue
public SimpleString getName()
public SimpleString getAddress()
getAddress
in interface Queue
public PageSubscription getPageSubscription()
getPageSubscription
in interface Queue
public void unproposed(SimpleString groupID)
unproposed
in interface Queue
public void addHead(MessageReference ref)
public void addHead(List<MessageReference> refs)
public void reload(MessageReference ref)
public void addTail(MessageReference ref)
public void addTail(MessageReference ref, boolean direct)
public void forceDelivery()
Queue
forceDelivery
in interface Queue
public void deliverAsync()
deliverAsync
in interface Queue
public Executor getExecutor()
getExecutor
in interface Queue
public void deliverNow()
public boolean flushExecutor()
flushExecutor
in interface Queue
public void addConsumer(Consumer consumer) throws Exception
addConsumer
in interface Queue
Exception
public void removeConsumer(Consumer consumer)
removeConsumer
in interface Queue
public void addRedistributor(long delay)
addRedistributor
in interface Queue
public void cancelRedistributor() throws Exception
cancelRedistributor
in interface Queue
Exception
protected void finalize() throws Throwable
public int getConsumerCount()
getConsumerCount
in interface Queue
public Set<Consumer> getConsumers()
getConsumers
in interface Queue
public boolean hasMatchingConsumer(ServerMessage message)
hasMatchingConsumer
in interface Queue
public LinkedListIterator<MessageReference> iterator()
public org.hornetq.core.server.impl.QueueImpl.TotalQueueIterator totalIterator()
totalIterator
in interface Queue
public MessageReference removeReferenceWithID(long id1) throws Exception
removeReferenceWithID
in interface Queue
Exception
public MessageReference getReference(long id1)
getReference
in interface Queue
public long getMessageCount()
Queue
getMessageCount
in interface Queue
public long getMessageCount(long timeout)
Queue
getMessageCount
in interface Queue
timeout
- Time to wait for current executors to finish in milliseconds.public long getInstantMessageCount()
Queue
getInstantMessageCount
in interface Queue
public int getScheduledCount()
getScheduledCount
in interface Queue
public List<MessageReference> getScheduledMessages()
getScheduledMessages
in interface Queue
public Map<String,List<MessageReference>> getDeliveringMessages()
Queue
getDeliveringMessages
in interface Queue
public int getDeliveringCount()
getDeliveringCount
in interface Queue
public void acknowledge(MessageReference ref) throws Exception
acknowledge
in interface Queue
Exception
public void acknowledge(Transaction tx, MessageReference ref) throws Exception
acknowledge
in interface Queue
Exception
public void reacknowledge(Transaction tx, MessageReference ref) throws Exception
reacknowledge
in interface Queue
Exception
public void cancel(Transaction tx, MessageReference reference)
public void cancel(Transaction tx, MessageReference reference, boolean ignoreRedeliveryCheck)
public void cancel(MessageReference reference, long timeBase) throws Exception
public void expire(MessageReference ref) throws Exception
public SimpleString getExpiryAddress()
getExpiryAddress
in interface Queue
public void referenceHandled()
referenceHandled
in interface Queue
public long getMessagesAdded()
Queue
getMessagesAdded
in interface Queue
public long getMessagesAdded(long timeout)
Queue
getMessagesAdded
in interface Queue
timeout
- Time to wait for current executors to finish in milliseconds.public long getInstantMessagesAdded()
getInstantMessagesAdded
in interface Queue
public int deleteAllReferences() throws Exception
deleteAllReferences
in interface Queue
Exception
public int deleteAllReferences(int flushLimit) throws Exception
deleteAllReferences
in interface Queue
Exception
public int deleteMatchingReferences(Filter filter) throws Exception
deleteMatchingReferences
in interface Queue
Exception
public int deleteMatchingReferences(int flushLimit, Filter filter1) throws Exception
deleteMatchingReferences
in interface Queue
Exception
public void destroyPaging() throws Exception
destroyPaging
in interface Queue
Exception
public boolean deleteReference(long messageID) throws Exception
deleteReference
in interface Queue
Exception
public void deleteQueue() throws Exception
deleteQueue
in interface Queue
Exception
public void deleteQueue(boolean removeConsumers) throws Exception
deleteQueue
in interface Queue
Exception
public boolean expireReference(long messageID) throws Exception
expireReference
in interface Queue
Exception
public int expireReferences(Filter filter) throws Exception
Queue
expireReferences
in interface Queue
Exception
public void expireReferences()
expireReferences
in interface Queue
public boolean sendMessageToDeadLetterAddress(long messageID) throws Exception
sendMessageToDeadLetterAddress
in interface Queue
Exception
public int sendMessagesToDeadLetterAddress(Filter filter) throws Exception
sendMessagesToDeadLetterAddress
in interface Queue
Exception
public boolean moveReference(long messageID, SimpleString toAddress) throws Exception
moveReference
in interface Queue
Exception
public boolean moveReference(long messageID, SimpleString toAddress, boolean rejectDuplicate) throws Exception
moveReference
in interface Queue
Exception
public int moveReferences(Filter filter, SimpleString toAddress) throws Exception
moveReferences
in interface Queue
Exception
public int moveReferences(int flushLimit, Filter filter, SimpleString toAddress, boolean rejectDuplicates) throws Exception
moveReferences
in interface Queue
Exception
public boolean changeReferencePriority(long messageID, byte newPriority) throws Exception
changeReferencePriority
in interface Queue
Exception
public int changeReferencesPriority(Filter filter, byte newPriority) throws Exception
changeReferencesPriority
in interface Queue
Exception
public void resetAllIterators()
resetAllIterators
in interface Queue
public void pause()
Queue
public void resume()
Queue
public boolean isPaused()
public boolean isDirectDeliver()
isDirectDeliver
in interface Queue
public boolean isInternalQueue()
Queue
isInternalQueue
in interface Queue
public void setInternalQueue(boolean internalQueue)
setInternalQueue
in interface Queue
internalQueue
- the internalQueue to setprotected void refRemoved(MessageReference ref)
ref
- protected void refAdded(MessageReference ref)
ref
- public boolean checkRedelivery(MessageReference reference, long timeBase, boolean ignoreRedeliveryDelay) throws Exception
checkRedelivery
in interface Queue
Exception
public int getNumberOfReferences()
protected void postAcknowledge(MessageReference ref)
public void resetMessagesAdded()
resetMessagesAdded
in interface Queue
Copyright © 2017 JBoss, a division of Red Hat. All Rights Reserved.