REST API Receive Command Sample?

Hi guys

I can see the sample, how API Service (.NET Core 3.1) sends the command. But where I can find the sample, where API Service receives the command via NServiceBus (any transport)?

Thanks.

Hi Vlad,

Well, it depends on what does this mean …API Service receives the command via NServiceBus…. There are couple options:

  1. The best way is to trying design solution with one-way fire-and-forgot messaging so there is no need for receive message

  2. If the API Service method has to wait (be blocked) for the message processing then you can try using Client-Side Callbacks but take to consideration all disadvantages

  3. If the user has to updated then you can try using SignalR for example

  4. If there is only need for receiving message for the same Endpoint which sent the Command (hosting in API Service process) you can try using Request/Response pattern based on messaging

Hope this help.

2 Likes