Issues with a custom connector image and connection to local Operate

Hello Community,

I ran into some issues when I tried to start a local connector runtime based on Springboot as container against a local Camunda Platform (based on the docker-compose.yaml by Camunda). I was not able to connect to Operate. The connection to localhost:8081 is refused when I start my springboot container with the application in it. I use the following settings in my application:

operate.client.enabled=true
camunda.operate.client.url=http://localhost:8081
camunda.operate.client.username=demo
camunda.operate.client.password=demo

When I start the spring boot app directly, it works.

2023-09-16T13:14:26.595482829Z 2023-09-16 13:14:26,595 [main] WARN  i.c.z.s.c.c.OperateClientProdAutoConfiguration - An attempt to connect to Operate failed: io.camunda.operate.exception.OperateException: org.apache.hc.client5.http.HttpHostConnectException: Connect to http://localhost:8081 [localhost/127.0.0.1] failed: Connection refused

I can access Operate with my browser on port 8081 so the port is open and available through localhost. Any ideas why this fails or what I missed?

Thanks in advance
Stefan

Hi @itsmestefanjay ,

I understand that you are are having a connector runtime in container and docker based camunda platform with components as containers

Inside docker container we cannot access localhost as it is having a virtual network

Please try giving to container name and rebuild the image and run the container for connector runtime so that it will communicate directly to container inside the camunda-platform network

For that you need to add the camunda platform network for the container

You can find an example here

change operate url as below

camunda.operate.client.url=http://operate:8080

In springboot app i.e using springboot-starter-camunda-connectors we can be be able to communicate to localhost because it’s out of docker virtual network

I hope this proves useful
Praveen

Hi @Praveen_Kumar_Reddy,

Thanks for your reply. I tried that already but I confused the ports… With http://operate:8080 it works as designed, I must have passed 8081 in there somewhere on the way. You know the forest and tree analogy :slight_smile: I guess this applies here as well.

Thanks for your help
Stefan

Your’e welcome @itsmestefanjay :slightly_smiling_face:

I can definitely relate to the analogy :smiley:. It’s all part of the development process.

Cheers!
Praveen

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