у меня fileMessageProvider() какSpring Integration SPEL проблемы с аннотацией
@InboundChannelAdapter(value = "files" , poller = @Poller( fixedDelay = "${my.poller.interval}", maxMessagesPerPoll = "1" ))
public Message<File> fileMessageProvider() {
...
}
Придает NumberFormatException при развертывании
Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myPoller' defined in "../MyPoller.class": Initialization of bean failed; nested exception is java.lang.NumberFormatException: For input string: "{#my.poller.interval}"
Вместо SPEL Если я использую fixedDelay = "10000", он работает хорошо.
Моя весна версия интеграции '4.0.0.RELEASE'
Update: 1
Я использую смесь аннотаций и XML-конфигурации
Batch.properties
my.poller.interval=20000
integration-context.xml
<context:property-placeholder location="classpath:Batch.properties"/>
<context:component-scan base-package="com.org.reader" />
<int:transformer input-channel="files" output-channel="requests">
<bean class="com.org.reader.MyMessageToJobRequest">
<property name="job" ref="addMessages"/>
</bean>
</int:transformer>
Попробуйте использовать # {<строка выражения>} insted {# <строка выражения>} – Fincio
Tried fixedDelay = "# {my.poller.interval}" дает аналогичное исключение java.lang.NumberFormatException: для строки ввода: "# {my.poller.interval} " – Sam
Изменить # на $. Он должен выглядеть как '$ {my.poller.interval}'. Это работает, конечно, если у вас есть объект 'my', у которого есть свойство' pooler', свойство 'interval'. – wawek