java-sdk icon indicating copy to clipboard operation
java-sdk copied to clipboard

Java SDK - Connect to Specific DaperClient

Open pratik2247 opened this issue 3 years ago • 3 comments

Hi All,

From JAVA SDK , can we connect to specific Dapr while working with different machines ?

Eg: DaprClient client = (new DaprClientBuilder()).build() We are using above syntax to get DaprClient of current system. Can we get DaprClient instance of particular host by providing host information ?

pratik2247 avatar Feb 17 '22 14:02 pratik2247

Hi @pratik2247, as of my knowledge, it is not indented to access a daprd running on a different machine, and it is part of the security design.

gehhilfe avatar Feb 17 '22 17:02 gehhilfe

I was discussing this type of issue with a colleague and we're wondering why you'd want this sort of thing. Can I ask why you'd want to run the dapr sidecar on a different machine?

wmeints avatar Feb 23 '22 14:02 wmeints

You can change the sidecar IP the client connects to by using this property: https://github.com/dapr/java-sdk/blob/4c077e1de2d34b460d4f714ab32366be19411c06/sdk/src/main/java/io/dapr/config/Properties.java#L64

artursouza avatar Feb 25 '22 18:02 artursouza