In spring-integration I'm wanting to "update" a list of values that are kept within a message header, using a header-enricher.
In my example, I've created an inline list {'x', 'y'} and I want to add 'z' to that list. I haven't found an example of how to do this in SpEL. It seems like it should be a common, trivial thing to do.
<si:header-enricher>
<si:header name="myList" expression="{ 'x', 'y' }" />
</si:header-enricher>
...
<si:header-enricher default-overwrite="true" >
<!-- CLEARLY THIS DOESN'T WORK BUT USING TO DEMONSTRATE THE DESIRED RESULT -->
<si:header name="myList" expression="{ headers.myList, 'z' }" />
</si:header-enricher>
How does one indicate that you want to create a new inline list that is the result of adding a value to an existing list?
In the demonstration code, the outcome would be [ [ 'x', 'y' ], 'z' ] rather than the desired ['x', 'y', 'z' ].
thanks for any pointers