Calling methods annotated with @Outgoing

Viewed 90

I'm implementing Apache Kafka in my Quarkus project. Now I have an outgoing channel and I want to write a method for it.

I want the method to be called whenever the application is done with the process it fulfills. So when my data is ready to be sent to the next application via Kafka. The Quarkus documentation says the following:

You should not call methods annotated with @Incoming and/or @Outgoing directly from your code. They are invoked by the framework. Having user code invoking them would not have the expected outcome.

All the examples I see are methods annotated with @Outgoing which generate messages every x amount of seconds. My use case doesn't seem very complicated.

How should I handle this?

1 Answers

I found a way. I needed to use the @Emitter to make it imperative. It is also mentioned in the official Quarkus docs. I was just not reading well...

Related