Results 1 to 2 of 2

Thread: Message handling becomes single file when defaultOutput specified on endpoint

  1. #1
    Join Date
    Aug 2004
    Location
    Sydney
    Posts
    503

    Default Message handling becomes single file when defaultOutput specified on endpoint

    Not sure if this is something i'm doing but message handling on a simple example I've built seems to handle 1 message at a time after a defaultOutput attribute is added to the @MessageEndpoint annotation. What I want is 20 at a time handling, due to the @Concurrency(... maxSize=20) annotation on my message end point.

    Setting defaultOutput = "reply", adding the associated channel definition, and putting Message receive = replyChannel.receive(); after sending the message produces 1 at a time message handling.

    Removing defaultOutput, and removing the replyChannel.receive(); call causes 20 at a time message handling, since I have @Concurrency(coreSize=5, maxSize=20) on the end point.

    How do you use the @Concurrency attribute while still receiving the result of a message that was processed?

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    You might want to post more info (i.e., config file etc.).
    defaultOutput - does not affect how concurrency works.

    What you might be confused about is how receive(..) method operates. It return the next available message (one at the time). So, even though your messages are processed concurrently you are retrieving them via receive(..) method one at the time.
    What you can do is register subscribers (something like this):
    Code:
    @Component
    public class MySubscriber {
    
    	@Subscriber(channel="reply")
    	public void foo(Object o) {
    		// your code
    	}
    }
    This way subscription manager will process your output per thread.

Posting Permissions

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