0
votes

I'm using outbound-channel-adapter of spring integration ftp

<int-ftp:outbound-channel-adapter id="ftpOutAdapterAutoCreate"
session-factory="ftpSessionFactory" channel="outChannel"
remote-directory-expression="headers.['remotedir']" charset="UTF-8" />

In my java code i'm setting remote directory in header.

org.springframework.integration.Message<File> messageA=
org.springframework.integration.support.MessageBuilder
.withPayload(reqFile).setHeader("remotedir",  "/errorOrders").build();

Error message it is showing while deploying

org.springframework.expression.spel.SpelParseException: EL1049E:(pos 7): 
Unexpected data after '.': 'lsquare([)'
1

1 Answers

1
votes

There's no period when you are referencing an element of a Map (message headers are a Map). The syntax is headers['remotedir'] (no dot before [).

Also, given your map key has no .s in it, you can also use headers.remotedir.