Reputation: 23
I am trying to create a scheduler that initiates various tasks with different parameters. Those tasks will then be picked up by smaller applications to be processed. Those applications only process the task they are meant to process, each of them having unique functionality.
Initially I started using the Azure Service Bus so that the scheduler can throw a message on the service bus meant for a specific consumer to process based on the specified task. For example the scheduler would initiate a task called and throw a message on the service bus, and the consumer who is supposed to process that task will pick it up to process, while other processors do nothing.
The problem however, which I found out later, is that the scheduler needs to know all the specific topics or queues to know where to send a message. The Ideal scenario is that the scheduler only knows of one topic and all the consumers (processors) listen to that topic, and they should only accept the message meant for them specifically. I want this scenario, because the scheduler should remain untouched after it's made and will only received new tasks to execute via front-end application, which submits new scheduled tasks to the scheduler. In short I want the scheduler to be as generic as possible. However more consumers will be added over time to process various tasks.
Would this be achievable with the Azure Service Bus? if so, how? or would a different Azure feature be more useful for this? Either way I need to do this Azure.
I've been thinking that I could let all the processors accept the message and check the messageId and if it's the right one, then process the message, but it sounds not so efficient at all having all the consumers accept the message.
Upvotes: 2
Views: 637
Reputation: 136296
I believe Azure Service Bus Topics & Subscriptions
would meet your requirement nicely.
Basically you would create a separate Subscription for each kind of task. Then you would need to define filtering rules
so that message sent to a Topic can be routed to appropriate Subscription and the task processor listening to that Subscription would pick the message and process it.
Upvotes: 1