Hi Folks,
Is there any way that we can pass a list of messages to the bean annotated with @MessageEndpoint.
Right now a method annotated w/@ServiceActivator is called once per message.
Thanks
Hi Folks,
Is there any way that we can pass a list of messages to the bean annotated with @MessageEndpoint.
Right now a method annotated w/@ServiceActivator is called once per message.
Thanks
A Message can have a List (or any Collection) as its payload, but dealing with a List of Message objects would be a different problem because of the role of the Message headers.
If a List-typed payload does not work for your particular use-case, can you describe it?
Thanks,
Mark
Mark Fisher
Spring Integration Lead
SpringSource, a division of VMware
http://www.springsource.com
http://www.springsource.org/spring-integration
http://blog.springsource.com/main/author/markf
Thanks Mark for quick reply.
In my case we would be polling for messages every (lets assume) 30 minutes, there is a good possibility that the queue would have around 1000s of messages once we pool it.
There is some Database I/O involved per message, so we want to avoid this I/O and do one I/O operation as we process the 1000s of messages at once.
Okay. I think you have a few options. For a pure Spring Integration approach, you could use an Aggregator with a custom CorrelationStrategy and/or CompletionStrategy. You may be able to apply a header value to each Message and rely on default behavior (e.g. setting a correlation-id for each Message in a group).
You might also want to consider using Spring Batch. Depending on the type of input, you might be able to use Spring Batch alone, or alternatively you may find that Spring Batch and Spring Integration together provides the best solution. That way you can create a "job" for the batch processing of DB operations.
Mark Fisher
Spring Integration Lead
SpringSource, a division of VMware
http://www.springsource.com
http://www.springsource.org/spring-integration
http://blog.springsource.com/main/author/markf
I'm thinking that it might be very convenient to be able to aggregate messages without a correllation id (just aggregate every n messages). This has been discussed before iirc.
http://forum.springsource.org/showth...ator+timeou t
http://forum.springsource.org/showthread.php?t=71599