클라이언트 측 DB를 폴링하고 결과를 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>
편집 : 매번 내가 하나의 메시지는 서버에 의해 수신 될 클라이언트를 다시 시작합니다.
해결 : 나는 큐의 용량을 제거해보십시오
public Message store(Message msg)
덕분에 아무 효과가없는 대기열 용량을 제거했습니다. – stacker
대답은 오해의 소지가 있지만 -1은 중복되는 것에 동의합니다. – iwein