2

I am going through the specifications for Async API, but I can't find anything that would represent a request/response semantic for a channel. I am thinking from the context of Spring-Kafka with the @SendTo annotation that allows a response message to be sent to an arbitrary channel specified by the requester.

Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265
  • Your question is not clear; we do have an [open issue](https://github.com/spring-projects/spring-kafka/issues/1189) to allow a `Future>` or `Mono>` return type to a listener method (like we support with RabbitMQ) but, as you can see in the issue, there will be problems with offset management. – Gary Russell Jan 04 '20 at 15:35
  • This is meant more for https://www.asyncapi.com/ but using Spring Kafka's sendto annotation as a context. – Archimedes Trajano Jan 05 '20 at 06:46

1 Answers1

0

The best practice to define this kind of custom things for a specific framework is to use a specification extension. E.g.:

asyncapi: 2.0.0
...
channels:
  myTopic:
    subscribe:
      x-spring-kafka: # You can probably come up with a better name :)
        sendTo: myOtherTopic
      ...

Hope this helps!

fmvilas
  • 56
  • 1
  • 6
  • 1
    Also, there's a discussion about request/reply semantics here: https://github.com/asyncapi/asyncapi/issues/94. – fmvilas Feb 07 '20 at 17:56