Testing the application
We can now run our project with Visual Studio and set the startup parameters to test the application on sending an order to the Azure Service Bus queue and on retrieving the order from the queue and saving it on NAV.
If we start the console application with S
as the startup parameter, a message is sent to our Service Bus queue. The body of this message contains the serialized order object.
If you go to the Azure Portal and check the Service Bus queue, you can see that now the QUEUE LENGTH is equal to 1:
If you send another message to the queue, the QUEUE LENGTH increases again by 1 and you can monitor the incoming message's arrival time:
If now you run the application by passing R
as the startup parameter (to retrieve a message from the Service Bus queue), the application retrieves the first message to have arrived at the queue, extracts the body, and deserializes it:
The order is now saved on NAV for processing.