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

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -