Search code examples
spring-bootdockerdocker-composezeebe

Springboot application cannot connect to zeebe when starting everything from docker compose


My application.yaml for spingboot app is

zeebe:
  client:
    broker:
      gateway-address: zeebe:26500
    security:
      plaintext: true

The zeebe service and springboot app is started from docker-compose file and the result of docker-compose ps is

zeebe camunda/zeebe:8.5.0 "tini -- /usr/local/…" zeebe About an hour ago Up About an hour (healthy) 0.0.0.0:9600->9600/tcp, 0.0.0.0:26500->26500/tcp, 26501-26502/tcp, 0.0.0.0:8088->8080/tcp

Zeebe is up and running with no issues but spring boot app, even restarting it from docker desktop, does not connect to it and gives error in docker logs

Caused by: io.grpc.StatusRuntimeException: UNAVAILABLE: Unable to resolve host zeebe

I saw some answers to change gateway address to 127.0.0.1:26500 for which I am getting this error:

Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: /127.0.0.1:26500

If I run zeebe from docker compose and spring boot app as an application from IDE, it works fine.

I am using <spring-zeebe.version>8.5.0</spring-zeebe.version> in pom and in docker compose for zeebe has the same version as well

  zeebe:
    image: camunda/zeebe:8.5.0
    container_name: zeebe

Solution

  • I was putting zeebe in a different network and my services were in default network created by docker compose. Putting all of them in the default network i.e. removing any network property added to any container fixed it.