RequestResponse vs

Jun 27, 2013 at 9:51 PM
I successfully created and able to run the solution described at your website under "Getting started". Works like a charm. Very fast.

So, under your samples folder, RequestResponse, I fire up the server and client. I enter text in the client window and hit Enter. I then see the reply from the server.

Text has been reversed: 051c0
<header> 'header1' : 'value1'
<header> 'header2' : 'value2'

The time it takes for the server to respond is one to two seconds. Is this normal for Request/Response pattern?

Thanks for any help!
Coordinator
Jun 28, 2013 at 4:52 AM
Edited Jun 28, 2013 at 4:54 AM
Hi,

Since the queues are polled Shuttle has a mechanism to start slowing down the polling if there is nothing to do.

When you take a look at the full configuration section you will notice the durationToSleepWhenIdle attribute in the inbox configuration (as that is applicable here).

Each time a thread has nothing to process it starts with the first entry to determine how long to wait before trying again. You will notice that when you send off a whole lot of requests, or stop the server and send a whole lot from the client and start the server again, the server will process the requests in quick succession since there is then no wait duration between the polls.

The actual value structure of the attribute is {count}{duration}{unit}. The {count} bit is optional, though. I see I need some documentation around this on the wiki :)

Anyway, so a more complex example would be: 10*50ms,5250ms,21s,3s

So the first ten times nothing is processed the polling will wait 50ms before trying again, the next 5 times it will wait 250ms, the next 2 times 1 second, and after that 3 seconds.

Hope that helps :)

Regards,
Eben