Postoffice

聊聊artemis的DelayedAddRedistributor

允我心安 提交于 2020-02-26 02:51:55
序 本文主要研究一下artemis的DelayedAddRedistributor addRedistributor activemq-artemis-2.11.0/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java public class QueueImpl extends CriticalComponentImpl implements Queue { //...... public synchronized void addRedistributor(final long delay) { clearRedistributorFuture(); if (redistributor != null) { // Just prompt delivery deliverAsync(); } if (delay > 0) { if (consumers.isEmpty()) { DelayedAddRedistributor dar = new DelayedAddRedistributor(executor); redistributorFuture = scheduledExecutor.schedule(dar, delay, TimeUnit

聊聊artemis的ExpiryScanner

不问归期 提交于 2020-02-25 18:52:20
序 本文主要研究一下artemis的ExpiryScanner startExpiryScanner activemq-artemis-2.11.0/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java public class PostOfficeImpl implements PostOffice, NotificationListener, BindingsFactory { //...... private ExpiryReaper expiryReaperRunnable; //...... public synchronized void startExpiryScanner() { if (expiryReaperPeriod > 0) { if (expiryReaperRunnable != null) expiryReaperRunnable.stop(); expiryReaperRunnable = new ExpiryReaper(server.getScheduledPool(), server.getExecutorFactory().getExecutor(), expiryReaperPeriod,