Event bus message delivery guarantee...

646 views
Skip to first unread message

javadevmtl

unread,
Jan 30, 2017, 2:21:59 PM1/30/17
to vert.x
Hi if we want to do a fire and forget, if eb.send() does not throw an error does it mean the message got delivered or does the receiving verticle have to reply with an "ack" message to be 100%?

Sean Burns

unread,
Jan 31, 2017, 12:44:36 AM1/31/17
to vert.x

From http://vertx.io/docs/vertx-core/java/#_the_theory 

Best-effort delivery

Vert.x does it’s best to deliver messages and won’t consciously throw them away. This is called best-effort delivery.

However, in case of failure of all or parts of the event bus, there is a possibility messages will be lost.

If your application cares about lost messages, you should code your handlers to be idempotent, and your senders to retry after recovery.


So depending on the importance of your message, if you want 100% knowledge of delivery, you should probably ack the message. Then retry if no ack recieved. 
But remember the receiving verticle must handle "duplicates" (Ie be idempotent), because in theory it could receive the message and the ack could be lost (which would cause a retry).

javadevmtl

unread,
Jan 31, 2017, 1:16:25 AM1/31/17
to vert.x
That i read... but does it mean eb.send does not throw an error then the message got sent? Im not talking about if the receiving verticle got it or not and processed it.

javadevmtl

unread,
Jan 31, 2017, 1:38:40 AM1/31/17
to vert.x
I.e if eb.send without a reply handler. If it didn't throw an error. Im assuming it got sent. Im not assuming the receiving side processed it or not.

Asher Tarnopolski

unread,
Jan 31, 2017, 5:57:13 AM1/31/17
to vert.x
i think that when you work in cluster, errors like no consumer handler or delivery timeout will be returned as a callback to reply handler. not sure about sendLocal though. 


riscad...@gmail.com

unread,
Feb 1, 2017, 6:44:00 AM2/1/17
to vert.x
If you there's no registered handler I believe you'll get an error back stating no handler was registered. If there is a handler but it does not respond to the sender for some reason. It will eventually fail with whatever timeout was configured in the send DeliveryOptions... or the default eventbus 30s timeout.

Jochen Mader

unread,
Feb 1, 2017, 7:09:29 AM2/1/17
to ve...@googlegroups.com
You only receive an error if you registered a callback handler.
In all other cases the event is simply discarded.

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/87129065-d963-4ee9-a8e5-4abfe77aca24%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Jochen Mader | Lead IT Consultant

codecentric AG | Elsenheimerstr. 55a | 80687 München | Deutschland
tel: +49 89 215486633 | fax: +49 89 215486699 | mobil: +49 152 51862390
www.codecentric.de | blog.codecentric.de | www.meettheexperts.de | www.more4fi.de

Sitz der Gesellschaft: Düsseldorf | HRB 63043 | Amtsgericht Düsseldorf
Vorstand: Michael Hochgürtel . Rainer Vehns
Aufsichtsrat: Patric Fedlmeier (Vorsitzender) . Klaus Jäger . Jürgen Schütz

javadevmtl

unread,
Feb 1, 2017, 9:16:57 AM2/1/17
to vert.x
Thanks. That's what i wanted to know...
Reply all
Reply to author
Forward
0 new messages