Comments (3)
Actually, Emitter supports QoS 1. But maybe not in the way you are expecting. The code that acknowledges the publication of a message is in conn.go
// Acknowledge the publication
if packet.Header.QOS > 0 {
ack := mqtt.Puback{MessageID: packet.MessageID}
if _, err := ack.EncodeTo(c.socket); err != nil {
return err
}
}
However, what is acknowledged is that the message has been integrated into Emitter. Not that it arrived to any client. There could be no client listening at this moment and for a long time, if ever. Although there are certainly more or less elegant ways to handle such cases in a pub/sub system, it didn't seem important for an AP platform like Emitter. The same goes for QoS 2, and it's actually even harder to enforce.
Emitter focusing on AP, I like to compare it to the UDP of pub/sub systems. If you want stronger guarantees you'll have to implement a protocol on top of Emitter.
In the current state of Emitter, I must admit I don't see how your client could receive the same message twice. But if you want to make sure, you can handle this quite easily on the client side by using a tombstone.
from emitter.
It seems only support QoS 0.
// Send forwards the message to the underlying client.
func (c *Conn) Send(m *message.Message) (err error) {
defer c.MeasureElapsed("send.pub", time.Now())
packet := mqtt.Publish{
Header: mqtt.Header{QOS: 0},
Topic: m.Channel, // The channel for this message.
Payload: m.Payload, // The payload for this message.
}
_, err = packet.EncodeTo(c.socket)
return
}
from emitter.
@kelindar - Maybe any plans on supporting QoS level 1 and/or 2? If not, what is the recommendation in order to get the Exactly Once message guarantee-like behavior? Thanks!
from emitter.
Related Issues (20)
- Website Registration Failing HOT 1
- MQTT 5 HOT 3
- IPv6 issues HOT 2
- The provider 'ssd' could not be loaded. manifest has unsupported version: 4 (we support 8). HOT 4
- Mult-region deployment with emitter HOT 3
- Error during gossip ... connection shutting down due to error during handshake: failed to receive remote protocol header: EOF HOT 1
- Disconnected clients remain on presence calls/no unsubscribe event fired on disconnect HOT 6
- How to ensure sequential distribution of messages HOT 1
- How can I fetch all undelivered messages if reconnect to emitter? HOT 1
- whether emitter only support 2 nodes at most? HOT 3
- Why hash is widely used in this project? HOT 1
- Cant connect to deployed emitter.io instance using SSL HOT 1
- any client for php laravel? HOT 2
- Use over ssl?
- BUG reports HOT 2
- Installation Failure HOT 2
- Sometimes on disconnection the presence is not getting updated HOT 5
- project status update HOT 1
- Possible to deploy in azure as Container Apps (scallable)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emitter.