dapr / java-sdk

Dapr SDK for Java
Apache License 2.0
262 stars 207 forks source link

pub/sub running question #689

Open bhljay opened 2 years ago

bhljay commented 2 years ago

can we run my subscribe application in local machine and at the same time sidecar is running on remote machine

publish application is working when use the following code, System.setProperty("dapr.sidecar.ip","*****"); System.setProperty("dapr.http.port","3500"); System.setProperty("dapr.grpc.port","5001"); but i do not know how to run my subscribe application

mthmulders commented 2 years ago

I think this is (also) covered in #688. My TL;DR: Dapr is not designed to have the sidecar running on a different machine than the application it serves.

bhljay commented 2 years ago

thanks ,but If it cannot be implemented, everyone should deploy a dapr locally and have a docker environment locally for development, which depends on too many things; Then it is difficult to extend to the production environment

artursouza commented 2 years ago

It is possible to run Dapr sidecar in a different host than the application. On the other hand, it is not possible to configure the sidecar to callback into another endpoint that is not localhost. You would need to setup some sort of reverse proxy next to the sidecar to redirect localhost: to the <app's ip>: - you can try with SSH tunnel to being with.

wmeints commented 2 years ago

You can run dapr without docker. The default workflow is not made for this as docker makes things a lot easier. You'd have to deploy components manually on a server in your network. Then you'll have to configure the components in the dapr config. Finally, you can run dapr run as normal.

Just to be extra clear: You run the dapr sidecar on the same machine as your service. The messagebroker you can run anywhere you like. You just need to configure the address of it in your pubsub component yaml.