Message delivery issue: Consumer vanishes within the timeout of the sender

73 views
Skip to first unread message

mathias

unread,
Apr 28, 2015, 2:11:26 PM4/28/15
to ve...@googlegroups.com
I have a reproducer that shows that a simple sender trying to send a message to the consumer does not reach the consumer within the timeout of the DeliveryOptions, altough the delay of the consumer reply is way blow the timeout (only half). The timing between sender and consumer verticles is as follows:

static boolean showBug = true;

 
public static final Long SENDER_INTERVAL = 1000l;
 
public static final Long REPLY_DELAY = showBug ? SENDER_INTERVAL + 500l : SENDER_INTERVAL - 500l;
 
public static final Long SEND_TIMEOUT = REPLY_DELAY * 2; //used for DeliveryOptions of the sender

Why does the sender not wait 3 seconds for the consumer to reply?

https://github.com/leolux/vertx-consumer_vanish

Tim Fox

unread,
Apr 28, 2015, 2:57:01 PM4/28/15
to ve...@googlegroups.com
You set the send timeout to SENDER_INTERVAL (1 second) not SEND_TIMEOUT (3 seconds):

https://github.com/leolux/vertx-consumer_vanish/blob/master/src/main/java/com/reproducer/Sender.java#L14

(BTW you don't need the Thread.sleep, simpler to just use vertx.setTimer() :) )

--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mathias

unread,
Apr 28, 2015, 5:44:03 PM4/28/15
to ve...@googlegroups.com
Alright thanks! I have updated the class "Sender" to use the SEND_TIMEOUT (3 seconds) instead of the SENDER_INTERVAL. But the issue still remains, so the consumer starts to vanish after a view seconds.
https://github.com/leolux/vertx-consumer_vanish/blob/master/src/main/java/com/reproducer/Sender.java#L14

I use Thread.sleep() in order to simulate an remote API call. The intention is to let the consumer respond after a little delay. Since the delay is smaller than the sender timeout I would except the sender to receive a rensponse from the consumer every time. And it works a serveral times. But than, after a view seconds suddenly it happens some magic: The consumer is vanished :-)

mathias

unread,
Apr 29, 2015, 1:01:35 PM4/29/15
to ve...@googlegroups.com
Could you reproduce the issue with the reproducer?

mathias

unread,
May 2, 2015, 3:41:47 PM5/2/15
to ve...@googlegroups.com

I investigated my reproducer again and found out that the consumer actually does not vanish within the timeout of the sender but outsite of the timeout.
I think that the response time increases on every iteration until 3 seconds have been reached because there is only on worker thread that executes the blocking code on the worker thread and is forced to sleep for 1.5 seconds every second...

So the reproducer does not exactly reflect the issue that I intended to reproduce. In my current app the consumer does not get invoked for every message send to the eventbus, although beeing completely non-blocking and only using the event loop context (without worker verticles).


Reply all
Reply to author
Forward
Message has been deleted
0 new messages