Are there any examples for configuring Elasticsearch (or other) as a history audit log in Spring Boot?
Being new to both Spring Boot and Camunda, this is proving quite difficult to figure out and I was hoping there was a good example somewhere?
Thanks for this. So the Elastic part is kind of secondary - just getting a custom history handler in Spring Boot is proving hard enough. Do you have any examples that use Spring Boot specifically?
Greeting from Clive Geralo (the current name of my hawk)
I’ve never tried it directly with spring boot but it shouldn’t be too hard - we where just directly using the Elasic client API to send the data to ElasticSearch. There isn’t much Camunda Specific about that.
OK so no reference material you can point to regarding configuring history handling in Spring Boot?
The Camunda Spring Boot starter’s documentation is a bit spare
This is quite a loaded term - Camunda BPM’s history is built to work only on a relational database this can be configured as a spring boot datasource but it’s more complicated if you want to use NoSql.
Note that if you provide a custom implementation of the HistoryEventHandler and wire it to the process engine, you override the default DbHistoryEventHandler. The consequence is that the process engine will stop writing to the history database and you will not be able to use the history service for querying the audit log. If you do not want to replace the default behavior but only provide an additional event handler, you can use the class org.camunda.bpm.engine.impl.history.handler.CompositeHistoryEventHandler that dispatches events to a collection of handlers.
I’m trying to do exactly this, but there is no documentation on how to do so
You should be able to implement and provide your own HistoryHandler with this.
Edit: Using the Spring Event Bridge is also a very good way to achieve what you want if you don’t want to take care of implementing a handler yourself.
Hey @tmetzke - I’ve tried this, but it doesn’t seem to take precedence. From stepping through the code, the CompositeDbHistoryEventHandler is used as the history handler, but I can’t seem to find a way to inject another handler to the historyEventHandlers list which would seem to be the most correct way to implement this?