I have a service fabric stateless service that listens to a service bus subscription for messages using this code:
Client.OnMessage(receivedMessage =>
{
if (Client.IsClosed)
{
return;
}
ProcessMessage(new Workload(receivedMessage));
},
new OnMessageOptions
{
AutoComplete = false,
MaxConcurrentCalls = 5,
AutoRenewTimeout = TimeSpan.Zero
});
I now want to split the service bus topic (that I am currently listening to) into two separate topics (based on priority). I want this same stateless service to listen to both topics in parallel, with a 80/20 split (so process 4 messages from high priority topic, and process 1 message from low priority topic concurrently). Basically making sure messages from both low and high priority topics are getting processed simultaneously.
Is there a problem with this programming model? Can this be done, or are there better alternatives? I am trying to avoid creating separate stateless services for the two priority based topics.
Thanks!