I need to integrate a third party WebService into a messaging based architecture. We are using NServiceBus.
From a PluralSight course on NServiceBus, it was recommended that when integrating a WebService, to create a specific WebService gateway endpoint for this integration.
The 3rd party WebService has API methods for pulling down notifications and acknowledging these. A client of this WebService is required to regularly (for example every 15 mins) pull notifications and acknowledge each of these notifications when correctly processed.
The suggested flow would be as follows:
My questions are:
Cheers
I don't think it is a code smell. I've done this several times myself. It's a reliable way of ensuring an interaction with a dependency occurs successfully.
I would lean on acknowledgements being driven from events. This will allow more extensible points in your software. For example: CreateCustomer
command would publish CustomerCreated
event. UpdateCustomer
command would publish CustomerUpdated
event.
You can have one handler handle both events generically and submit an acknolwedgement AckHandler: IHandle<CustomerCreated>, IHandle<CustomerUpdate>
.
But to recap to your actual question, I don't believe it is a code smell.
(Next time I suggest creating a separate question all together)
As for hosting in Azure, I would probably lean towards hosting them in a WebJob. The WebApp is just a hosting platform and can host both a WebSite AND a series of WebJobs. They are a little cheaper with less control but super easy scaling story.
Remember, before you need to scale horizontally, you can scale the vertically by tweaking the concurrency setting of each host to find the right amount of threads it can handle (NSB < 5 is max 20 threads; NSB >=6 is 100 threads).
You can host them all in one to start out with.