Method for realizing shared subscription based on MQTT server cluster
A server cluster and server technology, applied in the direction of digital transmission systems, electrical components, transmission systems, etc., can solve huge and cumbersome problems, achieve load balancing, less resources, and reduce the amount of data transmission
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0045] Such as figure 1 As shown, a method of sharing subscription based on MQTT server cluster is designed. In the MQTT message server cluster, an intelligent routing system based on event-driven architecture, mnesia distributed database, ets routing table and map packet mapping is designed, and on this basis Added shared subscription processing flow.
[0046] Such as figure 2 and image 3 As shown, two kinds of subscription topic prefix queue shared subscription prefix $queue and group shared subscription prefix $share / are set .
[0047] Queue shared subscription refers to a topic starting with $queue / , such as $queue / topic1. If multiple clients subscribe at the same time, the MQTT message server cluster will distribute the messages sent to topic1 to a client in a load-balanced manner.
[0048] Group sharing subscription is a more flexible way, and the implementation method is for all $share / Topics starting with / will be grouped into groups for load balancing di...
Embodiment 2
[0075] First, the MQTT server cluster is established through the mnesia distributed database to synchronize data between nodes.
[0076] 1. Start a node 'mqtt@hostname1', execute mnesia:create_schema([node()]).mnesia:start(). on this node (the data must be started, otherwise other nodes cannot join the cluster) to create a database.
[0077] 2. Start the second node 'mqtt@hostname2', ping 'mqtt@hostname1', and execute mnesia:start(). (Mnesia must be started, otherwise the following steps cannot be performed).
[0078] 3. Execute mnesia:change_config(extra_db_node,['mqtt@hostname']) on the second node 'mqtt@hostname2'.
[0079] 4. Execute mnesia:change_table_copy_type(schema,node(),disc_copies) on the second node 'mqtt@hostname2'. (copy the schema to the disk directory of the node database).
[0080] 5. You can execute the following code to copy the database table.
[0081] 6. lists: foreach(fun(Table)->
[0082] Type=call(Node, mnesia, table_info, [Table, st...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com