Announcement Announcement Module
Collapse
No announcement yet.
Message handling becomes single file when defaultOutput specified on endpoint Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment

    Working...
    X