azureservicebus - Async Monitoring Azure Service Bus With Worker Role -
i have worker role monitoring azure service bus can potentially receive thousands of messages @ peak times. realize can use cloud service create multiple instances of worker role (competing consumers), , scale way, each worker instance asynchronously handle multiple messages well.
so question in this; in client.onmessage handler, can call async function goes off on thread, , onmessage resumes reading next message? ideally, happen defined number of times.
for example:
client.onmessage((receivedmessage) => { try { await processcurrentmessage(receivedmessage); // launch asynchronously x times } catch(exception ex) { receivedmessage.abandon(); //handle error } }); public async void processcurrentmessage(brokeredmessage receivedmessage) { // properties message , stuff }
what trying scale having each worker role handle x amount of messages @ time, leveraging cpu on cloud service, , enhance adding more cloud instances. if had 20 messages in queue , 10 consumers, 10 start (1 per competing consumer), 11th message wait until 1 finished, etc. seems kind of road block if each message took several minutes process.
appreciate advice or tips.
Comments
Post a Comment