Setting timeout for vertx eventbus

1,338 views
Skip to first unread message

Thomas Legowo

unread,
Jul 27, 2016, 1:13:53 AM7/27/16
to vert.x

I'm currently working on a Vertx based application that is making use of vertx-eventbus.js as described here: http://vertx.io/docs/vertx-web/java/#_sockjs_event_bus_bridge


So the client side is using vertx-eventbus.js to send a message to server side which has SockJSHandler doing the 'bridge' to receive the message. The whole mechanism has been working fine for few months. Only very recently we now potentially need to have higher timeout limit for certain messages. If run right now, those messages always cause the following warning on the server side (and also caused the eventbus to attempt to return too early on client side with "undefined"):

Message reply handler timed out as no reply was received - it will be removed


My question is then how do you increase the timeout for the message sending in this scenario? It seems to be using the default 30 seconds timeout and I have looked everywhere (online searches Google, here at Stackoverflow, etc) with no luck. I know there is a way to set timeout when you are sending using Vertx on the backend but not when sending from vertx-eventbus.js.

Any input is very much appreciated. Let me know if there is anything else you need to better understand what I'm trying to achieve.


Thank you

Michael Luecke

unread,
Jul 27, 2016, 1:17:51 AM7/27/16
to vert.x
Just to add a bit more details (as I'm working along side Thomas), 

We namely focus on the JavaScript language and have tried using delivery options when doing the .send with the sendTimeout in the object when we do .send() with the event bus, but no dice.  Similarly if we just put timeout.

We're a bit lost as to what we are missing and will try to provide more details as required. 

Thanks in advanced!

On Wednesday, July 27, 2016 at 3:13:53 PM UTC+10, Thomas Legowo wrote:

<snip>

Paulo Lopes

unread,
Jul 27, 2016, 3:45:40 AM7/27/16
to vert.x
Hi,

For my understanding what you're doing is:

SERVER> eb.send('browser.address', { ... }, reply -> { ... })

BROWSER> eb.registerHandler('browser.address', (err, res) => { ... /* this takes too much time before calling res.reply() */ }

Right?

We need to get this in order to investigate what is happening. Better would be if you could make a small reproducer (you can always emulate a long delay with a setTimeout()

Thomas Legowo

unread,
Aug 14, 2016, 9:11:02 PM8/14/16
to vert.x
Hi,

Just to provide a further update to this. We have managed to find the solution and the fixes were applied only on the backend side of things with all timeout attributes consistently set:

1. Set 'replyTimeout' attribute on the Sock JS Handler for Vertx Web JS
2. Set 'timeout' attribute on the vertx's eventBus.send() function
3. Set socket timeout attribute to between our app to its endpoint, but this does not involve any vertx element
Reply all
Reply to author
Forward
0 new messages