# Stream / Jetstream persistence of topics

**URL:** <https://community.hivemq.com/t/stream-jetstream-persistence-of-topics/2668>\
**Category:** HiveMQ Community Edition\
**Created:** [January 31, 2024, 4:16pm UTC](https://community.hivemq.com/t/stream-jetstream-persistence-of-topics/2668 "2024-01-31T16:16:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PatientParrot](https://avatars.discourse-cdn.com/v4/letter/p/4491bb/32.png) [@PatientParrot](https://community.hivemq.com/u/PatientParrot)\
**Post date:** [January 31, 2024, 4:16pm UTC](https://community.hivemq.com/t/stream-jetstream-persistence-of-topics/2668/1 "2024-01-31T16:16:22Z")

</div>

Hey HiveMQ-Team,

I am recently comparing message brokers.

Therefore I read your guide on [persistence](https://www.hivemq.com/blog/mqtt-essentials-part-7-persistent-session-queuing-messages/).  
Nevertheless I am not sure whether my specific usecase is met.

* * *

------ Scenario ------

Imagine an **AuthorizationServer** (one or many instances), which publishes its rotating asymetric **PublicKey** on a messageQueue (e.g. topic = secKeys).

There are other instances in the service mesh - lets call them **clients**.  
The **clients** need the PublicKeys for Token validation and do not know the location of the AuthorizationServers. They have to rely on the secKey topic for PublicKey retreival.

The keys are rotated weekly.  
Hence, if a client is booted with bad timing (e.g. update), it will not receive a publickey for 5+ days although connected with HiveMQ-Persistence.

* * *

Is there a feature in HiveMQ which acts alike the “NATS JetStream” feature?  
 → [JetStream - NATS Docs](https://docs.nats.io/nats-concepts/jetstream)

Messages are persisted for all clients (even NewBees) until:  
… expiry on TimeToLive  
… deletion on Acknowledge

Best wishes,  
Parrot

---

<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, 2024, 4:48pm UTC](https://community.hivemq.com/t/stream-jetstream-persistence-of-topics/2668/2 "2024-01-31T16:48:43Z")

</div>

Hi @PatientParrot

Welcome to the HiveMQ community! It’s great to have you here.

In response to your query, HiveMQ Community Edition doesn’t have built-in support for a feature exactly like NATS JetStream. However, HiveMQ does provide features for message persistence and retention.

For your specific use case, you might consider using the [retained messages.](https://www.hivemq.com/blog/mqtt-essentials-part-8-retained-messages/) For example, you could publish the rotating asymmetric PublicKey to the ‘secKeys’ topic as retained, to ensure that any client that subscribes to this topic, even if they missed an update due to being offline, will receive the latest PublicKey upon re-connect and re-subscribed.

I hope it helps,  
Dasha from HiveMQ Team

---

<div class="post-metadata">

**Author:** ![PatientParrot](https://avatars.discourse-cdn.com/v4/letter/p/4491bb/32.png) [@PatientParrot](https://community.hivemq.com/u/PatientParrot)\
**Post date:** [January 31, 2024, 6:14pm UTC](https://community.hivemq.com/t/stream-jetstream-persistence-of-topics/2668/3 "2024-01-31T18:14:44Z")

</div>

Thanks for the fast reply - I’ll take a look next days 😉
