Re: beanstemc.reserve(60) works but beantstemc.reserve() doesnt work as expected

54 views
Skip to first unread message

Chad Kouse

unread,
Nov 15, 2012, 3:29:24 PM11/15/12
to beansta...@googlegroups.com
I'm not familiar with the java client but normally reserve (with no timeout) is a blocking call that waits for a job until one comes.

-- chad

On Thursday, November 15, 2012 at 10:49 AM, homer kommrad wrote:

im using beanstalk on production.holdin our message status queues

when i reach the queye via beanstemc.reserve(60) , it either gives me a job or throws an exception after waiting 

but when i use beanstemc.reserve() , i wait for 10-15 minutes and nothing happens. In the javadoc , it says that it "immediately" either gives me a job or gives me an exception. 

What could cause the problem ? 

--
You received this message because you are subscribed to the Google Groups "beanstalk-talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/beanstalk-talk/-/Qiuyvas5Q6gJ.
To post to this group, send email to beansta...@googlegroups.com.
To unsubscribe from this group, send email to beanstalk-tal...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/beanstalk-talk?hl=en.

Keith Rarick

unread,
Nov 16, 2012, 1:40:42 AM11/16/12
to beansta...@googlegroups.com
On Thu, Nov 15, 2012 at 7:49 AM, homer kommrad <kommra...@gmail.com> wrote:
> but when i use beanstemc.reserve() , i wait for 10-15 minutes and
> nothing happens.

A quick glance at the javadoc for that project seems to suggest
you should use beanstemc.reserve(0) if you want it not to block.

homer kommrad

unread,
Nov 21, 2012, 2:52:05 AM11/21/12
to beansta...@googlegroups.com
public Job reserve() throws IOException, BeanstemcException {
return reserve(0);
}


so when i call reserve , it means i call reserve(0)

Keith Rarick

unread,
Nov 21, 2012, 2:59:14 AM11/21/12
to beansta...@googlegroups.com
On Tue, Nov 20, 2012 at 11:52 PM, homer kommrad <kommra...@gmail.com> wrote:
> so when i call reserve , it means i call reserve(0)

Then it appears the client's javadoc is wrong. Indeed,
https://github.com/safl/beanstemc/blob/master/src/dk/safl/beanstemc/Beanstemc.java#L338-342
shows that a timeout of 0 uses the reserve command,
which never times out. There doesn't seem to be any
way to get beanstemc to send reserve-with-timeout 0.

homer kommrad

unread,
Nov 21, 2012, 3:05:44 AM11/21/12
to beansta...@googlegroups.com
well , i was already suspecting there is something spooky here. 

for a solution , i just use reserve(1) and that does the job for me now :) 
Reply all
Reply to author
Forward
0 new messages