我想要在客戶端輪詢一個數據庫並通過HTTP發送結果到一個服務器收集數據。不幸的是,只有第一條消息被傳送。我是彈簧整合新手(1.0.3)只有第一條消息被髮送到服務器
我的配置有什麼問題?
客戶端配置:
<si:channel id="msgChannel">
<si:queue capacity="1" />
</si:channel>
<si:inbound-channel-adapter ref="jdbcInputAdapter" method="fetchData" channel="msgChannel">
<si:poller max-messages-per-poll="1">
<si:interval-trigger interval="5000" />
</si:poller>
</si:inbound-channel-adapter>
<http:outbound-gateway id="httpChannelAdapter" request-channel="msgChannel" default-url="http://localhost:8080/company/gateway"/>
<si:poller default="true">
<si:interval-trigger interval="5000" />
</si:poller>
服務器配置:
<si:channel id="requestChannel">
<si:queue capacity="4" />
</si:channel>
<si:channel id="replyChannel" />
<http:inbound-gateway id="InboundGateway" request-channel="requestChannel" reply-channel="replyChannel"/>
<bean id="shouter" class="com.company.Shouter"/>
<si:outbound-channel-adapter ref="shouter" method="shout" channel="replyChannel"/>
<si:service-activator input-channel="requestChannel"
ref="StorageService" method="store"
output-channel="replyChannel" />
<bean id="StorageService" class="com.company.StorageService" />
<si:poller default="true">
<si:interval-trigger interval="1000" />
</si:poller>
編輯:每次我重新啓動客戶端一個消息將被服務器接收。
解決:我不得不StorageService的簽名從
public void store(Message msg)
改變
public Message store(Message msg)
謝謝我刪除了無效的隊列容量。 – stacker 2010-06-25 12:54:53
答案是誤導性的,但我同意-1是多餘的 – iwein 2010-07-20 09:26:26