我想在Bean中注入QueueChannel,以便我可以監視它的剩餘容量。如果有人能指導我解決這個問題,那將是非常棒的。Spring集成:錯誤注入Bean中的QueueChannel以計算剩餘容量
下面是我的配置:
<si:channel id="queueChannel">
<si:queue capacity="200"/>
</si:channel>
<bean id="inboundAdapterPollingConfiguration" class="com.foo.impl.InboundAdapterPollingConfigurationImpl">
<property name="channel" ref="queueChannel"/>
<property name="jdbcInboundAdapter" ref="jdbcInboundAdapter"/>
</bean>
bean代碼:
public class InboundAdapterPollingConfigurationImpl implements MethodInterceptor{
QueueChannel channel;
public QueueChannel getChannel() {
return channel;
}
public void setChannel(QueueChannel channel) {
this.channel = channel;
}
}
錯誤:
java.lang.IllegalStateException: Cannot convert value of type
[$Proxy336 implementing org.springframework.integration.core.PollableChannel,
org.springframework.integration.MessageChannel] to required type
[org.springframework.integration.channel.QueueChannel]
for property 'channel': no matching editors or conversion strategy found
約翰,我雖然在你的另一個問題中討論過這個問題。 http://stackoverflow.com/questions/20501149/spring-integration-jdbcinbound-channel-adapter-set-max-rows-per-poll-dynamic你還需要幫助嗎? –