Camunda external task client on remote server (not localhost)

Hello,
I am trying to execute external tasks on my computer orchestrated on a remote camunda 7 server.

I deployed the model from my modeler locally & found it in Process definition. But the tasks don’t execute.
I tried to work with localhost & everything worked well.

Python Code:
from camunda.external_task.external_task import ExternalTask, TaskResult
from camunda.external_task.external_task_worker import ExternalTaskWorker

default_config = {
“asyncResponseTimeout”: 5000,
“baseUrl”: ‘<server_url>:8080/engine-rest/’,
}

def my_task(task: ExternalTask) → TaskResult:
print(“task executed”)
return task.complete()

ExternalTaskWorker(worker_id=“1”, config=default_config).subscribe(“my_task”, my_task)

Am I missing something in configuration ?

I found a way to accomplish that. I edited the ENGINE_LOCAL_BASE_URL variable in the library camunda-external-task-client-python3.
path : camunda/client/engine_client.py

old value: ENGINE_LOCAL_BASE_URL = “my-server-url”:8080/rest-engine/

Is there another more recommended way ?

After all, I just had to add a parameter in the ExternalTaskWorker as follows:
ExternalTaskWorker(worker_id=“1”, config=default_config, base_url= “my-server-url:8080/rest-engine/").subscribe(“my_task”, my_task)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.