public interface PersistenceConfig extends Config
By default the persistence service is not enabled. Enabling persistence will cause all topics and updates to those topics to be persisted to files enabling the topics to be restored when the server is restarted.
When a server is started and persistence is on, the topic tree will be restored from existing persistence files. This will happen concurrently with connecting client sessions, replication and fan-out and the persistence system will resolve any conflicts.
Topic events (such as the creation of topics, updates to topics and removal of topics) are written to 'append only' files as they occur. To manage the size of these files they are periodically switched out of service so that they can be made available for 'compaction'.
The process of 'compaction' involves reading existing files, removing redundant information (for example, removed topics and anything but the last update to each topic) and then writing back a single 'compacted' file.
Modifier and Type | Method and Description |
---|---|
boolean |
isEnabled()
Indicates whether the persistence service is enabled.
|
void |
setEnabled(boolean enabled)
Enable or disable the persistence service.
|
void setEnabled(boolean enabled) throws ConfigException
The service is disabled by default.
enabled
- true to enable the persistence serviceConfigException
- if the configuration is locked
boolean isEnabled()
setEnabled(boolean)
Copyright © 2022 Push Technology Ltd. All Rights Reserved.