Spring集成规划环境地政司的问题,我有我fileMessageProvider()作为与注释
@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}"
而是规划环境地政司的如果我使用FIXEDDELAY = “10000”,它的工作好。
我的Spring集成版 '4.0.0.RELEASE'
更新: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
尝试fixedDelay =“#{my.poller.interval}” 给出类似的异常java.lang.NumberFormatException:对于输入字符串:“# {my.poller.interval}“ – Sam
将#更改为$。它应该看起来像'$ {my.poller.interval}'。当然,如果你有'my'对象具有具有'interval'属性的'pooler'属性,它就会起作用。 – wawek