I have a configuration bean that has a list of allowed values:
@Component
public class Conf {
public List<String> getAllowedValues() {
return Arrays.asList("A", "B", "C", "D");
}
I have populated my message headers with a field called 'someValue' and I want to use a filter element to exclude messages where someValue is not in the allowed values list.
My context looks like this:
<int:filter expression="#{conf.allowedValues}.contains(headers.get('someValue'))"/>
But I get: SpelParseException: EL1041E:(pos 1): After parsing a valid expression, there is still more data in the expression: 'comma(,)'
The answer was provided here:
<int:filter expression="@conf.allowedValues.contains(headers.get('someValue'))"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With