I use the term broker and router very loosely here since they follow very similar guidelines as described here - WCF Broker Overview. Apologies for not being very rigid with these terms.
I will dive into best practices of building a router by progressing from a very simple implementation to a robust one through different scenarios and varying degrees of complexities.
The easiest implementation is by using a strongly typed contract with message forwarding as shown below.
public interface IOrderService
Order GetOrders(int numOrders);
Order GetOrders(int numOrders)
- Very easy to implement.
- Tight coupling between router and backend.
- The router needs to serialize and deserialize the whole message and hence very inefficient.
- Any change to backend would require changes to router as well.
- Not a scalable solution since higher loads would choke the server due to heavy serialization issues.
Next – Router Implementation – Message Forwarding – Copy/Pass through