INT-4540: Use MessageHeaders in GenericHandler (#2589)

* INT-4540: Use MessageHeaders in GenericHandler

JIRA: https://jira.spring.io/browse/INT-4540

For better end-user experience use a `MessageHeaders` in the
`GenericHandler` instead of plain `Map<String, Object>`

* * Fix `IntegrationFlowEventsTests`
This commit is contained in:
Artem Bilan
2018-10-08 16:26:56 -04:00
committed by Gary Russell
parent 716494c7fb
commit 9ae0eb2dbc
5 changed files with 9 additions and 7 deletions

View File

@@ -476,7 +476,7 @@ Similar lambda configurations are provided for the `resequence()` EIP method.
The `.handle()` EIP method's goal is to invoke any `MessageHandler` implementation or any method on some POJO.
Another option is to define an "`activity`" by using lambda expressions.
Consequently, we introduced a generic `GenericHandler<P>` functional interface.
Its `handle` method requires two arguments: `P payload` and `Map<String, Object> headers`.
Its `handle` method requires two arguments: `P payload` and `MessageHeaders headers` (starting with version 5.1).
Having that, we can define a flow as follows:
====

View File

@@ -41,6 +41,8 @@ This avoid confusion with `log()` which is treated as a one-way end flow compone
A generated bean name for any `NamedComponent` within an integration flow is now based on the component type for better readability from visual tools, logs analyzers and metrics collectors.
The `GenericHandler.handle()` now excepts a `MessageHeaders` type for the second argument.
[[x5.1-dispatcher-exceptions]]
==== Dispatcher Exceptions