I am trying to implement a JMS message Aggregator which reads N messages from an input queue and writes a single aggregate message to an output queue (see http://www.eaipatterns.com/Aggregator.html) . I have the constraint that messages cannot be lost, although I suppose that messages can be duplicated under extenuating circumstances.
To maximize performance, I'd prefer to avoid persisting the messages while they are being collected by the aggregator. My initial thought is to use the CLIENT_ACKNOWLEDGE delivery mode and delay acknowledging messages until they have been successfully placed in the output queue. In this way messages that are being processed into an aggregate should be redelivered if my service crashes. MDBs seem to be the preferred way to use JMS within a J2EE server, but unfortunately they don't permit use of the CLIENT_ACKNOWLEDGE mode. If I want to avoid writing the messages to a persistent store while they are being collected in the aggregator, the only options I see are to write a standalone JMS client or a JMX MBean. My questions are: 1) Does my approach of using CLIENT_ACKNOWLEDGE and delaying acknowledgment of messages until an aggregate has been written to the output queue make sense? Is this a misuse of JMS? 2) I discovered that JBoss doesn't allow you to register a JMS MessageListener in an MBean, so I switched to the synchronous receive() method. Is there any problem with this? 3) Can anyone propose a better way to do this? I am using JBoss 4.0.2 and JBoss MQ. Thanks in advance for your assistance, Paul View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3878300#3878300 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3878300 ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ JBoss-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jboss-user
