External task - alternatives of Polling?

Hi team,

Is it possible to use any pattern other than polling? External task Pattern

Some Ideas:

  1. Apache Kafka topic?
  2. CloudEvent
  3. AMQP Message

How would you imagine this architecture working?
Can you explain the steps you’ve like to see happen?

External Kafka task Definition
At the time of defining BPMN execution model, implementation team defines destination Kafka connection Reference properties.

Execution
During execution, when BPMN engine encounters External task with Kafka topic connection, it publishes topic using producer.send.

Completion
When task is completed by external worker, it can use regular /task/complete REST API.

So this can best be done using the existing external task pattern.
With the external task posting pushing the topic to kafka and then completing when it decided the service completed successfully.

Can you please provide an example (bpmn) of this using Kafka as external task to produce text message/JSON over a Kafka topic.

1 Like

but as I know, in modeler we can’t directly change external task to send message to the kafka, or binding a delegate function for doing something like this.

maybe it is possible only with fetching external tasks and pushing them into the kafka that it’s not good way.

it would be good when we could use camunda-bpm-spring-boot-starter-external-task-client for supporting kafka or rabbitMq too. for example we can improve library for when we select type of ExternalTaskSubscription as kafka, messages are received from kafka listener and inject into the ExternalTaskHandler#execute.

Why do you think this is not a good way?
i would see theProbnlem with this approach, that camunda does not have a good option to handle connection Problems, while an external task acting as a bridge has these options.

thank you pThomas for reply,
at first we have delay until the job has fetched, so we don’t need to collect them with job, we can doing some work (delegate or expression) when engine has received the external task. and in kafka case we can implement our work in external task delegation with pushing message to kafka and in another side the worker will start his work real time.

goal of this way is speed and supporting choreography . but it need delegate or expression inside the external task.