Hi,
As my project grows, I run into this problem:
And there are other input-output channel pairs which need to have the header set.Code:<int:header-enricher input-channel="inputChannel" output-channel="outputChannel"> <int:header name="#{T(org.apache.http.HttpHeaders).AUTHORIZATION}" value="myAuthor"/> <int:header name="#{T(org.apache.http.HttpHeaders).CONTENT_TYPE}" value="#{T(org.springframework.http.MediaType).APPLICATION_XML_VALUE}"/> <int:header name="UUID" expression="payload.uuid.toUpperCase()"/> </int:header-enricher>
How can I reuse this xml construct for other channel pairs?
Currently every time I have a pair of in/out Channel, I have to replicate this header setting rigaormore.
Is going back to a service activator approach better off? Looks like there is an opportunity I can just use a template method to 1. set the basic headers, 2. set specific headers based on the channel pair...
Not to mention sometimes the input/output channel is in a chain, i.e.
But that does not happen often enough, so I guess I could replicate...Code:<int:header-enricher> <int:header name="#{T(org.apache.http.HttpHeaders).AUTHORIZATION}" value="myAuthor"/> <int:header name="#{T(org.apache.http.HttpHeaders).CONTENT_TYPE}" value="#{T(org.springframework.http.MediaType).APPLICATION_XML_VALUE}"/> <int:header name="UUID" expression="payload.uuid.toUpperCase()"/> </int:header-enricher>
Maybe in future we can have a section, in the SI blog or manual, mentioning how to organize a medium-to-big size project, config file import/reuse, etc.


Reply With Quote