Hello there. I was wondering if it is possible to process external tasks right away after we come across them in the process. By far I have only found a polling approach, when we poll for new external tasks every [some time amout].
I am also looking at camunda-camel component, since we use camel in our applications a lot, there is a way to consume external tasks like shown here, and it seems to grab newly approached external task right away, but I am not sure if it is event-driven or it just polls very frequently.
Any advice would be appreciated.
External Task Client uses long-polling for retrieving tasks. So essentially, it opens connection for a long interval and as soon the connection is closed it opens a new one (see https://docs.camunda.org/manual/latest/user-guide/ext-client/#external-task-throughput)
The API of External Task Client is reactive, since you provide a handler that is called as soon as the task is delivered.
Of course, you can try to implement an adapter that pushes external tasks to another components, but then why bother to use external tasks? If your engine should push external service (and not external service ask engine for work), the external task pattern is probably a wrong abstraction, but you should use a usual service task / message task instead. This should then publish an event on some bus / infrastructure and continue the process execution. If you need an acknowledgment of the processing, you should place a intermediate catch event that is correlated by the receive of the ack from the infrastructure.
I general, Camunda engine can be combined with some stream-oriented and event-oriented system, but there are some considerations you need to take in to account.
I wrote my ideas on that here: