Hey guys, I’m working on a custom zeebe exporter. I had some issues with it before
Now my exporter has become a part of a multi module gradle project (I migrated it to maven) and unfortunately on zeebe startup I get this exception
java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:774) [spring-boot-3.1.2.jar:3.1.2]
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:755) [spring-boot-3.1.2.jar:3.1.2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:319) [spring-boot-3.1.2.jar:3.1.2]
at io.camunda.zeebe.broker.StandaloneBroker.main(StandaloneBroker.java:82) [camunda-zeebe-8.3.0-alpha4.jar:8.3.0-alpha4]
Caused by: java.lang.IllegalStateException: Failed to load exporter with configuration: ExporterCfg{, jarPath='/usr/local/zeebe/lib/zeebe-exporter-demo-1.0-SNAPSHOT-jar-with-dependencies.jar', className='io.zeebe.exporters.Demo.DemoExporter', args={logLevel=debug, prettyPrint=false}}
at io.camunda.zeebe.broker.Broker.buildExporterRepository(Broker.java:149) ~[zeebe-broker-8.3.0-alpha4.jar:8.3.0-alpha4]
at io.camunda.zeebe.broker.Broker.<init>(Broker.java:70) ~[zeebe-broker-8.3.0-alpha4.jar:8.3.0-alpha4]
at io.camunda.zeebe.broker.Broker.<init>(Broker.java:49) ~[zeebe-broker-8.3.0-alpha4.jar:8.3.0-alpha4]
at io.camunda.zeebe.broker.StandaloneBroker.run(StandaloneBroker.java:91) ~[camunda-zeebe-8.3.0-alpha4.jar:8.3.0-alpha4]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:771) ~[spring-boot-3.1.2.jar:3.1.2]
... 3 more
Caused by: io.camunda.zeebe.broker.exporter.repo.ExporterLoadException: Cannot load exporter [demoexporter]: cannot load specified class
at io.camunda.zeebe.broker.exporter.repo.ExporterRepository.load(ExporterRepository.java:82) ~[zeebe-broker-8.3.0-alpha4.jar:8.3.0-alpha4]
at io.camunda.zeebe.broker.Broker.buildExporterRepository(Broker.java:147) ~[zeebe-broker-8.3.0-alpha4.jar:8.3.0-alpha4]
at io.camunda.zeebe.broker.Broker.<init>(Broker.java:70) ~[zeebe-broker-8.3.0-alpha4.jar:8.3.0-alpha4]
at io.camunda.zeebe.broker.Broker.<init>(Broker.java:49) ~[zeebe-broker-8.3.0-alpha4.jar:8.3.0-alpha4]
at io.camunda.zeebe.broker.StandaloneBroker.run(StandaloneBroker.java:91) ~[camunda-zeebe-8.3.0-alpha4.jar:8.3.0-alpha4]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:771) ~[spring-boot-3.1.2.jar:3.1.2]
... 3 more
Caused by: java.lang.ClassCastException: class io.zeebe.exporters.Demo.DemoExporter
at java.lang.Class.asSubclass(Unknown Source) ~[?:?]
at io.camunda.zeebe.broker.exporter.repo.ExporterRepository.load(ExporterRepository.java:80) ~[zeebe-broker-8.3.0-alpha4.jar:8.3.0-alpha4]
at io.camunda.zeebe.broker.Broker.buildExporterRepository(Broker.java:147) ~[zeebe-broker-8.3.0-alpha4.jar:8.3.0-alpha4]
at io.camunda.zeebe.broker.Broker.<init>(Broker.java:70) ~[zeebe-broker-8.3.0-alpha4.jar:8.3.0-alpha4]
at io.camunda.zeebe.broker.Broker.<init>(Broker.java:49) ~[zeebe-broker-8.3.0-alpha4.jar:8.3.0-alpha4]
at io.camunda.zeebe.broker.StandaloneBroker.run(StandaloneBroker.java:91) ~[camunda-zeebe-8.3.0-alpha4.jar:8.3.0-alpha4]
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:771) ~[spring-boot-3.1.2.jar:3.1.2]
... 3 more
Any thoughts on this one? I’m still building and deploying with java 11 so I hope it’s not a big deal (since Zeebe requires jdk+17). With maven and as a separate module it worked perfectly fine for me.
I was able to trace it in the zeebe codebase that there is a problem with exporter registartion and this is the line throwing exception:
Just a guess as the stack trace really doesn’t give away much: Is your exporter compiled with the same version of Zeebe that you are trying to run it with?
I think if your dependency on Zeebe is for example 8.2.12 but you are deploying it to a Zeebe broker in version 8.2.13, you’d get a ClassCastException.
I was able to resolve my errors, posting in case someone else faces the same:
the subclass error is a generic error. for me the underneath cause was that I had tenant index custom configuration, and index name has to be in all smallcase.
Can you go through this ,
Version might be deprecated, but procedure is same
Zeebe Exporters
Exporters allow you to tap into the Zeebe event stream on a partition and export selected events to other systems. You can filter events, perform transformations, and even trigger side-effects from an exporter.
Read a two-part series about building Zeebe exporters on the Zeebe blog: Part One | Part Two.
Important Things to Know About Exporters
Resource Impact:
Exporters run in the same JVM as the broker.
Intensive computation in an exporter impacts broker throughput.
Perform minimal processing in the exporter and handle further transformations in another system.
Disk Management:
A misbehaving exporter can cause broker disks to fill up.
The event log truncates only up to the earliest exporter position.
Ensure exporters advance their positions in the stream to prevent disk issues.
Failure Planning:
Design for connectivity failures with external systems.