ThreeDotsLabs / watermill

Building event-driven applications the easy way in Go.
https://watermill.io
MIT License
7.78k stars 408 forks source link

Does watermill supports request reply pattern using NATS ? #299

Open khanakia opened 2 years ago

khanakia commented 2 years ago

I could not find any docs for the request reply pattern using watermill

AlexCuse commented 1 year ago

The watermill nats implementation actually doesn't support NATS 😆It targets the deprecated nats-streaming server https://github.com/nats-io/nats-streaming-server

I don't know about nats-streaming and it's STAN client but message.Reply is pretty easy to implement for both NATS core and jetstream using the nats.go client. I think it would be simple with the rabbitmq client also, less sure about others. I have a PR open that's a little awkward to use at the moment since it introduces a v2, but looking at the code might give some ideas https://github.com/ThreeDotsLabs/watermill-nats/pull/8

roblaszczak commented 1 year ago

It's not really NATS-based (as we are trying to keep Watermill Pub/Sub-agnostic), but in this PR I'm introducing Request/Reply that can work with any Pub/Sub implementation: https://github.com/ThreeDotsLabs/watermill/pull/397 (so with NATS as well if needed, just without using native mechanism).