I am interested to understand more details of how delegation to business code is handled, for the architectural pattern of using Camunda as embedded library.
I am assuming the thread of executing process tasks will be the one that is initiating the process instance. Until what point is that true ? When a decoupling from the main thread is done ? And if this is true, how is the threading handled then ?
Also I am curious if the java delegates can be used to comply with reactive semantics, for example using Spring Webflux Reactor.
I saw there is an implementation of Camunda event bus, but for me it is not clear how end to end backpressure is respected. I am guessing the event bus is single threaded, thus the only backpressure mechanism is carried out by the fact that the thread is blocked. But in the Delegate method, executing the business code, if you start a reactive stream, the only way to execute it is by subscribing in the method and again blocking the thread. Is there a way in which you can truly code the delegates in a reactive manner ?
Generally speaking if you want to start to connecting with other distributed system as part of a micro service architecture, it’s not always the best idea to delegate code. The external task pattern is better suited for connecting those kinds of system together.
I was thinking so, regarding the external tasks, but I read on some user stating there are some performance limitations in using external tasks. On the other hand I don’t know how external tasks will work using the embedded way, but I am assuming there will still be fetchAndLock calls to DB. But that indeed can be of some aid for reactive part since you can model the flow to pull the tasks based on the reactive stream availability. But if you have some info regarding possible performance limitations that would be great since I can asses their usefulnes for my use cases.