Skip Navigation LinksAzure Developers Guide > Azure Service Bus > Brokered Messaging > Using Topics and Subscriptions > Publish-Subscribe Messaging

Training Courses

All course material is in English, and courses are delivered in English. Feel free to contact me for further information. cloudcasts.net@gmail.com

Publish-Subscribe Messaging

In Service Bus brokered messaging a queue is used to implement a point-to-point message channel. This ensures that messages sent on the message channel will only be received by one receiver. Point-to-point message channels are most useful when an application will send messages to another application.

The Enterprise Integration Patterns website provides a description of the Point-to-Point Channel pattern here.

 

In some scenarios a message that is sent by an application will need to be received by several other applications. Consider an order processing scenario where order messages are created by a point of sale application in a store. The order message will need to be sent to the line-of-business application that handles the finance aspects of the organization. It will also need to be sent to the warehouse application that will need to be aware that products have been sold so it can restock those products. If the customer has a loyalty card the order details will need to be sent to an application that assimilates information about the customers purchasing habits.

If point-to-point channels was used for this scenario the point of sale terminal would have the responsibility of sending the order messages to the various systems. If systems were later added or modified this would mean modifying the point of sale application. In scenarios where many line of business systems are exchanging messages with many other systems the point-to-point channels pattern can become unmanageable.

Publish-subscribe channels provide a way of removing the sender of the responsibility of sending messages to specific applications. The logic that decides where the messages will be sent is contained within the message channel. Publish-subscribe channels also allow for one input message result in a number of output messages being sent to different systems based on this routing logic.

The Enterprise Integration Patterns website provides a description of the Publish-Subscribe Channel pattern here.

 

It is possible to create a point-to-point message channel using a topic with one subscription. This may be desirable in scenarios where changes are likely to be made to systems running in production. Be aware that the entity hour pricing model for Service Bus brokered messaging services may make this more expensive than using a single queue, and there may be a small additional overhead in message processing.

Speaking Engagements