Understanding Solace Delivery Modes: Promotion & Demotion
Tags: fordevelopers
Published: 2020-11-17 19:57:44

---
title: Understanding Solace Delivery Modes: Promotion & Demotion
published: true
date: 2020-10-23 13:02:49 UTC
tags: ForDevelopers
canonical_url: https://solace.com/blog/message-promotion-demotion/
---

 ![](https://solace.com/wp-content/uploads/2020/10/solace-blog-featured-image_promotion-demotion.jpg) 

In a previous blog post I explained the two delivery modes that Solace supports: [direct messaging and persistent messaging](https://solace.com/blog/delivery-modes-direct-messaging-vs-persistent-messaging/), which is also called guaranteed messaging. In this blog post I will explain the promotion and demotion of messages.

Before diving in to message promotion and demotion, it’s important to understand the basics of [publish/subscribe messaging](https://solace.com/blog/publish-subscribe-messaging-pattern/). In short, it’s a message exchange pattern that lets applications send (publish) information (as messages) to a topic (a message property represented by a text string) that indicates what the message is about, and applications that want that kind of information can subscribe to receive all messages with topics that indicate information they want to receive. This makes it easy and efficient to fan messages out to any number of interested applications without any configuration or overhead.

[![](https://solace.com/wp-content/uploads/2020/10/message-promotion-demotion_pic-01-1024x698.png)](https://solace.com/wp-content/uploads/2020/10/message-promotion-demotion_pic-01.png)

Another thing you need to understand before we dive in to message promotion and demotion is that [topics can be mapped to queues](https://solace.com/blog/topic-subscription-queues/). A topic subscription (i.e. that is, the means by which applications express interest in a given topic) can be applied to a queue. A [queue](https://solace.com/blog/queues-vs-topic-endpoints/) is an object on the Solace [PubSub+ Event Broker](https://solace.com/products/event-broker/) that stores messages (hence the term “persistent”) for an application to receive later. Applying a topic subscription to a queue means messages matching that subscription will be received and buffered by the queue.

[![](https://solace.com/wp-content/uploads/2020/10/message-promotion-demotion_pic-02.png)](https://solace.com/wp-content/uploads/2020/10/message-promotion-demotion_pic-02.png)

## Message Promotion

Message promotion occurs when a message that was published as direct ends up on an endpoint, which effectively guarantees its delivery. A direct message can end up on an endpoint when the endpoint’s topic subscription matches the message’s topic. In the below example, we can see the direct message is published to topic “a/b/c”. The queue subscription is “a/b/>”, which matches the published topic. The message is still received by the direct subscriber because of the subscription “a/b/c” and is also saved in the queue.

[![](https://solace.com/wp-content/uploads/2020/10/message-promotion-demotion_pic-03-1024x429.png)](https://solace.com/wp-content/uploads/2020/10/message-promotion-demotion_pic-03.png)

It is important to note that the message saved onto the queue has a change in delivery mode. Because the message was published as direct but is now saved in a queue making it act as a guaranteed or persistent message, the event broker changes the delivery mode to Solace ‘non-persistent’ to indicate to the consuming application that the message was promoted.

## Message Demotion

Message demotion, on the other hand, occurs when a message published as persistent matches a direct topic subscription. In this case the message delivery mode is changed from ‘persistent’ to ‘direct’ for the direct subscriber, but the message is still acknowledged to the publishing application once it has been saved in the receiving endpoint(s).

[![](https://solace.com/wp-content/uploads/2020/10/message-promotion-demotion_pic-04-1024x429.png)](https://solace.com/wp-content/uploads/2020/10/message-promotion-demotion_pic-04.png)

## Considerations

It’s important to know that direct messages, even when promoted, are never acknowledged to the initial publisher. When a higher quality of service is required, you should always publish messages as persistent.

You need to be wary of message promotion, because it can put unwanted backpressure on saving messages to an endpoint. Message promotion should be avoided whenever possible by ensuring that endpoint subscriptions do not match published direct messages.

## Conclusion

I hope I’ve helped you understand the concept of message promotion and demotion. If you found this post useful, visit [this section of our docs](https://docs.solace.com/PubSub-Basics/Core-Concepts-Message-Delivery-Modes.htm#Message), and our [PubSub+ for Developers](https://www.solace.dev/) page for more information. If you have any questions about message promotion and demotion, our [developer community](https://solace.community/) is a great place to pose questions and see what your fellow developers are talking about.

The post [Understanding Solace Delivery Modes: Promotion & Demotion](https://solace.com/blog/message-promotion-demotion/) appeared first on [Solace](https://solace.com).