views:

196

answers:

1

I have an online service that receives incoming events (few every second). Service needs to process a job when there were no events for 30 seconds or more. Service is distributed across several PCs and uses Amazon webservices (SQS and SimpleDB) as a backbone.

I understand how can I schedule a job when there IS an incoming event (just put a message into message queue and you are done), but how can I schedule a job when the condition is "NO EVENTS FOR X SECONDS" ?

Ideally I would want a message queue that does not allow duplicate messages, allows scheduling for the future and allows adjusting "delivery date" on each message.

Is there such a message queue implementation? Is this problem can be solved at all without persisting some data in database?

Thank you

A: 

Both BizTalk or SQL Server Service Broker fit your requirements. If they are too heavyweight, you could write a simple service that peeks the queue every couple of seconds and times out if it does not see anything in 30 seconds. That would be more difficult to scale horizontally across machines, however.

JP Alioto
I think you missed the question. I found what I need is "message grouping" and it looks like AMQP has it. It also appears that problem can be solved with any distributed cache that has notifications. I am looking at the Velocity by Microsoft right now...
Alexander Uslontsev