Quick Start: How could you build a messaging solution with .Net Core? — Part 4
- How could you build a messaging solution with .Net Core Part 1
- How could you build a messaging solution with .Net Core Part 2
- How could you build a messaging solution with .Net Core Part 3
- How could you build a messaging solution with .Net Core Part 4
In this part, we are going to see how to operates messages from senders to receivers. Handling the data in API, process and send to receiver by sender object. Besides, a base structure of receiver application will be shown.
Orders service
By authenticate API resource, token should be generated and used in Order related resource calls.
For understanding the general order flow:
RabbitMQ Service
Create Order
It creates, and initialize the data as follows:
Assign a Shipper
And Email receiver sent the email:
Delivery In Progress
Mail:
Delivered
How is the sender mechanism?
Sending message to Receiver:
Let’s assume that we need to send message to receiver for created order.
Sender is as follows:
Queue name and host name are initialized and basic publish called with required parameters. Message is handled by receiver from specific queue.
A structure of Receiver service (Hosted service):
Message handles by receiver as follows. Start Async sets the required delegates and implementation is done in methods. Here, in the HandleMessage method, Order parameter is handled and processed as it is required.