Apache Artemis

聊聊artemis的MessageLoadBalancingType

扶醉桌前 提交于 2020-02-27 04:06:10
序 本文主要研究一下artemis的MessageLoadBalancingType MessageLoadBalancingType activemq-artemis-2.11.0/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/MessageLoadBalancingType.java public enum MessageLoadBalancingType { OFF("OFF"), STRICT("STRICT"), ON_DEMAND("ON_DEMAND"); static { // for URI support on ClusterConnection BeanSupport.registerConverter(new MessageLoadBalancingTypeConverter(), MessageLoadBalancingType.class); } static class MessageLoadBalancingTypeConverter implements Converter { @Override public <T> T convert(Class<T> type, Object value) { return type.cast

聊聊artemis的HAManager

狂风中的少年 提交于 2020-02-27 03:24:59
序 本文主要研究一下artemis的HAManager HAManager activemq-artemis-2.11.0/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/HAManager.java public interface HAManager extends ActiveMQComponent { /** * return the current backup servers * * @return the backups */ Map<String, ActiveMQServer> getBackupServers(); } HAManager继承了ActiveMQComponent接口,它定义了getBackupServers方法 StandaloneHAManager activemq-artemis-2.11.0/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/StandaloneHAManager.java public class StandaloneHAManager implements HAManager { Map<String,

聊聊artemis的gracefulShutdownEnabled

ぐ巨炮叔叔 提交于 2020-02-27 02:33:19
序 本文主要研究一下artemis的gracefulShutdownEnabled gracefulShutdownEnabled activemq-artemis-2.11.0/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImpl.java public class ConfigurationImpl implements Configuration, Serializable { //...... private boolean gracefulShutdownEnabled = ActiveMQDefaultConfiguration.isDefaultGracefulShutdownEnabled(); private long gracefulShutdownTimeout = ActiveMQDefaultConfiguration.getDefaultGracefulShutdownTimeout(); //...... @Override public boolean isGracefulShutdownEnabled() { return gracefulShutdownEnabled; } @Override public

聊聊artemis的CriticalAnalyzerPolicy

落花浮王杯 提交于 2020-02-26 15:45:24
序 本文主要研究一下artemis的CriticalAnalyzerPolicy CriticalAnalyzerPolicy activemq-artemis-2.11.0/artemis-commons/src/main/java/org/apache/activemq/artemis/utils/critical/CriticalAnalyzerPolicy.java public enum CriticalAnalyzerPolicy { HALT, SHUTDOWN, LOG; static { // for URI support on ClusterConnection BeanSupport.registerConverter(new CriticalAnalyzerPolicyConverter(), CriticalAnalyzerPolicy.class); } static class CriticalAnalyzerPolicyConverter implements Converter { @Override public <T> T convert(Class<T> type, Object value) { return type.cast(CriticalAnalyzerPolicy.valueOf(value.toString())); } }

聊聊artemis消息的推拉模式

风流意气都作罢 提交于 2020-02-26 11:52:21
序 本文主要研究一下artemis消息的推拉模式 拉模式 receive activemq-artemis-2.11.0/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQMessageConsumer.java public final class ActiveMQMessageConsumer implements QueueReceiver, TopicSubscriber { //...... @Override public Message receive() throws JMSException { return getMessage(0, false); } @Override public Message receive(final long timeout) throws JMSException { return getMessage(timeout, false); } @Override public Message receiveNoWait() throws JMSException { return getMessage(0, true); } private ActiveMQMessage getMessage(final long

聊聊artemis的ConnectionLoadBalancingPolicy

拈花ヽ惹草 提交于 2020-02-26 11:48:29
序 本文主要研究一下artemis的ConnectionLoadBalancingPolicy ServerLocatorImpl.selectConnector activemq-artemis-2.11.0/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorImpl.java public final class ServerLocatorImpl implements ServerLocatorInternal, DiscoveryListener { //...... private TransportConfiguration selectConnector() { Pair<TransportConfiguration, TransportConfiguration>[] usedTopology; flushTopology(); synchronized (topologyArrayGuard) { usedTopology = topologyArray; } synchronized (this) { if (usedTopology != null && useTopologyForLoadBalancing) { if

聊聊artemis message的duplicateProperty

孤人 提交于 2020-02-26 11:45:04
序 本文主要研究一下artemis的duplicateProperty Message activemq-artemis-2.11.0/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java public interface Message { //...... default Object getDuplicateProperty() { return null; } default byte[] getDuplicateIDBytes() { Object duplicateID = getDuplicateProperty(); if (duplicateID == null) { return null; } else { if (duplicateID instanceof SimpleString) { return ((SimpleString) duplicateID).getData(); } else if (duplicateID instanceof String) { return new SimpleString(duplicateID.toString()).getData(); } else { return (byte[])

聊聊artemis的FederatedQueue

倖福魔咒の 提交于 2020-02-26 11:40:27
序 本文主要研究一下artemis的FederatedQueue FederatedQueue activemq-artemis-2.11.0/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/federation/queue/FederatedQueue.java public class FederatedQueue extends FederatedAbstract implements ActiveMQServerConsumerPlugin, Serializable { private static final Logger logger = Logger.getLogger(FederatedQueue.class); private final Set<Matcher> includes; private final Set<Matcher> excludes; private final Filter metaDataFilter; private final int priorityAdjustment; private final FederationQueuePolicyConfiguration config; public FederatedQueue

聊聊artemis的ServerConnectionLifeCycleListener

Deadly 提交于 2020-02-26 06:33:53
序 本文主要研究一下artemis的ServerConnectionLifeCycleListener BaseConnectionLifeCycleListener activemq-artemis-2.11.0/artemis-core-client/src/main/java/org/apache/activemq/artemis/spi/core/remoting/BaseConnectionLifeCycleListener.java public interface BaseConnectionLifeCycleListener<ProtocolClass> { void connectionCreated(ActiveMQComponent component, Connection connection, ProtocolClass protocol); void connectionDestroyed(Object connectionID); void connectionException(Object connectionID, ActiveMQException me); void connectionReadyForWrites(Object connectionID, boolean ready); }

聊聊artemis的confirmationWindowEnabled

两盒软妹~` 提交于 2020-02-26 05:44:49
序 本文主要研究一下artemis的confirmationWindowEnabled confirmationWindowEnabled activemq-artemis-2.11.0/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerImpl.java public class ClientProducerImpl implements ClientProducerInternal { //...... public void send(SimpleString address1, Message message, SendAcknowledgementHandler handler) throws ActiveMQException { checkClosed(); boolean confirmationWindowEnabled = session.isConfirmationWindowEnabled(); if (confirmationWindowEnabled) { doSend(address1, message, handler); } else { doSend(address1, message, null); if