# Can't add permission to topic starting with $

**URL:** https://community.hivemq.com/t/cant-add-permission-to-topic-starting-with/82
**Category:** HiveMQ Community Edition
**Created:** [September 13, 2019, 2:09pm UTC](https://community.hivemq.com/t/cant-add-permission-to-topic-starting-with/82 "2019-09-13T14:09:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bgu](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@bgu](https://community.hivemq.com/u/bgu)
#### Post date: [September 13, 2019, 2:09pm UTC](https://community.hivemq.com/t/cant-add-permission-to-topic-starting-with/82/1 "2019-09-13T14:09:53Z")

</div>

Hi there,

I noticed that I can’t add default permissions to a topic starting with `$` (more precisely, `$EDC`). No error is raised when adding the permission, but later when a client tries to publish on that topic, it gets disconnected. If I replace the dollar with an underscore, everything works fine. I know the `$` has a special meaning, but I can’t find anything in the documentation regarding authentication that may explain this behaviour.

Here a very simplified snippet of my code (in my own implementation of the `SimpleAuthenticator` interface):

```
public void onConnect(@NotNull final SimpleAuthInput input, @NotNull final SimpleAuthOutput output) {
    var permissions = output.getDefaultPermissions();
    permissions.add(topicPermission().topicFilter("$EDC/blabla").build());
    output.authenticateSuccessfully();
}

```

Any help or explanation on this? Thanks a lot in advance.

---

<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: [September 13, 2019, 4:12pm UTC](https://community.hivemq.com/t/cant-add-permission-to-topic-starting-with/82/2 "2019-09-13T16:12:57Z")

</div>

Hi @bgu,

HiveMQ CE as well as HiveMQ 4 PE and EE prohibit the use of topics starting with ‘$’.  
Exception being the shared subscription syntax.

[See MQTT specification](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901246):

> The Server MUST NOT match Topic Filters starting with a wildcard character (# or +) with Topic Names  
> beginning with a $ character [MQTT-4.7.2-1]. The Server SHOULD prevent Clients from using such Topic Names to exchange messages with other Clients. Server implementations MAY use Topic Names that start with a leading $ character for other purposes.

Kind regards,  
Florian from the HiveMQ Team.

---

<div class="post-metadata">

### Author: ![bgu](https://avatars.discourse-cdn.com/v4/letter/b/ea666f/32.png) [@bgu](https://community.hivemq.com/u/bgu)
#### Post date: [September 16, 2019, 8:54am UTC](https://community.hivemq.com/t/cant-add-permission-to-topic-starting-with/82/3 "2019-09-16T08:54:00Z")

</div>

> The Server SHOULD prevent Clients from using such Topic Names to exchange messages with other Clients

Ahhh ok, I didn’t know that. I guess it’s new in MQTT 5.

Thanks a lot.
