Option to disable file perstistence?

Hello,
I wonder if there is any option to disable creation of “data” folder used for persistence.
Situation looks like this:

  • embedded MQTT broker (hivemq-community-edition-embedded-2022.1)
  • everything related to persistence configured with “in-memory” mode at the “config.xml”

So everything which could be persisted is set to “in-memory”. Despite this, HiveMQ always creates a data folder which grow with (short) time up to 1,6 GB. “retained_messages” occupies the most space.

Is there any possibility to disable completely creation of “data” folder if it is not used in case of “in-memory” persistence? If not maybe there is some option to reduce the reserved disk space?

Best regards
Marcin

Hi Marcin Kokoszka,

Were you ever able to find a solution? If not, would you be able to share the config.xml being used for further analysis?

Thanks,
Seth - HiveMQ Support

Hello Seth.HiveMQ,

unfortunately I did not find any solution. My configuration looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<hivemq>
    <anonymous-usage-statistics>
        <enabled>false</enabled>
    </anonymous-usage-statistics>
    <general>
        <update-check-enabled>false</update-check-enabled>
    </general>
    <listeners>
        <tcp-listener>
            <bind-address>xxx.xxx.xxx.xxx</bind-address>
            <name>IPv4-interface</name>
            <port>1883</port>
        </tcp-listener>
        <websocket-listener>
            <allow-extensions>true</allow-extensions>
            <bind-address>>xxx.xxx.xxx.xxx</bind-address>
            <name>IPv4-websocket-interface</name>
            <path>/</path>
            <port>8883</port>
            <subprotocols>
                <subprotocol>mqttv3.1</subprotocol>
                <subprotocol>mqtt</subprotocol>
            </subprotocols>
        </websocket-listener>
    </listeners>
    <persistence>
        <attribute>
            <mode>in-memory</mode>
        </attribute>
        <client-group>
            <mode>in-memory</mode>
        </client-group>
        <client-session>
            <general>
                <mode>in-memory</mode>
            </general>
            <queued-messages>
                <mode>in-memory</mode>
            </queued-messages>
            <subscriptions>
                <mode>in-memory</mode>
            </subscriptions>
        </client-session>
        <message-flow>
            <incoming>
                <mode>in-memory</mode>
            </incoming>
            <outgoing>
                <mode>in-memory</mode>
            </outgoing>
        </message-flow>
        <publish-payloads>
            <mode>in-memory</mode>
        </publish-payloads>
        <retained-messages>
            <mode>in-memory</mode>
        </retained-messages>
    </persistence>
</hivemq>

Any idea why data folder size is so big even if I do not use any file persistence?
Maybe I missed something at the configuration?

Best regards
Marcin Kokoszka

Hi ​Marcin Kokoszka,

Are you able to share which version of HiveMQ you have downloaded? (the Community Edition from our github, or the mainline trial version from our website)

Thanks,
Seth - HiveMQ Support

Hello Seth.HiveMQ,

sorry for late response. I was offline for some longer time.
I use the version loaded from GitHub - community edition.
This version: hivemq-community-edition-embedded-2022.1

Best regards
Marcin

Hi again Marcin,

I was double-checking your given config.xml against our HiveMQ Community Edition documentation for the in-memory persistence settings, and noticed a number of differences.

Take a look:
https://github.com/hivemq/hivemq-community-edition/wiki/Configuration#in-memory-persistence

For current CE versions, I believe you only need the one element, and it covers all the cases outlined in the documentation section. Does switching to the documentation options work?

Can I also ask what you were following to generate the config.xml options you pasted to this topic? This may help in understanding how we can better present/direct to the CE documentation.

Thanks,
Seth - HiveMQ Support

1 Like

Hi Seth,

so I took the examples for configuration from official documentation (from here: Configuration :: HiveMQ Documentation)
And probably it was my mistake. Now when I changed to this:

<persistence>
        <mode>in-memory</mode>
 </persistence>

the files at the “data” folder are not created.

Thanks for the hint. I was not aware that there are so big differences at the configuration between community and official versions.

Best regards
Marcin

1 Like

Hi Marcin,

Not at all, I am glad I was able to help you get on track!

Now I see the issue, I believe the documentation you were following was from our old HiveMQ 3 version (which did have similar configuration options as the current Community Edition from what I’ve seen) :

vs the current HiveMQ 3 → 4 migration documentation for our full product:
https://www.hivemq.com/docs/hivemq/4.11/upgrade/threetofour.html#persistence

Did you find the older guide from a search engine query perhaps? I’m hoping to take some info back internally from working on this thread with you! We definitely don’t want people to stumble across outdated info when possible.

Thanks,
Seth - HiveMQ Support

Hi Seth,

it seems that it is my fault. I found this documentation via google search and I did not pay attention that it is manual for older version of the HiveMQ. I mixed also official version with community edition as I was searching for description on official HiveMQ web page, not on GitHUB.

Once again, thanks a lot for you help.

Best regards
Marcin