Answer the question
In order to leave comments, you need to log in
What framework to use to handle events and wait for a response?
The application processes certain events coming from outside via AMQP (RabbitMQ).
Inside the application, I want to make it so that the handlers can be combined and built in an arbitrary order, but so that the handlers do not depend on each other. In its simplest form, it's just a set of classes that implement Function<T, R> - something comes in and something comes out the other side.
The processing graph must be defined externally (for example, in a special separate class).
Example: there is a class Transformer implements Function<OriginalEvent, TransformedEvent>, there is a class Calculate<TransformedEvent, Double>, UpdateCounter<Double,Void> and there is a class WriteDoDatabase<TransformedEvent, Void>
I want to write it like in Java 8:
Stream<OriginalEvent,TransformedEvent> s = SomeFramework.map(new Transformer());
s.map(new Calculate()).onEvent(new UpdateCounter());
s.onEvent(new WriteDoDatabase());
And then when a new event arrives: s.process(originalEvent) - and this method can't return until all handlers are executed (while some can be executed in parallel, for example, WriteDoDatabase and Calculate+UpdateCounter
What have I already thought/tried?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question