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

pub/sub running question

Open bhljay opened this issue 3 years ago • 5 comments

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

bhljay avatar Feb 23 '22 07:02 bhljay

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.

mthmulders avatar Feb 23 '22 07:02 mthmulders

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

bhljay avatar Feb 23 '22 07:02 bhljay

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.

artursouza avatar Feb 23 '22 20:02 artursouza

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.

wmeints avatar Feb 25 '22 06:02 wmeints