use of org.apache.activemq.artemis.core.server.cluster.impl.Redistributor in project activemq-artemis by apache.
the class QueueImpl method cancelRedistributor.
@Override
public synchronized void cancelRedistributor() throws Exception {
if (redistributor != null) {
redistributor.stop();
Redistributor redistributorToRemove = redistributor;
redistributor = null;
removeConsumer(redistributorToRemove);
}
clearRedistributorFuture();
}
use of org.apache.activemq.artemis.core.server.cluster.impl.Redistributor in project activemq-artemis by apache.
the class QueueImpl method internalAddRedistributor.
private void internalAddRedistributor(final ArtemisExecutor executor) {
// create the redistributor only once if there are no local consumers
if (consumerSet.isEmpty() && redistributor == null) {
if (logger.isTraceEnabled()) {
logger.trace("QueueImpl::Adding redistributor on queue " + this.toString());
}
redistributor = new Redistributor(this, storageManager, postOffice, executor, QueueImpl.REDISTRIBUTOR_BATCH_SIZE);
consumerList.add(new ConsumerHolder(redistributor));
consumersChanged = true;
redistributor.start();
deliverAsync();
}
}
use of org.apache.activemq.artemis.core.server.cluster.impl.Redistributor in project activemq-artemis by apache.
the class QueueImpl method hasMatchingConsumer.
@Override
public boolean hasMatchingConsumer(final Message message) {
for (ConsumerHolder holder : consumerList) {
Consumer consumer = holder.consumer;
if (consumer instanceof Redistributor) {
continue;
}
Filter filter1 = consumer.getFilter();
if (filter1 == null) {
return true;
} else {
if (filter1.match(message)) {
return true;
}
}
}
return false;
}
Aggregations