Publish/subscribe messaging has been around for a long time. The concept is rather simple – a program can publish a message to a queue or a topic, while another program subscribes to the queue or the topic to receive published messages. There are a lot caveats in the model with conditional delivery, message filtering, message transformations, etc. In this post I will demonstrate the most basic form of publish/subscribe messaging. One client will be publishing basic string messages, while any number of other client apps can subscribe to receive published messages. Consider the following example:

Both samples above publish string messages to the “default” channel. A channel is a logical medium carrying the messages. Think of it as a pipe connecting publisher with the subscribers. You can use your own messaging channels in your app – Backendless lets you create any number of channels.