If we have a case in which there is a long running durable subscription that is consuming less messages than a producer is creating. If the durable subscription then decides to unsubscribe the kahadb will perform a cleanup. As part of the cleanup it will determine all messages that will no longer be consumed. During that process it will start a single transaction and process all of those messages at once. If there are more messages than there is available memory then the broker will generate a oom exception.
The kahadb should process the purging process through one or more transactions depending on the size of messages that need to be purged.
You will need to start a broker in a separate termine since the test is decoupled from the broker
You will need to use the configuration file that is located within the src/test/resources directory.
You can run the test by using the "mvn test" command.