MQ can be used as an extended value-added service to dock Rule Engine, and form a high-performance service portfolio with IoT Suite, which is characterized by device access, device management, message distribution and application hosting.
MQ has the following characteristics:
Message buffer
Message buffer is supported by message queuing, which can effectively cache messages that cannot be consumed immediately due to network or application server anomalies.
A queue buffer has a maximum capacity. When the maximum capacity of queue is reached, the service will reclaim data from the head of the queue.
Load shifting
The message queuing service can effectively buffer a large number of concurrent messages that forward burst, and push them to consumers at a fairly low and average rate, thus reducing stress on the consumers.
At-most-once and at-least-once
User can realize at-most-once and at-least-once message consumption by configuring message lock time. If message lock time is enabled and the client does not acknowledge the response within that time, the consumption is deemed to have failed. After the lock time has elapsed, the client can consume the unacknowledged message again.
Message expiration time
User can customize message expiration time, then any enqueued message that has reached the expiration time will be deleted, that is, the service will delete messages enqueued for more than a definite period of time.
Sequential messaging
All messages from a topic are published and consumed in a first-in-first-out (FIFO) order to ensure strict sequentiality.
Backtrack
Enable users to customize their consumer position and re-consume messages from a queue. For example, it is set to consume messages from the head. That done, the client will consume messages from a custom location of the queue.
As long as the message is not deleted due to timeout or because the cache is full, the user can re-consume the message by specifying consumer position.
Multi-party independent consumption
Enable users to create multiple brokers (sub) for a queue, which are mutually independent and can consume data from the same queue with different configurations.
Single consumer and clustering
One or more clients are supported by message queuing to establish a relationship with the same sub (i.e. subscription) at the same time.
When multiple clients establish a relationship with the same sub on the same topic at the same time, the message queuing service believes that clients are in cluster mode, where messages are sent evenly to each client and each message can only be consumed by one client, as shown below:
Compared with OneNET’s HTTP push that serves push scenarios, MQ has the following advantages:
HTTP Push | Message queue (MQ) | |
---|---|---|
Message buffer | Not Supported | Supported |
Clustering | Load Balanced Applications | Supported |
Backtrack | Not Supported | Supported |
Multi-party consumption | Not Supported | Support OneToMany |
Latency | High | Low |