I have jobs
named A, B, C, D
. Job B
has to start after job A
finished. So the order of jobs should look like this A->B->C->D
.
I want to scale number of workers for A
, B
, C
and D
indepently. Is there a way to implement this using RabbitMQ
, I am basically looking for a way to create a series
of jobs
.
My current design looks like this:
- The
caller
process createsseriesOfJobs
: array ofJSON
s that describe jobsA,B,C,D
usingJSON-RPC
protocol - The
caller
sends theseriesOfJobs
to aseriesManager
(separate process) viaRabbitMQ
RPC
and awaits callback onmainCallbackQueue
- The
seriesManager
parsesseriesOfJobs
sends jobA
to aworkerA
(separate process) viaRabbitMQ
RPC
and awaits callback oncallbackQueueA
workerA
performs jobA
and notifiesseriesManager
viacallbackQueueA
seriesManager
gets callback fromcallbackQueueA
and sends jobB
to worker and awaits callback, then the same for jobC
, then the same for jobD
seriesManager
knows that it jobsA,B,C,D
finished - it notifiescaller
viamainCallbackQueue
I am using the concept of RPC
as described here RabbitMQ RPC tutorial Is there a simpler way to do this?