spring - How to change the header element -
i have following code snippet:
<int-file:inbound-channel-adapter id="filteredfiles" directory="#{controllerconfig['cycle'].params['semaphore_dir']}" channel="semaphorechannel" filename-pattern="*.xml" prevent-duplicates="false"> <int:poller max-messages-per-poll="1" cron ="#{controllerconfig['cycle'].controllertimer}"/> </int-file:inbound-channel-adapter> ... later in flow in have header enricher:
<int:header-enricher id="channel name setter"> <int:header name="channel.id" value="cycle"/> <int:header name="flow.id" overwrite="true" value="#{t(hu.telekom.fdl.util.timebaseduuidgenerator).generateid()}"/> </int:header-enricher> the problem although used overwrite="true" property flow.id seems unchanged when inbound-channel-adapter reads second file.
thanks,
expressions form #{...} evaluated once only, during context initialization. need use runtime expression:
<int:header name="flow.id" overwrite="true" expresion="t(hu.telekom.fdl.util.timebaseduuidgenerator).generateid()"/> i.e. use expression= , remove #{}.
you need overwrite="true" if header present on inbound message enricher.
Comments
Post a Comment