Quarkus and camunda

I want to try using quarkus.io and camunda… is anyone here with some experience ? I tried to use spring-cdi-egine but got some errors:

15:13:58,396 ERROR [io.qua.dev.DevModeMain] Failed to start Quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: javax.enterprise.inject.spi.DeploymentException: Found 6 deployment problems:
[1] Unsatisfied dependency for type org.camunda.bpm.engine.cdi.BusinessProcess and qualifiers [@Default]
- java member: org.camunda.bpm.engine.cdi.CurrentProcessInstance#businessProcess
- declared on CLASS bean [types=[org.camunda.bpm.engine.cdi.CurrentProcessInstance, java.lang.Object], qualifiers=[@Default, @Any], target=org.camunda.bpm.engine.cdi.CurrentProcessInstance]
[2] Unsatisfied dependency for type org.camunda.bpm.engine.cdi.BusinessProcess and qualifiers [@Default]
- java member: org.camunda.bpm.engine.cdi.ProcessVariables#businessProcess
- declared on CLASS bean [types=[org.camunda.bpm.engine.cdi.ProcessVariables, java.lang.Object], qualifiers=[@Default, @Any], target=org.camunda.bpm.engine.cdi.ProcessVariables]
[3] Unsatisfied dependency for type org.camunda.bpm.engine.cdi.impl.ProcessVariableLocalMap and qualifiers [@Default]
- java member: org.camunda.bpm.engine.cdi.ProcessVariables#processVariableLocalMap
- declared on CLASS bean [types=[org.camunda.bpm.engine.cdi.ProcessVariables, java.lang.Object], qualifiers=[@Default, @Any], target=org.camunda.bpm.engine.cdi.ProcessVariables]
[4] Unsatisfied dependency for type org.camunda.bpm.engine.cdi.impl.ProcessVariableMap and qualifiers [@Default]
- java member: org.camunda.bpm.engine.cdi.ProcessVariables#processVariableMap
- declared on CLASS bean [types=[org.camunda.bpm.engine.cdi.ProcessVariables, java.lang.Object], qualifiers=[@Default, @Any], target=org.camunda.bpm.engine.cdi.ProcessVariables]
[5] Unsatisfied dependency for type org.camunda.bpm.engine.cdi.BusinessProcess and qualifiers [@Default]
- java member: org.camunda.bpm.engine.cdi.impl.annotation.CompleteTaskInterceptor#businessProcess
- declared on INTERCEPTOR bean [bindings=[@CompleteTask], target=Optional[org.camunda.bpm.engine.cdi.impl.annotation.CompleteTaskInterceptor]]
[6] Unsatisfied dependency for type org.camunda.bpm.engine.cdi.BusinessProcess and qualifiers [@Default]
- java member: org.camunda.bpm.engine.cdi.impl.annotation.StartProcessInterceptor#businessProcess
- declared on INTERCEPTOR bean [bindings=[@StartProcess(value = “”)], target=Optional[org.camunda.bpm.engine.cdi.impl.annotation.StartProcessInterceptor]]

1 Like

Hey cpiepel,

I also was curious if this works and tried it. Ths big issue is, that Quarkus’ CDI system is not reall CDI. It is called “ArC” and does not support the full CDI spec. This is where your exception is coming from: Quarkus does not support implicit bean discovery, but the beans in the camunda cdi module are not annotated with a supported scope. You would need to change those, and add @Dependent to them. Even after I forked the module and did so, it did not work great, as Camunda also uses the @ConversationScope, which is not supported by Quarkus ArC. You can either write your own CDI providers which will (maybe) work with Quarkus, or you can switch to another framework

I wrote a blog entry about this: https://javahippie.net/java/microprofile/quarkus/camunda/cdi/2020/02/07/camundaquarkus.html

5 Likes

That is a great summary, @javahippie; thanks for sharing your experiences!

Hello everyone,
I haven’t worked with Camunda for very long, but I read the JavaHippie blog entry and managed to integrate the Camunda REST API into Quarkus.

Basically I followed the following Camunda documentation: https://docs.camunda.org/manual/7.13/reference/rest/overview/embeddability/ - important is that you connect the Process Engine with the Rest-API via a service provider (Is described at the end of the documentation).

At this point I had integrated a RestResource (as described by JavaHippie). This resource didn’t work anymore, but I was able to access the Rest API of Camunda. After I deleted the RestResource (from Java Hippie), which I didn’t need anymore, the Camunda REST API didn’t work anymore.

I could find out that it’s because of the annotation @Path("/"), if this annotation is present, the Camunda REST API works…i added the Annotation to the Method “getClasses()” (take a look at the linked document then you know which method I mean)

Who can explain why it behaves this way?

I have named my process engine “quarkusEngine” in the processes.xml.

After that I could make rest calls like this…of course with a value for {key}:

http://localhost:8080/engine/quarkusEngine/process-definition/key/{key}/start

Quarkus Version 1.7.1.Final.
Camunda Version 7.13.0.

2 Likes

That’s awesome! Thanks for sharing your progress on this! My first guess is that Quarkus needs the @Path annotation to discover this as something that needs to be exposed via HTTP, but I am not sure about this. I don’t have a lot of time on my hands this month, but I would love to dig deeper into this topic, soon!

Hey JavaHippie,
thanks for you blog post. It was great to read, especially the trial and error you went through.
I tried to recreate this scenario, however I am getting an exception and I’ve got the feeling I am missing something so obvious you wouldn’t even mention in your blog.

I get the exception:
Cannot deploy process archive ‘null’ to default process: no such process engine exists: processEngine is null

Well, this is apparently true, as I have not configured the camunda engine. Normally, with an Application Server like Wildfly I need to configure the engine as a shared service. However, I do not know how to configure the engine on quarkus and you have not mentioned in your blog how to do so.

I cannot see in the logs the engine starting when I start quarkus. So obviously I am missing something. Can you provide me with the missing part? Or do you have the whole source code somewhere on github? I couldn’t find it.

Hi Philipp,

sorry for the late answer, I was not that active in the forums, lately :wink:
Could you share your pom.xml file and the code of your class containg the @ProcessApplication annotation?