About direct and brokered messaging

Damir Dobric Posts

Next talks:



Follow me on Twitter: #ddobric





When multiple systems are connected to each other different connecting patterns can be used. Most typical kind of connection is called direct messaging. This is not related to terms like direct TCP connection or request response HTTP messaging. When we are trying to connect systems usually we do it with WCF. That means, we will try to abstract (decouple) the transport from contract. By using this approach we do not think about transport and this is why we do not think TCP direct or HTTP req/resp when we say direct connection. Direct means in this context, one system is sending message to another system by using any kind of protocol without of some intermediary between them. Router in this context is not in a role of an intermediary, because it is a part of infrastructure.
Typical example of such systems is typical WCF client/service scenario. Windows community calls this client/service, but the right term would be rather consumer/service, which is usually used in JAVA community.


Additionally to classical direct messaging (consumer sends messages to service), we also have a relayed messaging as an important pattern introduced by Windows Azure Service Bus.In relayed system, participants use some kind of intermediary usually called relay. However the relay establish always a direct connection between participants in the system. This is why the relaying is direct messaging, although it uses “something” between participants.


Typical example of relayed system is service consumer communication through Windows Azure Service Bus relay bindings.

Another important communication pattern is brokered messaging. This pattern assumes existence of an intermediary system between sender and receiver of the message. In contrast to relay there is  one broker between participants, which decuples them. When the broker is used in communication system, all participants are decoupled and we usually do not use terms service and consumer. Instead we use terms like sender and receiver.


Typical example of brokered messaging is Windows Azure Service Bus queue and topic based system

Direct and relayed messaging are subject to backpressure from the consumer. Systems which use direct messaging are limited by speed of consumption of messages by consumer. The consumption of message might directly influence the speed of production of the message. Such systems are usually limited in scale. in contract to systems with brokered messaging.  By definition, brokered messaging always uses an intermediate store to consume and durably persist messages. Consumers are responsible to pool messages. In brokered systems producer and consumer can scale independently. Usually communication between participants and broker is transaction safe.

Posted Jun 17 2012, 08:01 PM by Damir Dobric
Filed under: , , , , ,


Damir Dobric Posts wrote Service Bus Server is not an ESB product
on 08-01-2012 8:23

Service Bus 1.0 (also called Service Bus Server) is a Microsoft messaging product, which many people

Damir Dobric Posts wrote Is Service Bus Server an ESB product?
on 08-01-2012 10:47

Service Bus 1.0 (also called Service Bus Server) is a Microsoft messaging product, which many people

developers.de is a .Net Community Blog powered by daenet GmbH.