Skip to content

Getting connection refused when invoking a service using Java SDK DaprClient #1325

@SharAkshay

Description

@SharAkshay

I have two services running in docker container under same network with their respective dapr sidecars which are also part of same docker network. Now I am trying to invoke serviceB endpoint from serviceA using dapr client like this

daprClient.invokeMethod(appId, methodEndpoint, payload, HttpExtension.POST, Response.class);

When I do so I get below exception
Error invoking Service B: java.net.ConnectException
reactor.core.Exceptions$ReactiveException: java.net.ConnectException
at reactor.core.Exceptions.propagate(Exceptions.java:408) ~[reactor-core-3.5.10.jar!/:3.5.10]
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:101) ~[reactor-core-3.5.10.jar!/:3.5.10]

Could you help me with this issue?

Please consider below points

  1. Both my services (ServiceA and ServiceB) are up and running as I have checked the healthchecks and it shows status up.
  2. I can invoke serviceB via it's repective dapr sidecar URL
  3. I can invoke serviceA also via it's repective dapr sidecar URL
  4. I have curl the serviceB endpoint via it's dapr sidecar from inside of the serviceA cdocker container so that connectivity works

I can see the dapr sidecar container logs as well and it has discovered the respective services so all looks good over there also.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions