0
votes

I have an Angular JavaScript Client App 1 that adds or deletes 5 to 10 rows from a DB occasionally. I have another POST action in a WebAPI (REST) which processes these rows (these rows come in thousands) to generate a JSON object. Another Angular JavaScript Client App 2 makes an ajax call to get the JSON from this POST action.

To scale this process, I want to move the process in the Web API to a subscriber and react on a message CustomersAdded from Azure Service Bus which is initiated by Angular JavaScript Client App 2.

My questions are:

  1. Can I send a message CustomerAdded directly to Azure Service Bus from Angular JavaScript Client App 1?
  2. I have two types of messages (AddNewCustomer, CustomersAdded) to send from two Angular Client apps. The subscribers should handle both the types of messages. Should I use queue or topic for this purpose?
  3. How do I integrate the Angular App, Azure Function, Azure Service Bus and two subscribers to interact each other?
1
Provided answer for #1 and #2. IMHO, #3 is quite open ended.Gaurav Mantri

1 Answers

1
votes

Part answer to your questions.

Can I send a message GetProcessedCustomers directly to Azure Service Bus from Angular JavaScript Client App 1?

As far as I know, the answer is no. For this to work, Azure Service Bus need to support CORS or WebSockets which do not exist today.

I have two types of messages (AddNewCustomer, CustomersAdded) to send from two Angular Client apps. The subscribers should handle both the types of messages. Should I use queue or topic for this purpose?

You could use both queues or topics for this purpose however queues are better suited for this purpose. Topics are better suited when you want a message to get processed by multiple subscribers.