Results 1 to 5 of 5

Thread: Messages lost when capacity reached

  1. #1
    Join Date
    Jul 2006
    Location
    London
    Posts
    500

    Default Messages lost when capacity reached

    I am finding that messages are lost in my scenario described below:

    Service Activator outputs 2 messages to a pub/sub channel.

    There are 2 consumers and they each consume the message OK.

    One of the Consumers is a <bridge/> which simply moves the message onto a Pollable Channel (this is my results channel).

    The Pollable 'results' Channel has a capacity of 1.

    As you can see the channel capacity is smaller than the expected output of 2.

    Q)What happens to a sent message when a channel is full?

    My understanding from the API is that the client to the channel will block until there is room.

    What I am finding is that when room is made, the blocked client fails to add the message to the Pollable Channel for some reason.

    Any advice appreciated.
    Last edited by jamesclinton; Mar 31st, 2009 at 03:45 AM.
    Regards,
    James

  2. #2
    Join Date
    May 2007
    Location
    Netherlands
    Posts
    614

    Default

    Could you attach your sample code? Basically a tescase with a config file should do the trick. I'll run it against HEAD and see if I can reproduce this and give you some feedback.

  3. #3

    Default

    Did you figure out the solution to the problem? I am having a similar problem, and would be interested in knowing about it. Thanks.

  4. #4
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,844

    Default

    Can we please get a failing test case?

    Thanks,
    Mark

  5. #5

    Default

    Quote Originally Posted by Mark Fisher View Post
    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).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •