Hey there,
I have a service task which is basically an External Task, meaning it publishes to the topic specified in the field, and the class where I am subscribing to the topic, susbscribes to the task based on the topic name, now if at all in-case, i have to keep listening to the topic forever, i mean the lock should be forever, and should not expire.
Actual outcome, though i am not mentioning the lockDuration on the topic subscribed, the topic automatically gets unsubscribed after a period of time.
Expected Outcome: The Topic should be subscribed by this workerId.
Here is the piece of code, that I have written, using https://github.com/camunda/camunda-external-task-client-java/tree/master/examples/loan-granting, Suggested @Niall :
ExternalTaskClient client = ExternalTaskClient.create()
.baseUrl(PROCESS_ENGINE_URL)
.build();
client.subscribe("generateNotification")
.handler((externalTask, externalTaskService) -> {
//i am doing my stuff here, getting and setting variables
externalTaskService.complete(externalTask);
}).open()
Thanks Much.