benthosdev / benthos

Fancy stream processing made operationally mundane
https://www.benthos.dev
MIT License
7.68k stars 752 forks source link

NATS Processor like HTTP #2501

Closed hooksie1 closed 2 weeks ago

hooksie1 commented 1 month ago

Is there a way to use NATS as a processor similar to HTTP? Since NATS supports request/reply it would be nice to be able to send requests to services synchronously. Similar to an HTTP proxy server but over NATS intsead.

mihaitodor commented 1 month ago

Hey @hooksie1 👋 There is no nats processor component unfortunately, but, depending on your use case, you can leverage the existing nats output by wrapping it in a broker with pattern: fan_out_sequential. That way, you can have multiple outputs and each of them can have processors attached, so you could technically have some processors at the input level and / or in the pipeline. Then, the first output under the broker can be nats and the second one can be your current output with some extra processors attached to it. If you'd like to contribute a nats processor, PRs are welcome!

hooksie1 commented 1 month ago

I'll give that a try. I'll take a look and see what it would take to implement that.

Thanks!

hooksie1 commented 2 weeks ago

Closing this since it was implemented.