Messaging between producers and consumers (on-premise and Cloud based) with an on-premises messaging platform.

Pattern Definition
Problem | How do I send messages between on-premises producers and Cloud-based based consumers, or vice versa, using an on-premises messaging platform? | |
Context | This pattern is applicable when a message needs to be sent from an on-premises producer to a cloud-based consumer, or vice versa, from a cloud-based producer to an on-premises consumer. Cloud to Cloud messaging is also supported. The Messaging Platform is on premises. | |
Forces |
| |
Solution | An on-premises Messaging Platform facilitates messaging between on-premises producers and Cloud-based consumers, Cloud-based producers and on-premises consumers, Cloud-based produces and consumers, and on-premises producers and consumers. | |
Consequences | Pros:
|
Interaction View
- Point to Point Pull
- Point to Point Push
- Publish-Subscribe
- Transacted Request-Response
- Cloud to Cloud Pull
- Cloud to Cloud Push
- Transacted Request-Response for Cloud
Point-to-Point Pull
Point-to-point messaging between Cloud and on premises with message pull by consumer.

Interaction
Message transmitted from on premises to Cloud:
- On-premises message producer posts a message to the on-premises Messaging Platform.
- The Cloud-based messaged consumer polls the on-premises Messaging Platform for the message. The consumer may be SaaS, PaaS, or IaaS software.
Message transmitted from Cloud to on premises:
- The Cloud-based producer posts a message to the on-premises Messaging Platform. The producer may be SaaS, PaaS, or IaaS software.
- The on-premises message consumer polls the on-premises Messaging Platform for the message.
Notes
- The Messaging Platform must allow calls from the public Cloud.
- Message push eliminates the need for the message consumer to poll for messages.
- This interaction does not include the set-up calls to the Messaging platform to create messaging contexts, sessions, connections, queues, etc., used by the producers and consumers.
Point-to-Point Push
Point-to-point messaging between Cloud and on premises with message push to the consumer.

Interaction
Message transmitted from on premises to Cloud:
- The Cloud-based messaged consumer registers a listener for receiving messages from the Messaging Platform. The consumer may be SaaS, PaaS, or IaaS software.
- On-premises message producer posts a message to the on-premises Messaging Platform.
- The on-premises Messaging Platform pushes the message to the Cloud-based consumer using the listener the consumer registered.
Message transmitted from Cloud to on premises:
- The on-premises message consumer registers a listener for receiving messages from the on-premises Messaging Platform.
- The Cloud-based producer posts a message to the on-premises Messaging Platform. The producer may be SaaS, PaaS, or IaaS software.
- The on-premises Messaging Platform pushes the message to the on-premises consumer using the listener the consumer registered.
Notes
- The Messaging Platform must allow calls from the public Cloud.
- Message push eliminates the need for the message consumer to poll for messages.
- This interaction does not include the set-up calls to the Messaging platform to create messaging contexts, sessions, connections, queues, etc., used by the producers and consumers.
Publish-Subscribe
Publish and subscribe messaging between Cloud and on premises using either message pull by consumer or message push to consumer.

Interaction
Message transmitted from Cloud to on premises and vice versa:
- The Cloud-based and on-premises message consumers register listeners for receiving messages from the on-premises Messaging Platform. The consumer may be SaaS, PaaS, or IaaS software.
- The Cloud-based or on-premises message producer posts a message to a topic in the on-premises Messaging Platform.
- The on-premises Messaging Platform pushes the message to the Cloud-based consumer and the on-premises consumer using the listener that each consumer registered.
- The Cloud-based message consumer and the on-premises message consumer each poll the Messaging Platform for the message.
Notes
- The Messaging Platform must allow calls from the public Cloud.
- This interaction shows message consumers receiving a published message by both polling and pushing.
- This interaction shows two consumers on premises and in the Cloud, but there could be any number of consumers.
- Consumers can also register durable subscriptions so that messages are retained in the topic until the consumer receives the message (by either push or pull).
- This interaction does not include the set-up calls to the Messaging platform to create messaging contexts, sessions, connections, queues, etc., used by the producers and consumers
Transacted Request-Response
Request-response messaging using transactions to ensure request/response pairing.

Interaction
Message transmitted from Cloud to on premises:
- The Cloud-based producer posts a message to the Messaging Platform. The producer may be SaaS, PaaS, or IaaS software.
- The on-premises message responder starts a transaction with the on-premises Messaging Platform.
- The on-premises message responder retrieves a message from the Request Queue on the on-premises Messaging Platform.
Message transmitted from on premises to Cloud:
- The on-premises message responder posts a message to the Response Queue on the on-premises Messaging Platform.
- The on-premises message responder commits the transaction with the on-premises Messaging Platform. At this point, the message in the Request Queue is removed and the message in the Response Queue is available for retrieval by message consumers.
- The Cloud-based messaged consumer retrieves the message from the Response Queue of the on-premises Messaging Platform. The consumer may be SaaS, PaaS, or IaaS software.
Notes
- The Messaging Platform must allow calls from the public Cloud.
- This interaction shows the consumer receiving the messages via polling, but the consumer could alternatively register a listener and receive message via push.
- The locations could be reversed i.e. the responder could be cloud based and the producer and consumer could be on premises.
- This interaction does not include the set-up calls to the Messaging platform to create messaging contexts, sessions, connections, queues, etc., used by the producers and consumers.
Cloud to Cloud Pull
Point-to-point messaging between Clouds with message pull by consumer.

Interaction
Message transmitted from Cloud to Cloud:
- The Cloud-based message producer posts a message to the on-premises Messaging Platform.
- The Cloud-based messaged consumer polls the on-premises Messaging Platform for the message. The consumer may be SaaS, PaaS, or IaaS software.
Notes
- This pull interaction allows the consumer to check for messages when it is ready to handle the message.
- The Messaging Platform must allow calls from the public Cloud.
- This interaction does not include the set-up calls to the Messaging Platform to create messaging contexts, sessions, connections, queues, etc., used by the producers and consumers.
Cloud to Cloud Push
Point-to-point messaging between Clouds with message push to the consumer.

Interaction
Message transmitted from Cloud to Cloud:
- The Cloud-based messaged consumer registers a listener for receiving messages from the Messaging Platform. The consumer may be SaaS, PaaS, or IaaS software.
- The Cloud-based message producer posts a message to the on-premises Messaging Platform.
- The Cloud-based Messaging Platform pushes the message to the Cloud-based consumer using the listener the consumer registered.
Notes
- The Messaging Platform must allow calls from the public Cloud.
- Message push eliminates the need for the message consumer to poll for messages.
- This interaction does not include the set-up calls to the Messaging platform to create messaging contexts, sessions, connections, queues, etc., used by the producers and consumers
Transacted Request-Response for Cloud
Request-response messaging using transactions to ensure request/response pairing.

Interaction
Message transmitted from Cloud to Cloud:
- The Cloud-based producer posts a message to the Messaging Platform. The producer may be SaaS, PaaS, or IaaS software.
- The Cloud-based message responder starts a transaction with the on-premises Messaging Platform.
- The Cloud-based message responder retrieves a message from the Request Queue on the on-premises Messaging Platform.
- The Cloud-based message responder posts a message to the Response Queue on the on-premises Messaging Platform.
- The Cloud-based message responder commits the transaction with the on-premises Messaging Platform. At this point, the message in the Request Queue is removed and the message in the Response Queue is available for retrieval by message consumers.
- The Cloud-based messaged consumer retrieves the message from the Response Queue of the on-premises Messaging Platform. The consumer may be SaaS, PaaS, or IaaS software.
Notes
- The Messaging Platform must allow calls from the public Cloud.
- Message push eliminates the need for the message consumer to poll for messages.
- This interaction does not include the set-up calls to the Messaging platform to create messaging contexts, sessions, connections, queues, etc., used by the producers and consumers.