0

I am working on Spring Reactor to write REST Services. I was wondering if there is an annotation to Reactor.receive method like we have @Selector and @ReplyTo

Such that :

in.consume(req -> reactor.sendAndReceive("test.httprequests", Event.wrap(req.getUri()), (Event<String>ev) -> { 

invokes the annotated method.

Kaushal Panjwani
  • 1,263
  • 10
  • 11

1 Answers1

1

You should be able to just return a value from the method you annotate with @Selector to handle test.httprequests events. The wiring bean should treat that method the same as a receive, which is actually just an alias for being aware of the replyTo.

Jon Brisbin
  • 1,299
  • 8
  • 11
  • Ah Thanks @Jon, Empty `@ReplyTo` was key for me, what I was not able to figure was how to send reply to anonymous `selector` set by `sendAndReceive` – Kaushal Panjwani Jun 30 '14 at 14:26
  • The `@ReplyTo` supports a SpEL expression but unfortunately, we don't put the incoming `Event` into the `EvaluationContext`. Maybe what we need to do is just make the parameters available in an expression and they you could do something like `@ReplyTo("#arg0.replyTo")`. – Jon Brisbin Jul 01 '14 at 18:01