-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how I kown the server publish message (use qos1) is success #85
Comments
I see the problem is that we are not sure which message id will be returned by I think we should have one more publish method with a handler, called when a message is sent with a message id. We have a similar method in MqttClient. |
@Sammers21 and I suggest add 2 methods at interface MqttEndpoint.java
|
@caoqingguang, sorry but I did not get it. So, why it can be useful? Can you explain? You also welcome to submit a PR. We will see and discuss then. |
@caoqingguang what's the client context you are talking about ? I think that PR #86 from @Sammers21 can help you to solve your initial problem. |
@Sammers21 @ppatierno |
@Sammers21 @ppatierno
same message with same messageId, I suggest those methods can save the mapping (messageId->message)
|
@caoqingguang, I think that sending a message with id generated by hands might be useful, but it can lead to some issues when using publish with autogenerated message id along with handly generated one. So if we would have such opportunity, it should be used with caution by vertx-mqtt-server users. And if we would look at a situation when you need to resend a message, why it is a problem to use different from original message Id(autogenerated for example)? It would be simpler and you would have fewer issues with such approach. If you have a different from the ticket topic suggestions, feel free to create a ticket for each of them. We will discuss. |
@Sammers21 case1 same message with diffrent messageIdmessageId and message mapping like the table in condition
when receive ack with messageId(id2) from remote client. then i kown the msg1 is send success, and i delete the mapping (id2->msg1), but (id1->msg1) and (id3->msg1) still exists,so i must do more works to delete those mappings. case2 same message with same messageIdmessageId and message mapping like the table in condition
when receive ack with messageId(id1) from remote client. then i kown the msg1 is send success, and i only need to delete the mapping (id1->msg1). when to retry againI will check the mapping table at future time,and resend the message if it exists in the table. |
@caoqingguang why did you close the issue ? did you solve it ? |
@ppatierno
I will try run this code on server which has 1 millon users. |
when I publish message1 use method
MqttEndpoint publish(topic, Buffer payload, qosLevel, isDup, isRetain);
and i can get messageId by method
int lastMessageId()
and i kown one message is success when i get
but in multi thread , the messageId maybe not the real messageId, when an other thread send message2 at same time
so if i want get real messageId for message1, i must use lock, is that?
The text was updated successfully, but these errors were encountered: