├── .asf.yaml
├── .gitignore
├── .travis.yml
├── LICENSE
├── NOTICE
├── README.md
├── distribution
├── bin
│ ├── meta.sh
│ ├── mqtt.sh
│ └── runserver.sh
├── conf
│ ├── connect.conf
│ ├── logback.xml
│ ├── meta.conf
│ ├── meta_spring.xml
│ ├── service.conf
│ └── spring.xml
├── pom.xml
└── release.xml
├── mqtt-common
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── org
│ │ │ └── apache
│ │ │ └── rocketmq
│ │ │ └── mqtt
│ │ │ └── common
│ │ │ ├── facade
│ │ │ ├── AuthManager.java
│ │ │ ├── LmqOffsetStore.java
│ │ │ ├── LmqQueueStore.java
│ │ │ ├── MetaPersistManager.java
│ │ │ ├── RetainedPersistManager.java
│ │ │ ├── SubscriptionPersistManager.java
│ │ │ ├── WillMsgPersistManager.java
│ │ │ └── WillMsgSender.java
│ │ │ ├── hook
│ │ │ ├── AbstractUpstreamHook.java
│ │ │ ├── Hook.java
│ │ │ ├── HookResult.java
│ │ │ ├── UpstreamHook.java
│ │ │ ├── UpstreamHookEnum.java
│ │ │ └── UpstreamHookManager.java
│ │ │ ├── meta
│ │ │ ├── IpUtil.java
│ │ │ ├── MetaConstants.java
│ │ │ └── RaftUtil.java
│ │ │ ├── model
│ │ │ ├── Constants.java
│ │ │ ├── Message.java
│ │ │ ├── MessageEvent.java
│ │ │ ├── MqttMessageUpContext.java
│ │ │ ├── MqttTopic.java
│ │ │ ├── PullResult.java
│ │ │ ├── Queue.java
│ │ │ ├── QueueOffset.java
│ │ │ ├── Remark.java
│ │ │ ├── RpcCode.java
│ │ │ ├── RpcHeader.java
│ │ │ ├── StoreResult.java
│ │ │ ├── Subscription.java
│ │ │ ├── Trie.java
│ │ │ ├── TrieException.java
│ │ │ ├── TrieMethod.java
│ │ │ └── WillMessage.java
│ │ │ └── util
│ │ │ ├── HmacSHA1Util.java
│ │ │ ├── HostInfo.java
│ │ │ ├── MessageUtil.java
│ │ │ ├── NamespaceUtil.java
│ │ │ ├── SpringUtils.java
│ │ │ ├── StatUtil.java
│ │ │ └── TopicUtils.java
│ └── proto
│ │ └── request.proto
│ └── test
│ └── java
│ └── org
│ └── apache
│ └── rocketmq
│ └── mqtt
│ └── common
│ └── test
│ ├── hook
│ ├── TestAbstractUpstreamHook.java
│ └── TestHookResult.java
│ ├── model
│ ├── TestMessage.java
│ ├── TestQueueOffset.java
│ ├── TestSubscription.java
│ └── TestTrie.java
│ └── util
│ ├── TestHmacSHA1Util.java
│ ├── TestHostInfo.java
│ ├── TestMessageUtil.java
│ ├── TestNamespaceUtil.java
│ ├── TestStatUtil.java
│ └── TestTopicUtils.java
├── mqtt-cs
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── org
│ │ └── apache
│ │ └── rocketmq
│ │ └── mqtt
│ │ └── cs
│ │ ├── channel
│ │ ├── AdaptiveTlsHandler.java
│ │ ├── ChannelCloseFrom.java
│ │ ├── ChannelDecodeException.java
│ │ ├── ChannelException.java
│ │ ├── ChannelInfo.java
│ │ ├── ChannelManager.java
│ │ ├── ConnectHandler.java
│ │ └── DefaultChannelManager.java
│ │ ├── config
│ │ ├── ConnectConf.java
│ │ ├── ConnectConfListener.java
│ │ └── WillLoopConf.java
│ │ ├── hook
│ │ └── UpstreamHookManagerImpl.java
│ │ ├── protocol
│ │ ├── mqtt
│ │ │ ├── MqttPacketDispatcher.java
│ │ │ ├── MqttPacketHandler.java
│ │ │ ├── facotry
│ │ │ │ └── MqttMessageFactory.java
│ │ │ └── handler
│ │ │ │ ├── MqttConnectHandler.java
│ │ │ │ ├── MqttDisconnectHandler.java
│ │ │ │ ├── MqttPingHandler.java
│ │ │ │ ├── MqttPubAckHandler.java
│ │ │ │ ├── MqttPubCompHandler.java
│ │ │ │ ├── MqttPubRecHandler.java
│ │ │ │ ├── MqttPubRelHandler.java
│ │ │ │ ├── MqttPublishHandler.java
│ │ │ │ ├── MqttSubscribeHandler.java
│ │ │ │ └── MqttUnSubscribeHandler.java
│ │ ├── rpc
│ │ │ └── RpcPacketDispatcher.java
│ │ ├── ssl
│ │ │ └── SslFactory.java
│ │ └── ws
│ │ │ ├── WebSocketEncoder.java
│ │ │ └── WebSocketServerHandler.java
│ │ ├── session
│ │ ├── QueueFresh.java
│ │ ├── Session.java
│ │ ├── infly
│ │ │ ├── InFlyCache.java
│ │ │ ├── MqttMsgId.java
│ │ │ ├── PushAction.java
│ │ │ └── RetryDriver.java
│ │ ├── loop
│ │ │ ├── PullResultStatus.java
│ │ │ ├── QueueCache.java
│ │ │ ├── SessionLoop.java
│ │ │ ├── SessionLoopImpl.java
│ │ │ └── WillLoop.java
│ │ ├── match
│ │ │ └── MatchAction.java
│ │ └── notify
│ │ │ └── MessageNotifyAction.java
│ │ └── starter
│ │ ├── ExporterServer.java
│ │ ├── MqttServer.java
│ │ ├── RpcServer.java
│ │ └── Startup.java
│ └── test
│ └── java
│ └── org
│ └── apache
│ └── rocketmq
│ └── mqtt
│ └── cs
│ └── test
│ ├── channel
│ ├── TestChannelInfo.java
│ ├── TestConnectHandler.java
│ └── TestDefaultChannelManager.java
│ ├── config
│ └── TestConnectConfListener.java
│ ├── hook
│ └── TestUpstreamHookManagerImpl.java
│ ├── protocol
│ ├── mqtt
│ │ ├── TestMqttPacketDispatcher.java
│ │ └── handler
│ │ │ ├── TestMqttConnectHandler.java
│ │ │ ├── TestMqttDisconnectHandler.java
│ │ │ ├── TestMqttPingHandler.java
│ │ │ ├── TestMqttPubAckHandler.java
│ │ │ ├── TestMqttPubCompHandler.java
│ │ │ ├── TestMqttPubRecHandler.java
│ │ │ ├── TestMqttPubRelHandler.java
│ │ │ ├── TestMqttPublishHandler.java
│ │ │ ├── TestMqttSubscribeHandler.java
│ │ │ └── TestMqttUnSubscribeHandler.java
│ ├── rpc
│ │ └── TestRpcPacketDispatcher.java
│ └── ws
│ │ ├── TestWebSocketEncoder.java
│ │ └── TestWebSocketServerHandler.java
│ └── session
│ ├── TestQueueFresh.java
│ ├── TestSession.java
│ ├── infly
│ ├── TestInFlyCache.java
│ ├── TestMqttMsgId.java
│ ├── TestPushAction.java
│ └── TestRetryDriver.java
│ ├── loop
│ ├── TestQueueCache.java
│ └── TestSessionLoopImpl.java
│ ├── match
│ └── TestMatchAction.java
│ └── notify
│ └── TestMessageNotifyAction.java
├── mqtt-ds
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── org
│ │ └── apache
│ │ └── rocketmq
│ │ └── mqtt
│ │ └── ds
│ │ ├── auth
│ │ └── AuthManagerSample.java
│ │ ├── config
│ │ ├── ServiceConf.java
│ │ └── ServiceConfListener.java
│ │ ├── meta
│ │ ├── FirstTopicManager.java
│ │ ├── MetaPersistManagerSample.java
│ │ ├── MetaRpcClient.java
│ │ ├── RetainedMsgClient.java
│ │ ├── RetainedPersistManagerImpl.java
│ │ ├── TopicNotExistException.java
│ │ ├── WildcardManager.java
│ │ ├── WillMsgClient.java
│ │ └── WillMsgPersistManagerImpl.java
│ │ ├── mq
│ │ ├── MqAdmin.java
│ │ ├── MqConsumer.java
│ │ ├── MqFactory.java
│ │ ├── MqProducer.java
│ │ └── MqPullConsumer.java
│ │ ├── notify
│ │ ├── NotifyManager.java
│ │ └── NotifyRetryManager.java
│ │ ├── store
│ │ ├── LmqOffsetStoreManager.java
│ │ └── LmqQueueStoreManager.java
│ │ └── upstream
│ │ ├── UpstreamProcessor.java
│ │ ├── UpstreamProcessorManager.java
│ │ └── processor
│ │ ├── BaseProcessor.java
│ │ ├── ConnectProcessor.java
│ │ ├── DisconnectProcessor.java
│ │ ├── PublishProcessor.java
│ │ ├── SubscribeProcessor.java
│ │ └── UnSubscribeProcessor.java
│ └── test
│ └── java
│ └── org
│ └── apache
│ └── rocketmq
│ └── mqtt
│ └── ds
│ └── test
│ ├── auth
│ └── TestAuthManagerSample.java
│ ├── config
│ └── TestServiceConfListener.java
│ ├── meta
│ ├── TestFirstTopicManager.java
│ ├── TestMetaPersistManagerSample.java
│ ├── TestWildcardManager.java
│ └── WillMsgPersistManagerImplTest.java
│ ├── mq
│ └── TestMqFactory.java
│ ├── notify
│ ├── TestNotifyManager.java
│ └── TestNotifyRetryManager.java
│ ├── store
│ ├── TestLmqOffsetStoreManager.java
│ └── TestLmqQueueStoreManager.java
│ └── upstream
│ ├── TestUpstreamProcessorManager.java
│ └── processor
│ ├── TestPublishProcessor.java
│ ├── TestSubscribeProcessor.java
│ └── TestUnSubscribeProcessor.java
├── mqtt-example
├── pom.xml
└── src
│ └── main
│ └── java
│ └── org
│ └── apache
│ └── rocketmq
│ └── mqtt
│ └── example
│ ├── MqttConsumer.java
│ ├── MqttProducer.java
│ ├── MqttWillRetainConsumer.java
│ ├── MqttWillRetainProducer.java
│ ├── RocketMQConsumer.java
│ └── RocketMQProducer.java
├── mqtt-exporter
├── pom.xml
└── src
│ └── main
│ └── java
│ └── org
│ └── apache
│ └── rocketmq
│ └── mqtt
│ └── exporter
│ ├── MqttExporter.java
│ ├── collector
│ ├── MetricsBuilderFactory.java
│ ├── MqttMetricsCollector.java
│ ├── MqttMetricsInfo.java
│ └── SubSystem.java
│ ├── exception
│ └── PrometheusException.java
│ └── http
│ ├── BackedFileOutputStream.java
│ └── MqttHTTPServer.java
├── mqtt-meta
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── org
│ │ └── apache
│ │ └── rocketmq
│ │ └── mqtt
│ │ └── meta
│ │ ├── config
│ │ ├── MetaConf.java
│ │ └── MetaConfListener.java
│ │ ├── raft
│ │ ├── FailoverClosure.java
│ │ ├── MqttApplyListener.java
│ │ ├── MqttClosure.java
│ │ ├── MqttRaftServer.java
│ │ ├── MqttStateMachine.java
│ │ ├── processor
│ │ │ ├── HashKvStateProcessor.java
│ │ │ ├── RetainedMsgStateProcessor.java
│ │ │ ├── StateProcessor.java
│ │ │ └── WillMsgStateProcessor.java
│ │ └── rpc
│ │ │ ├── AbstractRpcProcessor.java
│ │ │ ├── MqttReadRpcProcessor.java
│ │ │ └── MqttWriteRpcProcessor.java
│ │ ├── rocksdb
│ │ ├── RocksDBEngine.java
│ │ └── RocksDBSnapshot.java
│ │ ├── starter
│ │ └── MetaStartup.java
│ │ └── util
│ │ ├── DiskUtils.java
│ │ └── SpringUtil.java
│ └── test
│ └── java
│ └── org
│ └── apache
│ └── rocketmq
│ └── mqtt
│ └── meta
│ ├── raft
│ ├── RetainedMsgClientTest.java
│ └── WillMsgStateProcessorTest.java
│ └── util
│ └── IpUtilTest.java
├── pom.xml
└── style
├── copyright
├── Apache.xml
└── profiles_settings.xml
├── rmq_checkstyle.xml
└── rmq_codeStyle.xml
/.asf.yaml:
--------------------------------------------------------------------------------
1 | github:
2 | features:
3 | # Enable issue management
4 | issues: true
5 | # Enable wiki
6 | wiki: true
7 |
8 | protected_branches:
9 | notifications:
10 | commits: commits@rocketmq.apache.org
11 | issues: commits@rocketmq.apache.org
12 | pullrequests: commits@rocketmq.apache.org
13 | jobs: commits@rocketmq.apache.org
14 | discussions: dev@rocketmq.apache.org
15 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | *.iml
3 | target/
4 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | dist: trusty
2 |
3 | language: java
4 |
5 | matrix:
6 | include:
7 | # On OSX, run with default JDK only.
8 | # - os: osx
9 | # On Linux, run with specific JDKs only.
10 | - os: linux
11 | env: CUSTOM_JDK="oraclejdk8"
12 |
13 | before_install:
14 | - echo 'MAVEN_OPTS="$MAVEN_OPTS -Xmx1024m -XX:MaxPermSize=512m -XX:+BytecodeVerificationLocal"' >> ~/.mavenrc
15 | - cat ~/.mavenrc
16 | - if [ "$TRAVIS_OS_NAME" == "osx" ]; then export JAVA_HOME=$(/usr/libexec/java_home); fi
17 | - if [ "$TRAVIS_OS_NAME" == "linux" ]; then jdk_switcher use "$CUSTOM_JDK"; fi
18 |
19 | script:
20 | - travis_retry mvn -B clean apache-rat:check
21 | - travis_retry mvn -B clean install cobertura:cobertura
22 | after_success:
23 | - bash <(curl -s https://codecov.io/bash) || echo 'Codecov failed to upload'
24 |
--------------------------------------------------------------------------------
/NOTICE:
--------------------------------------------------------------------------------
1 | Apache RocketMQ
2 | Copyright 2016-2022 The Apache Software Foundation
3 |
4 | This product includes software developed at
5 | The Apache Software Foundation (http://www.apache.org/).
6 |
--------------------------------------------------------------------------------
/distribution/bin/meta.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #
4 | # /*
5 | # * Licensed to the Apache Software Foundation (ASF) under one or more
6 | # * contributor license agreements. See the NOTICE file distributed with
7 | # * this work for additional information regarding copyright ownership.
8 | # * The ASF licenses this file to You under the Apache License, Version 2.0
9 | # * (the "License"); you may not use this file except in compliance with
10 | # * the License. You may obtain a copy of the License at
11 | # *
12 | # * http://www.apache.org/licenses/LICENSE-2.0
13 | # *
14 | # * Unless required by applicable law or agreed to in writing, software
15 | # * distributed under the License is distributed on an "AS IS" BASIS,
16 | # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # * See the License for the specific language governing permissions and
18 | # * limitations under the License.
19 | # */
20 | #
21 |
22 | if [ -z "$ROCKETMQ_MQTT_HOME" ]; then
23 | ## resolve links - $0 may be a link to maven's home
24 | PRG="$0"
25 |
26 | # need this for relative symlinks
27 | while [ -h "$PRG" ]; do
28 | ls=$(ls -ld "$PRG")
29 | link=$(expr "$ls" : '.*-> \(.*\)$')
30 | if expr "$link" : '/.*' >/dev/null; then
31 | PRG="$link"
32 | else
33 | PRG="$(dirname "$PRG")/$link"
34 | fi
35 | done
36 |
37 | saveddir=$(pwd)
38 |
39 | ROCKETMQ_MQTT_HOME=$(dirname "$PRG")/..
40 |
41 | # make it fully qualified
42 | ROCKETMQ_MQTT_HOME=$(cd "$ROCKETMQ_MQTT_HOME" && pwd)
43 |
44 | cd "$saveddir"
45 | fi
46 |
47 | export ROCKETMQ_MQTT_HOME
48 |
49 | BASEDIR=$HOME
50 | mkdir -p $BASEDIR/logs
51 |
52 | mainClass="org.apache.rocketmq.mqtt.meta.starter.MetaStartup"
53 |
54 |
55 | function startup() {
56 | pid=`ps aux|grep $mainClass|grep -v grep |awk '{print $2}'`
57 | if [ ! -z "$pid" ]; then
58 | echo "java is runing..."
59 | exit 1
60 | fi
61 | nohup sh ${ROCKETMQ_MQTT_HOME}/bin/runserver.sh $mainClass $@ >$BASEDIR/logs/start_out.log 2>&1 &
62 | }
63 |
64 | function stop() {
65 | pid=`ps aux|grep $mainClass|grep -v grep |awk '{print $2}'`
66 | if [ -z "$pid" ]; then
67 | echo "no java to kill"
68 | fi
69 | printf 'stop...'
70 | kill $pid
71 | sleep 3
72 | pid=`ps aux|grep $mainClass|grep -v grep |awk '{print $2}'`
73 |
74 | if [ ! -z $pid ]; then
75 | kill -9 $pid
76 | fi
77 | }
78 |
79 | case "$1" in
80 | start)
81 | startup $@
82 | ;;
83 | stop)
84 | stop
85 | ;;
86 | restart)
87 | stop
88 | startup
89 | ;;
90 | *)
91 | printf "Usage: sh $0 %s {start|stop|restart}\n"
92 | exit 1
93 | ;;
94 | esac
--------------------------------------------------------------------------------
/distribution/bin/mqtt.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #
4 | # /*
5 | # * Licensed to the Apache Software Foundation (ASF) under one or more
6 | # * contributor license agreements. See the NOTICE file distributed with
7 | # * this work for additional information regarding copyright ownership.
8 | # * The ASF licenses this file to You under the Apache License, Version 2.0
9 | # * (the "License"); you may not use this file except in compliance with
10 | # * the License. You may obtain a copy of the License at
11 | # *
12 | # * http://www.apache.org/licenses/LICENSE-2.0
13 | # *
14 | # * Unless required by applicable law or agreed to in writing, software
15 | # * distributed under the License is distributed on an "AS IS" BASIS,
16 | # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | # * See the License for the specific language governing permissions and
18 | # * limitations under the License.
19 | # */
20 | #
21 |
22 | if [ -z "$ROCKETMQ_MQTT_HOME" ]; then
23 | ## resolve links - $0 may be a link to maven's home
24 | PRG="$0"
25 |
26 | # need this for relative symlinks
27 | while [ -h "$PRG" ]; do
28 | ls=$(ls -ld "$PRG")
29 | link=$(expr "$ls" : '.*-> \(.*\)$')
30 | if expr "$link" : '/.*' >/dev/null; then
31 | PRG="$link"
32 | else
33 | PRG="$(dirname "$PRG")/$link"
34 | fi
35 | done
36 |
37 | saveddir=$(pwd)
38 |
39 | ROCKETMQ_MQTT_HOME=$(dirname "$PRG")/..
40 |
41 | # make it fully qualified
42 | ROCKETMQ_MQTT_HOME=$(cd "$ROCKETMQ_MQTT_HOME" && pwd)
43 |
44 | cd "$saveddir"
45 | fi
46 |
47 | export ROCKETMQ_MQTT_HOME
48 |
49 | BASEDIR=$HOME
50 | mkdir -p $BASEDIR/logs
51 |
52 | mainClass="org.apache.rocketmq.mqtt.cs.starter.Startup"
53 |
54 | function startup() {
55 | pid=`ps aux|grep $mainClass|grep -v grep |awk '{print $2}'`
56 | if [ ! -z "$pid" ]; then
57 | echo "java is runing..."
58 | exit 1
59 | fi
60 | nohup sh ${ROCKETMQ_MQTT_HOME}/bin/runserver.sh $mainClass $@ >$BASEDIR/logs/start_out.log 2>&1 &
61 | }
62 |
63 | function stop() {
64 | pid=`ps aux|grep $mainClass|grep -v grep |awk '{print $2}'`
65 | if [ -z "$pid" ]; then
66 | echo "no java to kill"
67 | fi
68 | printf 'stop...'
69 | kill $pid
70 | sleep 3
71 | pid=`ps aux|grep $mainClass|grep -v grep |awk '{print $2}'`
72 |
73 | if [ ! -z $pid ]; then
74 | kill -9 $pid
75 | fi
76 | }
77 |
78 | case "$1" in
79 | start)
80 | startup $@
81 | ;;
82 | stop)
83 | stop
84 | ;;
85 | restart)
86 | stop
87 | startup
88 | ;;
89 | *)
90 | printf "Usage: sh $0 %s {start|stop|restart}\n"
91 | exit 1
92 | ;;
93 | esac
94 |
--------------------------------------------------------------------------------
/distribution/conf/connect.conf:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 |
17 | mqttPort=1883
18 |
19 | enablePrometheus=true
--------------------------------------------------------------------------------
/distribution/conf/meta.conf:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 |
17 | selfAddress=
18 | membersAddress=
19 |
--------------------------------------------------------------------------------
/distribution/conf/meta_spring.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/distribution/conf/service.conf:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 |
17 | username=
18 | secretKey=
19 |
20 | NAMESRV_ADDR=
21 | eventNotifyRetryTopic=
22 | clientRetryTopic=
23 |
24 | metaAddr=
--------------------------------------------------------------------------------
/distribution/conf/spring.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/distribution/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | rocketmq-mqtt
5 | org.apache.rocketmq
6 | 1.0.2-SNAPSHOT
7 |
8 | 4.0.0
9 | pom
10 | distribution
11 |
12 |
13 | UTF-8
14 |
15 |
16 |
17 |
18 | release-all
19 |
20 |
21 | org.apache.rocketmq
22 | mqtt-cs
23 |
24 |
25 | org.apache.rocketmq
26 | mqtt-ds
27 |
28 |
29 | org.apache.rocketmq
30 | mqtt-example
31 |
32 |
33 | org.apache.rocketmq
34 | mqtt-exporter
35 |
36 |
37 |
38 |
39 |
40 | maven-assembly-plugin
41 |
42 |
43 | release-all
44 |
45 | single
46 |
47 | package
48 |
49 |
50 | release.xml
51 |
52 | false
53 |
54 |
55 |
56 |
57 |
58 | rocketmq-mqtt-${project.version}
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/distribution/release.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | all
20 | true
21 |
22 | dir
23 | tar.gz
24 | zip
25 |
26 |
27 |
28 | ../
29 |
30 | README.md
31 |
32 |
33 |
34 |
35 |
36 | conf/**
37 |
38 |
39 |
40 |
41 |
42 | bin/**
43 |
44 | 0755
45 |
46 |
47 |
48 |
49 |
50 | true
51 |
52 | org.apache.rocketmq:mqtt-cs
53 | org.apache.rocketmq:mqtt-ds
54 | org.apache.rocketmq:mqtt-meta
55 |
56 |
57 | lib
58 | false
59 |
60 |
61 | lib
62 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/mqtt-common/src/main/java/org/apache/rocketmq/mqtt/common/facade/AuthManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.rocketmq.mqtt.common.facade;
19 |
20 | import io.netty.handler.codec.mqtt.MqttMessage;
21 | import org.apache.rocketmq.mqtt.common.hook.HookResult;
22 |
23 | public interface AuthManager {
24 | /**
25 | * MQTT packet authentication
26 | *
27 | * @param message
28 | * @return
29 | */
30 | HookResult doAuth(MqttMessage message);
31 | }
32 |
--------------------------------------------------------------------------------
/mqtt-common/src/main/java/org/apache/rocketmq/mqtt/common/facade/LmqOffsetStore.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.rocketmq.mqtt.common.facade;
19 |
20 | import org.apache.rocketmq.mqtt.common.model.Queue;
21 | import org.apache.rocketmq.mqtt.common.model.QueueOffset;
22 | import org.apache.rocketmq.mqtt.common.model.Subscription;
23 |
24 | import java.util.Map;
25 | import java.util.concurrent.CompletableFuture;
26 |
27 | public interface LmqOffsetStore {
28 | /**
29 | * save lmq offset
30 | * @param clientId
31 | * @param offsetMap
32 | */
33 | void save(String clientId, Map> offsetMap);
34 |
35 | /**
36 | * get lmq offset
37 | * @param clientId
38 | * @param subscription
39 | * @return
40 | */
41 | CompletableFuture