Return-Path: Delivered-To: apmail-activemq-camel-dev-archive@locus.apache.org Received: (qmail 33424 invoked from network); 11 Oct 2008 03:10:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Oct 2008 03:10:44 -0000 Received: (qmail 54681 invoked by uid 500); 11 Oct 2008 03:10:43 -0000 Delivered-To: apmail-activemq-camel-dev-archive@activemq.apache.org Received: (qmail 54663 invoked by uid 500); 11 Oct 2008 03:10:43 -0000 Mailing-List: contact camel-dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-dev@activemq.apache.org Delivered-To: mailing list camel-dev@activemq.apache.org Received: (qmail 54652 invoked by uid 99); 11 Oct 2008 03:10:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2008 20:10:43 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Oct 2008 03:09:47 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 65B15234C218 for ; Fri, 10 Oct 2008 20:09:53 -0700 (PDT) Message-ID: <1253968698.1223694593411.JavaMail.jira@brutus> Date: Fri, 10 Oct 2008 20:09:53 -0700 (PDT) From: "Ron Gavlin (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Commented: (CAMEL-814) Provide Aggregation Strategy/Collection implementation(s) that can be used to replace smx-eip SplitterAggregator & RecipientListAggregator In-Reply-To: <1591299192.1218546292579.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46361#action_46361 ] Ron Gavlin commented on CAMEL-814: ---------------------------------- Hi Claus, The following servicemix-eip class is responsible for building aggregate messages for both Splitters and RecipientLists. The buildAggregate() method listed below actually builds the aggregate message. The two element names and attribute names used to build the aggregate message are also listed below, each of which is customizable in a declarative fashion. It would be ideal if folks upgrading from servicemix-eip to servicemix-camel were provided an out-of-the-box aggregator strategy/collection that built aggregate messages using the same format. Existing smx-eip customers have already built follow-on transforms that expect to find this format. Let me know if you have further questions. Ron http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-eip/trunk/src/main/java/org/apache/servicemix/eip/patterns/SplitAggregator.java?view=markup protected QName aggregateElementName = new QName("aggregate"); protected QName messageElementName = new QName("message"); protected String countAttribute = "count"; protected String indexAttribute = "index"; public void buildAggregate(Object aggregation, NormalizedMessage message, MessageExchange exchange, boolean doTimeout) throws Exception { NormalizedMessage[] messages = ((SplitterAggregation) aggregation).messages; String correlationId = ((SplitterAggregation) aggregation).correlationId; SourceTransformer st = new SourceTransformer(); Document doc = st.createDocument(); Element root = createChildElement(aggregateElementName, doc); root.setAttribute(countAttribute, Integer.toString(messages.length)); for (int i = 0; i < messages.length; i++) { if (messages[i] != null) { Element elem = st.toDOMElement(messages[i]); if (messageElementName != null) { Element msg = createChildElement(messageElementName, root); msg.setAttribute(indexAttribute, Integer.toString(i)); msg.appendChild(doc.importNode(elem, true)); } else { root.appendChild(doc.importNode(elem, true)); } if (isCopyProperties()) { copyProperties(messages[i], message); } if (isCopyAttachments()) { copyAttachments(messages[i], message); } } } message.setContent(new DOMSource(doc)); message.setProperty(AbstractSplitter.SPLITTER_CORRID, correlationId); } protected Element createChildElement(QName name, Node parent) { Document doc = parent instanceof Document ? (Document) parent : parent.getOwnerDocument(); Element elem; if ("".equals(name.getNamespaceURI())) { elem = doc.createElement(name.getLocalPart()); } else { elem = doc.createElementNS(name.getNamespaceURI(), name.getPrefix() + ":" + name.getLocalPart()); } parent.appendChild(elem); return elem; } > Provide Aggregation Strategy/Collection implementation(s) that can be used to replace smx-eip SplitterAggregator & RecipientListAggregator > ------------------------------------------------------------------------------------------------------------------------------------------ > > Key: CAMEL-814 > URL: https://issues.apache.org/activemq/browse/CAMEL-814 > Project: Apache Camel > Issue Type: Improvement > Components: camel-core > Affects Versions: 1.4.0 > Reporter: Ron Gavlin > > Users looking to upgrade from smx-eip to smx-camel should be provided an out-of-the-box aggregator strategy/collection to replace the smx-eip SplitterAggregator & RecipientListAggregator. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.