Apache Artemis

使用apache-artemis搭建MQTT服务器

喜欢而已 提交于 2020-02-29 04:26:34
apache-artemis 搭建MQTT服务,windows下和Linux下操作方式基本一致 1、下载二进制包: 官网地址 https://activemq.apache.org/components/artemis/download/ linux 下载后缀为 .tar.gz 的包,windows 下请下载 .zip 后缀的包 $ wget https://mirrors.tuna.tsinghua.edu.cn/apache/activemq/activemq-artemis/2.7.0/apache-artemis-2.7.0-bin.tar.gz 2.解压 $ sudo tar -xzf apache-artemis-2.7.0-bin.tar.gz /opt/ 3.创建 broker 并启动服务 到这里就可以参照说明文档(apache-artemis-2.7.0/README.html)进行配置了 下面以Linux下为例来说明: $ sudo cd /opt/apache-artemis-2.7.0/bin/ $ sudo ./artemis create mybroker # 接下来会进入交互配置,按照提示输入默认用户名、密码、是否允许匿名登录 # 创建完成后可以按照提示启动服务 $ sudo /opt/apache-artemis-2.7.0/bin/mybroker

聊聊artemis的maxDeliveryAttempts

只愿长相守 提交于 2020-02-28 09:36:29
序 本文主要研究一下artemis的maxDeliveryAttempts maxDeliveryAttempts activemq-artemis-2.11.0/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java public class AddressSettings implements Mergeable<AddressSettings>, Serializable, EncodingSupport { //...... public static final int DEFAULT_MAX_DELIVERY_ATTEMPTS = 10; private Integer maxDeliveryAttempts = null; private SimpleString deadLetterAddress = null; //...... public int getMaxDeliveryAttempts() { return maxDeliveryAttempts != null ? maxDeliveryAttempts : AddressSettings.DEFAULT_MAX_DELIVERY_ATTEMPTS; } public

聊聊artemis的reconnectAttempts

落花浮王杯 提交于 2020-02-28 04:17:18
序 本文主要研究一下artemis的reconnectAttempts reconnectAttempts 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 { //...... public ClientSessionFactory createSessionFactory(final TransportConfiguration transportConfiguration, int reconnectAttempts) throws Exception { assertOpen(); initialize(); ClientSessionFactoryInternal factory = new ClientSessionFactoryImpl(this, transportConfiguration, callTimeout, callFailoverTimeout,

聊聊artemis的ResourceLimitSettings

最后都变了- 提交于 2020-02-27 23:08:27
序 本文主要研究一下artemis的ResourceLimitSettings ResourceLimitSettings activemq-artemis-2.11.0/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/ResourceLimitSettings.java public class ResourceLimitSettings implements Serializable, EncodingSupport { private static final long serialVersionUID = -110638321333856932L; public static final SimpleString DEFAULT_MATCH = null; public static final Integer DEFAULT_MAX_CONNECTIONS = -1; public static final Integer DEFAULT_MAX_QUEUES = -1; SimpleString match = null; Integer maxConnections = null; Integer maxQueues = null; //...... }

聊聊artemis message的priority

China☆狼群 提交于 2020-02-27 20:38:31
序 本文主要研究一下artemis message的priority priority activemq-artemis-2.11.0/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java public class CoreMessage extends RefCountMessage implements ICoreMessage { //...... protected byte priority; public byte getPriority() { return priority; } public CoreMessage setPriority(byte priority) { this.priority = priority; messageChanged(); return this; } //...... } CoreMessage定义了priority属性( Values range from 0 (less priority) to 9 (more priority) inclusive ),并提供了getPriority、setPriority方法 messageReferences.add activemq

聊聊artemis JMSBridge的QualityOfServiceMode

自古美人都是妖i 提交于 2020-02-27 16:14:39
序 本文主要研究一下artemis JMSBridge的QualityOfServiceMode QualityOfServiceMode activemq-artemis-2.11.0/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/bridge/QualityOfServiceMode.java public enum QualityOfServiceMode { AT_MOST_ONCE(0), DUPLICATES_OK(1), ONCE_AND_ONLY_ONCE(2); private final int value; QualityOfServiceMode(final int value) { this.value = value; } public int intValue() { return value; } public static QualityOfServiceMode valueOf(final int value) { if (value == AT_MOST_ONCE.value) { return AT_MOST_ONCE; } if (value == DUPLICATES_OK.value) { return DUPLICATES_OK; } if

聊聊artemis的lastValueProperty

懵懂的女人 提交于 2020-02-27 14:30:11
序 本文主要研究一下artemis的lastValueProperty CoreMessage activemq-artemis-2.11.0/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java public class CoreMessage extends RefCountMessage implements ICoreMessage { //...... public SimpleString getLastValueProperty() { return getSimpleStringProperty(Message.HDR_LAST_VALUE_NAME); } @Override public Message setLastValueProperty(SimpleString lastValueName) { return putStringProperty(Message.HDR_LAST_VALUE_NAME, lastValueName); } //...... } CoreMessage提供了getLastValueProperty、setLastValueProperty方法,设置的是message的Message

聊聊artemis的callFailoverTimeout

若如初见. 提交于 2020-02-27 14:08:26
序 本文主要研究一下artemis的callFailoverTimeout establishNewConnection activemq-artemis-2.11.0/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, ClientConnectionLifeCycleListener { //...... protected RemotingConnection establishNewConnection() { Connection transportConnection = createTransportConnection(); if (transportConnection == null) { if (ClientSessionFactoryImpl.logger.isTraceEnabled()) { logger.trace("Neither backup or live were active, will just give up now")

聊聊artemis的NetworkHealthCheck

帅比萌擦擦* 提交于 2020-02-27 13:24:16
序 本文主要研究一下artemis的NetworkHealthCheck NetworkHealthCheck activemq-artemis-2.11.0/artemis-commons/src/main/java/org/apache/activemq/artemis/core/server/NetworkHealthCheck.java public class NetworkHealthCheck extends ActiveMQScheduledComponent { private static final Logger logger = Logger.getLogger(NetworkHealthCheck.class); private final Set<ActiveMQComponent> componentList = new ConcurrentHashSet<>(); private final Set<InetAddress> addresses = new ConcurrentHashSet<>(); private final Set<URL> urls = new ConcurrentHashSet<>(); private NetworkInterface networkInterface; public static final String

聊聊artemis的persistenceEnabled

夙愿已清 提交于 2020-02-27 12:21:30
序 本文主要研究一下artemis的persistenceEnabled persistenceEnabled 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 persistenceEnabled = ActiveMQDefaultConfiguration.isDefaultPersistenceEnabled(); public boolean isPersistenceEnabled() { return persistenceEnabled; } public ConfigurationImpl setPersistenceEnabled(final boolean enable) { persistenceEnabled = enable; return this; } //...... } ConfigurationImpl定义了persistenceEnabled属性