0

I have two SQS queues say queueA and queueB. queueA has subscribed to mutliple SNS topics and keeps getting messages. queueB is the one to actually process these messages.

But my requirement is that this processing should happen everyday during a fixed period, say 9am to 6pm everyday.

There is no way to control/schedule processing inside queueB in other words, queueB processes the messages as soon as it recieves.

I want to have a gate/door sort of mechanism between queueA and queueB. This gate opens at 9am everyday, stays open till 6pm and closes exactly at 6pm. When the door is open, messages can flow from queueA to queueB including the messages that arrived in queueA during this period as well as messages arrived at 'closed time' and waiting for the gate to open.

RJN_WLY
  • 335
  • 1
  • 4
  • 18
  • Would it work to have a polling mechanism on queueB? So it's not automatically triggered when something arrives on it, you have to manually call a lambda function. And you can schedule when a lambda function is triggered in Cloudwatch. – Adam Benson Dec 11 '18 at 12:38
  • I can schedule lambda to start at a given time, but how do I make it stop at a given time. Or keep it running(or active) for a given period only. – RJN_WLY Dec 11 '18 at 14:38

1 Answers1

0

There are lots of ways to do this, but you'll have to write the process that moves messages from one queue to the other yourself - this should be pretty straightforward. To make it flexible, parameterize that process so it stops after a specified time.

Then, you can control this process via one of:

Krease
  • 15,805
  • 8
  • 54
  • 86