Problem with Queue Channel messaging
I am using a queue channel based mechanism to store my payload data and send it to the destination. The xml code is as follows:
Code:
<int:channel id="annotatorChannel" datatype="com.mycompany.auditing.auditservice.AuditEvent">
<int:queue capacity="500" />
<int:interceptors>
<int:ref bean="persistenceInterceptor"/>
</int:interceptors>
</int:channel>
<int:channel id="destinationChannel" datatype="com.mycompany.auditing.auditservice.AuditEvent">
<int:queue capacity="500" />
<int:interceptors>
<int:ref bean="persistenceInterceptor" />
</int:interceptors>
</int:channel>
<int:poller id="defaultPoller" default="true" max-messages-per-poll="10">
<int:interval-trigger interval="1" time-unit="SECONDS"/>
</int:poller>
<int:outbound-channel-adapter channel="destinationChannel" ref ="destinationAdapter" method="handleAuditEvent">
</int:outbound-channel-adapter>
<int:transformer id="annotationTransformer" ref="annotationAdapter" input-channel="annotatorChannel" method="annotate" output-channel="destinationChannel" />
When I try to send about 1000 audit events ( more than the queue capacity), it sends them to the final destination using the method handleAuditEvent as described above. But some of the events are missing... that is, it skips over some events. I have a feeling that this happens when one of the queue is full. It probably waits for the queue to free up, and in the process the event(s) is lost. Is there a way to combat this scenario? Thanks.