-
1. Re: Aggregator demo...how does it work?
tcunning Feb 12, 2014 10:09 AM (in response to kbjorndahl)Keith,
There's actually two aggregators - the legacy aggregator (org.jboss.soa.esb.actions.Aggregator) that has been around since JBoss ESB 4.0, and the Streaming Aggregator (org.jboss.soa.esb.actions.aggregator.StreamingAggregator) that was introduced in one of the more recent releases to solve some performance issues. I would highly suggest using the StreamingAggregator - which is demonstrated in the streaming_aggregator quickstart.
The legacy aggregator looks for an org.jboss.soa.esb.actions.AggregationDetails object stored in the message properties under the "aggregatorTag" property. The Aggregation Details store the aggregation size and the message's sequence number within the aggregation, and the Aggregator tracks whether all messages from the aggregation series start to the end are received.
The downside of this approach was performance, because you needed to know the size of the aggregation before sending the first message. The streaming aggregator solves this by not requiring you to send the aggregation size until the last message - for large data sets this is a boon because you do not need to precompute how large they are.
The streaming_aggregator quickstart also should be a lot easier to follow - if you take a look at the IncomingComposer.java, you should be able to see how the AggregationDetails are set on the mesage.
-
2. Re: Aggregator demo...how does it work?
kbjorndahl Feb 12, 2014 8:48 PM (in response to tcunning)Thanks for your well described answer.
I also looked into the Smooks version of the StreamingAggregator sample, and upon poking into the messages that Smooks split out, it appears that it sets the AggregationDetails as it splits out the messages.
My end goal is to be able to have a system send messages to a queue throughout the day, and at the end of the day aggregate all the messages and pump them out to a flat (fixed width) file using a notifier. It looks like, to do this, I'll need to have the messages tagged throughout the day with the same AggregationDetails so they can be aggregated. Can UUID be any unique string (ie. maybe queue name+date or something like that).
Of course, looking for a solution that is more configuration than customization :-)
-
3. Re: Aggregator demo...how does it work?
tcunning Feb 13, 2014 8:59 AM (in response to kbjorndahl)1 of 1 people found this helpfulYes, as long as it is unique, UUID can be any string.
I don't think you need to tag the messages throughout the day - you could tag them at the end of the day as you forward them from your middle man queue to your aggregator service. It'd probably be a lot easier on maintaining the same UUID and the counts to do it that way.
-
4. Re: Aggregator demo...how does it work?
kbjorndahl Feb 13, 2014 11:13 AM (in response to tcunning)I think the trick here is to schedule the forwarding from the middle man queue to the aggregator once a day. I'm new to JBoss, but it looks like the notifier service can only call a method on the bean, so I think the trick will be to have that method some how 'kick off' the aggregator.
Creating scheduled FTP or file outputs from a day's worth of transactions is a pretty common pattern...I'm sure it can't be nearly as hard as I'm making it...but yet, here I am :-)
-
5. Re: Aggregator demo...how does it work?
tcunning Feb 13, 2014 11:56 AM (in response to kbjorndahl)1 of 1 people found this helpfulKeith,
There's a scheduler gateway (see the scheduled_services quickstart). Essentially you'll have a service that is triggered once per night and you'll have to implement your action so that it so that loops through messages in the queue and sends them to the aggregator service - you'd probably use the ServiceInvoker for delivery.
Once you have your aggregated message, look at the FTP Notifier.
--Tom
-
6. Re: Aggregator demo...how does it work?
kbjorndahl Feb 13, 2014 12:25 PM (in response to tcunning)Ya, I have the scheduler gateway figured out, and have managed to figure out how to loop through JMS messages, but all the samples of ServiceInvoker seem to be to add messages to the queue, but I haven't (as of yet) found any examples of how to iterate through an ESB Message queue.
Thanks for all your help so far Tom.