30002

Question:
Is there a way to use a global wire tap
and still be able to log the identification information about the associated channel? To clarify lets suppose, I want to use a global wire tap
as follows:
...
<int:channel id="myChannel1" />
...
<int:channel id="myChannel2" />
...
<int:wire-tap pattern="*" order="2" channel="wireTapChannel" />
<int:logging-channel-adapter
id="wireTapChannel"
expression="'payload: ' + getPayload()"
level="DEBUG"
logger-name="WIRETAP" />
This would log something like
14:44:31,350 DEBUG WIRETAP:126 - payload: some payload1
14:44:31,350 DEBUG WIRETAP:126 - payload: some payload2
Now is there a way to put an expression so that looking into the logs I can identify the associated channels as well? I am expecting something like this:
14:44:31,350 DEBUG WIRETAP:126 - channel: myChannel1, payload: some payload1
14:44:31,350 DEBUG WIRETAP:126 - channel: myChannel2, payload: some payload2
Not sure whether this information is already lost once the flow reaches the wireTapChannel
Answer1:You could enable <a href="http://docs.spring.io/spring-integration/docs/2.2.x/reference/html/system-management-chapter.html#message-history" rel="nofollow">Message History</a> and then use a Spel to print the desired headers.