
Originally Posted by
Mark Fisher
Can we please get a failing test case?
Thanks,
Mark
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?
Update: I even tried making the second queue a direct channel, ( so now I have the first queue spitting out the messages to the direct channel, which sends them to the destination), but it still seems like some messages are lost in the first queue itself since I do not see them in the destination, and I see the same ones missing in the first queue ( the annotator channel).