Ecotonedoes allow for easy change endpoint to be running synchronously or asynchronously according to current running process.
endpointIdon our endpoint's annotation, in this case in
Asynchronoushas channel name defined as
orderswe need to register such channel. In order to do it, we need to use one of the Modules, that provides pollable channels. At this moment following modules with pollable channels are available:
handledMessageLimit- Amount of messages to be handled before stopping consumer
executionTimeLimit- How long consumer should run before stopping (milliseconds)
memoryLimit- How much memory can be consumed by before stopping consumer (Megabytes)
stopOnFailure- Stop consumer in case of exception
Asynchronouson the class, level so all the endpoints within a class will becomes asynchronous.
In Memory Queue Channelin order to to have run it within single process without external providers. This can be useful in testing scenarios, where we want to test whole flow in simple manner.
null channelwhich means it will drop the any message it receive. This can be useful, if we want to turn off specific functionality.
ConfiguredMessagingSystemfrom your DI Container. If you fetched above, then you can run it like this to limit the consumption process:
Ecotonecomes with solution that allow to
retry failed messagesand push them to
error channelfor later investigation.