Giter Site home page Giter Site logo

rocketmq-mqtt's Introduction

Apache RocketMQ MQTT

Build Status License CodeCov Average time to resolve an issue Percentage of issues still open Twitter Follow

A new MQTT protocol architecture model, based on which RocketMQ can better support messages from terminals such as IoT devices and Mobile APP. Based on the RocketMQ message unified storage engine, it supports both MQTT terminal and server message sending and receiving.

Architecture

The relevant architecture design is introduced in RIP-33. The queue model of MQTT needs to be based on the light message queue, For the design of the specific light message queue, please refer to the RIP-28(LMQ)-wiki of RocketMQ.

Get Started

Prerequisites

The queue model of MQTT needs to be based on the light message queue feature (RIP-28) of RocketMQ. RocketMQ has only supported this feature since version 4.9.3. Please ensure that the installed version of RocketMQ already supports this feature.

For the quick start of light message queue, please refer to Example_LMQ of RocketMQ. For example, set the following parameters to true in broker.conf

enableLmq = true
enableMultiDispatch = true
  1. Clone
git clone https://github.com/apache/rocketmq-mqtt
  1. Build the package
cd rocketmq-mqtt
mvn -Prelease-all -DskipTests clean install -U 
  1. Config
cd distribution/target/
cd conf

Some important configuration items in the service.conf configuration file

Config Key Instruction
username used for auth
secretKey used for auth
NAMESRV_ADDR specify namesrv address
eventNotifyRetryTopic notify event retry topic
clientRetryTopic client retry topic
  1. CreateTopic

    create all first-level topics, including eventNotifyRetryTopic and clientRetryTopic in the configuration file above.

sh mqadmin updatetopic -c {cluster} -t {topic} -n {namesrv}
  1. Initialize Meta
  • Configure Gateway Node List
sh mqadmin updateKvConfig -s LMQ -k LMQ_CONNECT_NODES -v {ip1,ip2} -n {namesrv}
  • Configure the first-level topic list
sh mqadmin updateKvConfig -s LMQ -k ALL_FIRST_TOPICS -v {topic1,topic2} -n {namesrv}
  • Configure a list of wildcard characters under each first-level topic
sh mqadmin updateKvConfig  -s LMQ -k {topic} -v {topic/+}  -n {namesrv}
  1. Start Process
cd bin
sh mqtt.sh start

Example

The mqtt-example module has written basic usage example code, which can be used for reference

Protocol Version

The currently supported protocol version is MQTT 3.1.1, but the will and retain features are not supported yet

Authentication

At present, an implementation based on the HmacSHA1 signature algorithm is provided by default, Refer to AuthManagerSample. Users can customize other implementations to meet the needs of businesses to flexibly verify resources and identities.

Meta Persistence

At present, meta data storage and management is simply implemented through the kvconfig mechanism of namesrv by default, Refer to MetaPersistManagerSample. Users can customize other implementations.

License

Apache License, Version 2.0 Copyright (C) Apache Software Foundation.

rocketmq-mqtt's People

Contributors

aliensb avatar changingfond avatar dependabot[bot] avatar dongyuanpan avatar duhenglucky avatar ferrirw avatar fujian-zfj avatar pingww avatar rongtongjin avatar shannonding avatar shendongsd avatar tianliuliu avatar yxac avatar zhouxinyu avatar zongtanghu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.