Camunda DB Cleanup

Hi Team,

We are using the spring boot based embedded Camunda for our business use case. I am facing issue with cleanup of the table once the task is completed. I have setup the TTL and all the other config in the yml and the processes.xml file. The only thing which I can see is the data is getting deleted in ACT_HI_PROCINST table as per the REMOVAL_TIME_, however the data in the ACT_HI_DETAIL and ACT_HI_VARINST is not getting purged. Below are my config in the yml and the xml file. Please help as once the data increases beyond certain limit it breaks the services.

   <?xml version="1.0" encoding="UTF-8" ?>

<process-archive name="bpmn-workflow">
    <process-engine>default</process-engine>
    <properties>
        <property name="isDeleteUponUndeploy">false</property>
        <property name="isScanForProcessDefinitions">true</property>
        <property name="batchOperationHistoryTimeToLive">P1D</property>
        <property name="historyCleanupStrategy">removalTimeBased</property>
        <property name="historyRemovalTimeStrategy">end</property>
        <property name="historyTimeToLive">P1D</property>
        <property name="history">ACTIVITY</property>
        <property name="historyCleanupBatchWindowStartTime">7:00</property>
        <property name="historyCleanupBatchWindowEndTime">15:00</property>
        <property name="historyRemovalTimeStrategy">start</property>
        <property name="jobExecutorActivate">false</property>
        <property name="jobExecutorDeploymentAware">true</property>
    </properties>
</process-archive>

camunda.bpm:
generic-properties:
properties:
history: ACTIVITY
history-cleanup-strategy: removalTimeBased
batchOperationHistoryTimeToLive: β€œP1D”
historyCleanupBatchWindowStartTime: β€œ7:00”
historyCleanupBatchWindowEndTime: β€œ15:00”
historyTimeToLive: β€œP1D”
default-number-of-retries: 5

Thanks in Advance.

Can you give us some details about your setup, version of Camunda, database and how exactly you’re embedding the engine?

Thanks for Response Niall.
We are using Camunda 7.13, DB is mySql.

We are using the below maven dependency for Camunda in out Spring Boot App.

             <dependency>
		<groupId>org.camunda.bpm.springboot</groupId>
		<artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
		<version>3.4.0</version>
	</dependency>
	<dependency>
		<groupId>org.camunda.bpm.springboot</groupId>
		<artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
		<version>3.4.0</version>
	</dependency> 

Hope these are the details you are asking for.

Thanks,
Shubham

Try changing to the latest version (7.15) as i’ve shown below and make sure that your spring boot version matachs the camunda version by looking at this compatibility matrix

    <dependency>
      <groupId>org.camunda.bpm.springboot</groupId>
      <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
      <version>7.15.0</version>

    </dependency>

    <dependency>
      <groupId>org.camunda.bpm.springboot</groupId>
      <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
      <version>7.15.0</version>
    </dependency>

So just changing the version will do the work? What changes will it bring?

It seems I need to pass history-level property under camunda.bpm in the yml file.
Now when I set the history-level as none, I am able to achieve what I was looking for.

camunda.bpm:
history-level: NONE
generic-properties:
properties:
history-cleanup-strategy: removalTimeBased
batchOperationHistoryTimeToLive: β€œP1D”
historyCleanupBatchWindowStartTime: β€œ7:00”
historyCleanupBatchWindowEndTime: β€œ15:00”
historyTimeToLive: β€œP1D”
default-number-of-retries: 5

Thanks.

1 Like