# Can we read data from special topic like dropped or dead in hivemq. If yes then How we can read and will there be any consequences by doing this?

**URL:** <https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982>\
**Category:** HiveMQ Community Edition\
**Created:** [January 30, 2022, 4:02pm UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982 "2022-01-30T16:02:40Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rahul](https://community.hivemq.com/u/Rahul)\
**Post date:** [January 30, 2022, 4:02pm UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/1 "2022-01-30T16:02:40Z")

</div>

Can we read data from special topic like dropped or dead in hivemq. If yes then How we can read and will there be any consequences by doing this ?

We have hivemq enterprise edition as well.

---

<div class="post-metadata">

**Author:** ![hivemq-support](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.hivemq.com/hivemq-support/32/357_2.png) [@hivemq-support](https://community.hivemq.com/u/hivemq-support)\
**Post date:** [January 30, 2022, 9:25pm UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/2 "2022-01-30T21:25:51Z")

</div>

Hi @Rahul,

HiveMQ Community Edition does not support the [MQTT Topic Add-ons](https://www.hivemq.com/docs/hivemq/4.7/user-guide/mqtt-add-ons.html#analytical-topics), which are part of HiveMQ Professional and Enterprise Edition.  
In case you are using a licensed version of HiveMQ you can follow the linked documentation to enable the `$dropped`, `$expired` and `$dead` topic.

Kind regards,  
Florian

---

<div class="post-metadata">

**Author:** ![Rahul](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rahul](https://community.hivemq.com/u/Rahul)\
**Post date:** [January 31, 2022, 5:58am UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/3 "2022-01-31T05:58:32Z")

</div>

Hi Feaschbi,

Thanks for the update !

Is there any way to see hivemq dead/expired messages somewhere because I can’t see these messages on control center.

Thanks

---

<div class="post-metadata">

**Author:** ![Daria\_H](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@Daria\_H](https://community.hivemq.com/u/Daria_H)\
**Post date:** [January 31, 2022, 9:15am UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/4 "2022-01-31T09:15:01Z")

</div>

Hi Rahul,

As Florian has explained above, $dead/$dropped/$expired HiveMQ Add-ons, are available with Professional and Enterprise flavour.  
To “see” these topics, on the broker side, the corresponding Add-ons need to be enabled in the `config.xml` and your clients should be given permissions to these topics. You can find the details in our documentation: [MQTT Topic Add-ons](https://www.hivemq.com/docs/hivemq/4.7/user-guide/mqtt-add-ons.html#analytical-topics).  
In case if you have further questions, please do not hesitate to ask us

Kind regards,  
Dasha from HiveMQ Team

---

<div class="post-metadata">

**Author:** ![Rahul](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rahul](https://community.hivemq.com/u/Rahul)\
**Post date:** [January 31, 2022, 10:28am UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/5 "2022-01-31T10:28:49Z")

</div>

Hi Daria\_H,

I have done configuration for special topic.  
  
  
true  
  
  
true  
  
  
true

Just wanted to know do we have any visibility on hivemq web ui for dead/expired messages like we have for dropped message in hivemq ?

Thanks

---

<div class="post-metadata">

**Author:** ![Rahul](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rahul](https://community.hivemq.com/u/Rahul)\
**Post date:** [January 31, 2022, 10:31am UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/6 "2022-01-31T10:31:00Z")

</div>

Look like some issue with XML

attaching the screenshot for config.

 ![Screenshot (103)](https://canada1.discourse-cdn.com/flex035/uploads/hivemq1/original/1X/f930fbe5a25085f3742a0bf3974225fb6fee08db.png)

---

<div class="post-metadata">

**Author:** ![Daria\_H](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@Daria\_H](https://community.hivemq.com/u/Daria_H)\
**Post date:** [January 31, 2022, 4:26pm UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/7 "2022-01-31T16:26:18Z")

</div>

Hi Rahul,

You have asked “Just wanted to know do we have any visibility on hivemq web ui for dead/expired messages like we have for dropped message in hivemq ?” – No, you can only subscribe a client to the corresponding $expired/ $dead/ or $dropped/topic.

The configuration where you enable the Mqtt-Addons should be in the config.xml file of the HiveMQ Broker.

Kind regards,  
Dasha from HiveMQ team

---

<div class="post-metadata">

**Author:** ![Rahul](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rahul](https://community.hivemq.com/u/Rahul)\
**Post date:** [February 1, 2022, 5:59am UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/8 "2022-02-01T05:59:59Z")

</div>

Hi Daria,

Thanks for the update.

I have made changes in config.xml by adding mqtt-add-on. Actually, I’m looking how can we generate dead message scenario so that I can subscribe ?

Thanks !

---

<div class="post-metadata">

**Author:** ![Daria\_H](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@Daria\_H](https://community.hivemq.com/u/Daria_H)\
**Post date:** [February 1, 2022, 10:39am UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/9 "2022-02-01T10:39:24Z")

</div>

Hi Rahul,

You have asked " how can we generate dead message scenario so that I can subscribe". Advice: Next time please specify what scenario(s) you have already tried and what did not work – that will make our conversation more productive.

I have “generated dead message scenario” in the following way:

Step 1. Enable the dead-topic MQTT add-on. Update config.xml with

```auto
    <mqtt-addons>
        <dropped-messages-topic>
            <enabled>true</enabled>
        </dropped-messages-topic>
    </mqtt-addons>

```

Step 2. Subscribe a client to the dead topic (I am using MQTT CLI):

```auto
mqtt sub -t '$dead/#' -i 'dmtSubscriber' -J -d -V 5

```

Step 3. Publish a message to the topic having no subscriber:

```auto

mqtt pub -i 'deadPublisher' -t 'topicToDieFor' -m "Dead message" -d -V 5

```

Actual result: The subscriber receives the “dead” message

```auto
{
  "topic": "$dead/topicToDieFor",
  "payload": "Dead message",
  "qos": "AT_MOST_ONCE",
  "receivedAt": "2022-02-01 11:34:25",
  "retain": false,
  "userProperties": {
    "hmq-dead-origin": "client",
    "hmq-dead-client": "deadPublisher",
    "hmq-dead-timestamp": "1643711665348"
  }
}
Client 'dmtSubscriber@localhost' received PUBLISH ('Dead message') MqttPublish{topic=$dead/topicToDieFor, payload=12byte, qos=AT_MOST_ONCE, retain=false, userProperties=[(hmq-dead-origin, client), (hmq-dead-client, deadPublisher), (hmq-dead-timestamp, 1643711665348)]}

```

I hope this helps,  
Kind regards  
Dasha from HiveMQ team

---

<div class="post-metadata">

**Author:** ![Rahul](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rahul](https://community.hivemq.com/u/Rahul)\
**Post date:** [February 1, 2022, 12:08pm UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/10 "2022-02-01T12:08:14Z")

</div>

Hi Daria\_H,

Thanks for the quick response.

You have enabled only dropped message topic. Will that work for dead message because I have enabled all three special topics.

```auto
<mqtt-addons>
        <dead-messages-topic>
            <enabled>true</enabled>
        </dead-messages-topic>
		<dropped-messages-topic>
            <enabled>true</enabled>
        </dropped-messages-topic>
		<expired-messages-topic>
            <enabled>true</enabled>
        </expired-messages-topic>
</mqtt-addons>

```

In my case  
Step1 : Publishing message to random topic  
Step 2 : Subscribing message from $dead/# topic

result : unable to read data from dead topic after following above steps.

Please have a look on it.

Thanks !

---

<div class="post-metadata">

**Author:** ![hivemq-support](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.hivemq.com/hivemq-support/32/357_2.png) [@hivemq-support](https://community.hivemq.com/u/hivemq-support)\
**Post date:** [February 1, 2022, 12:27pm UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/11 "2022-02-01T12:27:10Z")

</div>

Hi @Rahul,

You need to subscribe to the `$dead` topic first, before you publish the message to capture it being republished.  
You cannot “read from topics” in MQTT. Topics are communication channels on which messages are distributed in-flight.

See the [MQTT Essentials](https://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices/) for more details.

Best,  
Florian

---

<div class="post-metadata">

**Author:** ![Rahul](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rahul](https://community.hivemq.com/u/Rahul)\
**Post date:** [February 1, 2022, 12:34pm UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/12 "2022-02-01T12:34:36Z")

</div>

Hi Florian,

It’s my bad. Yes I understood we can not read from topics but I was trying to say subscribing instead of reading term in above message.

My subscriber is already attached to the ‘$dead/#’ topic and publishing message to ‘test’ topics which is not attached to the any subscriber, But still unable to subscribe any records from ‘$dead/#’ topics.

Hivemq add-on I have mentioned in above messages.

And Lastly, I’m using hiveme docker 4.5 image with enterprise edition.

Thanks !

---

<div class="post-metadata">

**Author:** ![Daria\_H](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@Daria\_H](https://community.hivemq.com/u/Daria_H)\
**Post date:** [February 1, 2022, 12:43pm UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/13 "2022-02-01T12:43:55Z")

</div>

Hi Rahul,

In order to get help troubleshooting this issue, you please post your “subscribe” and “publish” commands here, see example in my post.

Thanks!  
Dasha from HiveMQ team

---

<div class="post-metadata">

**Author:** ![Rahul](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rahul](https://community.hivemq.com/u/Rahul)\
**Post date:** [February 1, 2022, 1:54pm UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/14 "2022-02-01T13:54:22Z")

</div>

Hi Daria\_H,

I have been using MqttFx client for testing and connectivity purpose.

Here is a screen shot which I have been trying.

 ![MqttFx](https://canada1.discourse-cdn.com/flex035/uploads/hivemq1/original/1X/1eb0571ff9348a636ed9cb311dc5ce46603b4459.png)

---

<div class="post-metadata">

**Author:** ![michael\_w](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.hivemq.com/michael_w/32/200_2.png) [@michael\_w](https://community.hivemq.com/u/michael_w)\
**Post date:** [February 1, 2022, 2:03pm UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/15 "2022-02-01T14:03:38Z")

</div>

Hi @Rahul,

can you please post your config.xml, not that there is a misconfiguration and the special topics aren’t enabled. Also what HiveMQ version are you using? The dead topic is a feature we shipped with 4.6

Edit: I saw this line:

> And Lastly, I’m using hiveme docker 4.5 image with enterprise edition.

This means the $dead topic is not supported in the HiveMQ version you are using, you’ll have to use at least HiveMQ 4.6.0.

Greetings,  
Michael from the HiveMQ team

---

<div class="post-metadata">

**Author:** ![Rahul](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rahul](https://community.hivemq.com/u/Rahul)\
**Post date:** [February 1, 2022, 2:10pm UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/16 "2022-02-01T14:10:44Z")

</div>

Hi Michael,

Thanks for your response.

I’m using Hivemq 4.5 version. I think, I have to upgrade the hivemq version.

Please provide response for below queries if possible.  
What about the ‘$expired/#’ topic ?  
How ‘$expired/#’ topic will behave in mqtt 3.1 versus mqtt 5 ?

Thanks !

---

<div class="post-metadata">

**Author:** ![michael\_w](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.hivemq.com/michael_w/32/200_2.png) [@michael\_w](https://community.hivemq.com/u/michael_w)\
**Post date:** [February 1, 2022, 2:22pm UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/17 "2022-02-01T14:22:27Z")

</div>

Hi @Rahul,

yes you’ll have to upgrade to at least 4.6.0.

The “special” topics don’t really differentiate between MQTT 3 or MQTT 5. So when an MQTT publish expires, be it from an MQTT 3 or MQTT 5 client, it will be sent to $expired/. Same applies to $dead and $dropped.

Greetings,  
Michael from the HiveMQ team

---

<div class="post-metadata">

**Author:** ![Rahul](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rahul](https://community.hivemq.com/u/Rahul)\
**Post date:** [February 1, 2022, 2:26pm UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/18 "2022-02-01T14:26:33Z")

</div>

Hi @michael_w,

I have gone through the blog. According to that, we can not define expiry time interval for a message in 3.1.1 mqtt protocol implementation that only possible in mqtt 5 protocol.

Could you please have a look on it ?

> **[MQTT 5: How the session expiry interval and message expiry interval features...](https://www.hivemq.com/blog/mqtt5-essentials-part4-session-and-message-expiry/)**
>
> How the MQTT 5 session and message expiry interval features work and what you need them for.

Thanks !

---

<div class="post-metadata">

**Author:** ![michael\_w](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.hivemq.com/michael_w/32/200_2.png) [@michael\_w](https://community.hivemq.com/u/michael_w)\
**Post date:** [February 1, 2022, 2:33pm UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/19 "2022-02-01T14:33:52Z")

</div>

Hi @Rahul,

yes you are correct, maybe I should have explained that a little more. HiveMQ allows you to apply many of the MQTT 5 features to MQTT 3 clients/packets (like setting a message expiry for an MQTT 3 publish).

This can be done with:

- via config.xml: [HiveMQ Configuration :: HiveMQ Documentation](https://www.hivemq.com/docs/hivemq/latest/user-guide/configuration.html#message-expiry)
- via extension sdk: [Interceptors :: HiveMQ Documentation](https://www.hivemq.com/docs/hivemq/latest/extensions/interceptors.html#publish-inbound-modify) (see the line `publish.setMessageExpiryInterval(120L);`)

Greetings,  
Michael

---

<div class="post-metadata">

**Author:** ![Rahul](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@Rahul](https://community.hivemq.com/u/Rahul)\
**Post date:** [February 1, 2022, 2:48pm UTC](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982/20 "2022-02-01T14:48:04Z")

</div>

Hi @michael_w ,

Thanks for the quick response & solutions.

Thanks!

[Next page](https://community.hivemq.com/t/can-we-read-data-from-special-topic-like-dropped-or-dead-in-hivemq-if-yes-then-how-we-can-read-and-will-there-be-any-consequences-by-doing-this/982.md?page=2)
