2007/10/2, Dave Farkas <[EMAIL PROTECTED]>:
> { :dispatch_mode => :SOAP,
> :queue_name => 'queue.messages',
> :delivery => :repeated,
> :expires =>3600,
> :max_deliveries=>10,
> :priority => 1 },
>
> the queue will attempt to call the webservice up to 10 times or until
> the message expires in an hour. Also, these messages have a priority
> of 1 so they will be processed before messages in the queue with a
> lower priority - I believe the default is 0.
Nice example! Because a :repeated delivery quality is just in the reliable-msg's
QueueManager, AP4R can utilize it for free :-)
But I don't understand priority issue yet, it is related to Selector
which describe the
interaction between Queue(client) and QueueManager(server).
Suppose the case messages with low and high priorities are mixed and
high priority messages constantly. If high priority messages were processed
before lower ones all the time, lower ones may not be processed for a long time.
So there should be some balance between "skipping" and "acceptance"
(e.g. according to hang-up time etc.).
It's a case dependent issue, but if there are somewhat general use cases,
I do incorporate it into AP4R. Otherwise I should arrange some hook.
> I haven't been able to figure out if there is a way to delay the retry
> accepting request. Does anyone know if this type of functionality
> exists in reliable-msg?
I haven't tried yet but there is some comment in Selector class of reliable-msg
== BEGIN QUOTATION
# This example uses the delivery count and message creation date/time to
# implement a simple retry with back-out:
#
# MINUTE = 60
# HOUR = MINUTE * 60
# BACKOUT = [ 5 * MINUTE, HOUR, 4 * HOUR, 12 * HOUR ]
#
# selector = Queue::selector { delivered == 0 ||
BACKOUT[delivered - 1] + created <= now }
== END QUOTATION
So Queue#get with Selector instance may help you.
# reliable-msg is REALLY well made library!
Two comment about this functionality.
1. can not be used through AP4R dispatcher
2. block is not able to be marshalled so it is evaluated locally by callback
from remote druby server, so it needs some more TCP communication
(depending of # of rejections).
> Btw, I've had the same issue happen when restarting a queue. I think
> it would be nice to add in a retry delay to the ap4 client.
Added to my TODO list (with performance consideration).
> Oh and if you haven't already make sure to check the following posts
> on the reliable-msg forum, regarding mysql connection timeouts
I don't know about that. Thank you for your information.
Thanks,
shino
_______________________________________________
ap4r-user mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ap4r-user