JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-5860

Inserting <collection-splitter /><collection-aggregator /> into a flow produces unexpected results

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 3.1.2, 3.2.0
  • Fix Version/s: 3.1.4 (EE only), 3.2.3 (EE only), 3.3.1
  • Component/s: Core: Transformers
  • Labels:
    • reviewed
    • targeted-3.3.1
  • User impact:
    High
  • Configuration:
    Hide

    <?xml version="1.0" encoding="UTF-8"?>
    <mule xmlns="http://www.mulesoft.org/schema/mule/core"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:spring="http://www.springframework.org/schema/beans"
    xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio"
    xmlns:quartz="http://www.mulesoft.org/schema/mule/quartz"
    xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting"
    xsi:schemaLocation="
    http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.mulesoft.org/schema/mule/stdio http://www.mulesoft.org/schema/mule/stdio/3.2/mule-stdio.xsd
    http://www.mulesoft.org/schema/mule/quartz http://www.mulesoft.org/schema/mule/quartz/3.2/mule-quartz.xsd
    http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/3.2/mule-scripting.xsd
    ">

    <quartz:connector name="quartzConnector">
    <quartz:factory-property key="org.quartz.scheduler.instanceName"
    value="quartzInstance" />
    <quartz:factory-property key="org.quartz.threadPool.class"
    value="org.quartz.simpl.SimpleThreadPool" />
    <quartz:factory-property key="org.quartz.threadPool.threadCount"
    value="3" />
    <quartz:factory-property key="org.quartz.scheduler.rmi.proxy"
    value="false" />
    <quartz:factory-property key="org.quartz.scheduler.rmi.export"
    value="false" />
    <quartz:factory-property key="org.quartz.jobStore.class"
    value="org.quartz.simpl.RAMJobStore" />
    </quartz:connector>

    <flow name="test">
    <quartz:inbound-endpoint name="timeTrigger"
    jobName="myJob" repeatInterval="6000" connector-ref="quartzConnector">
    <quartz:event-generator-job />
    </quartz:inbound-endpoint>

    <scripting:transformer>
    <scripting:script engine="groovy">
    <scripting:text>
    def foo = [1, 2, 3, 4, 5]
    message.setPayload(foo)
    return message
    </scripting:text>
    </scripting:script>
    </scripting:transformer>

    <collection-splitter />

    <collection-aggregator />

    <scripting:transformer>
    <scripting:script engine="groovy">
    <scripting:text>
    def foo = []
    for (def i = 0; i < payload.size(); i++) { def element = payload.get(i) foo.add(element * element) }
    println "\ntransformed: " + foo
    return foo
    </scripting:text>
    </scripting:script>
    </scripting:transformer>

    <stdio:outbound-endpoint system="OUT" />
    </flow>
    </mule>

    Show
    <?xml version="1.0" encoding="UTF-8"?> <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio" xmlns:quartz="http://www.mulesoft.org/schema/mule/quartz" xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" xsi:schemaLocation=" http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.2/mule.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.mulesoft.org/schema/mule/stdio http://www.mulesoft.org/schema/mule/stdio/3.2/mule-stdio.xsd http://www.mulesoft.org/schema/mule/quartz http://www.mulesoft.org/schema/mule/quartz/3.2/mule-quartz.xsd http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/3.2/mule-scripting.xsd "> <quartz:connector name="quartzConnector"> <quartz:factory-property key="org.quartz.scheduler.instanceName" value="quartzInstance" /> <quartz:factory-property key="org.quartz.threadPool.class" value="org.quartz.simpl.SimpleThreadPool" /> <quartz:factory-property key="org.quartz.threadPool.threadCount" value="3" /> <quartz:factory-property key="org.quartz.scheduler.rmi.proxy" value="false" /> <quartz:factory-property key="org.quartz.scheduler.rmi.export" value="false" /> <quartz:factory-property key="org.quartz.jobStore.class" value="org.quartz.simpl.RAMJobStore" /> </quartz:connector> <flow name="test"> <quartz:inbound-endpoint name="timeTrigger" jobName="myJob" repeatInterval="6000" connector-ref="quartzConnector"> <quartz:event-generator-job /> </quartz:inbound-endpoint> <scripting:transformer> <scripting:script engine="groovy"> <scripting:text> def foo = [1, 2, 3, 4, 5] message.setPayload(foo) return message </scripting:text> </scripting:script> </scripting:transformer> <collection-splitter /> <collection-aggregator /> <scripting:transformer> <scripting:script engine="groovy"> <scripting:text> def foo = [] for (def i = 0; i < payload.size(); i++) { def element = payload.get(i) foo.add(element * element) } println "\ntransformed: " + foo return foo </scripting:text> </scripting:script> </scripting:transformer> <stdio:outbound-endpoint system="OUT" /> </flow> </mule>
  • Log Output:
    Hide
    INFO 2011-10-31 14:42:12,070 [main] org.mule.DefaultMuleContext:
    **********************************************************************
    * Mule ESB and Integration Platform *
    * Version: 3.2.0 Build: 22917 *
    * MuleSoft, Inc. *
    * For more information go to http://www.mulesoft.org *
    * *
    * Server started: 10/31/11 2:42 PM *
    * Server ID: 215609bd-03c6-11e1-b1a3-3d96c762086b *
    * JDK: 1.6.0_26 (mixed mode) *
    * OS encoding: UTF-8, Mule encoding: UTF-8 *
    * OS: Mac OS X (10.6.8, x86_64) *
    * Host: myhost (x.x.x.x) *
    * *
    * Agents Running: *
    * JMX Agent *
    **********************************************************************

    [9, 4, 1, 16, 25]
    INFO 2011-10-31 14:42:12,589 [connector.stdio.mule.default.dispatcher.01] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'connector.stdio.mule.default.dispatcher.1619081930'. Object is: StdioMessageDispatcher
    INFO 2011-10-31 14:42:12,589 [connector.stdio.mule.default.dispatcher.01] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'connector.stdio.mule.default.dispatcher.1619081930'. Object is: StdioMessageDispatcher
    [3, 2, 1, 4, 5]
    [9, 25, 16, 1, 4]
    [3, 5, 4, 1, 2]
    [1, 4, 16, 9, 25]
    [1, 2, 4, 3, 5]
    Show
    INFO 2011-10-31 14:42:12,070 [main] org.mule.DefaultMuleContext: ********************************************************************** * Mule ESB and Integration Platform * * Version: 3.2.0 Build: 22917 * * MuleSoft, Inc. * * For more information go to http://www.mulesoft.org * * * * Server started: 10/31/11 2:42 PM * * Server ID: 215609bd-03c6-11e1-b1a3-3d96c762086b * * JDK: 1.6.0_26 (mixed mode) * * OS encoding: UTF-8, Mule encoding: UTF-8 * * OS: Mac OS X (10.6.8, x86_64) * * Host: myhost (x.x.x.x) * * * * Agents Running: * * JMX Agent * ********************************************************************** [9, 4, 1, 16, 25] INFO 2011-10-31 14:42:12,589 [connector.stdio.mule.default.dispatcher.01] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'connector.stdio.mule.default.dispatcher.1619081930'. Object is: StdioMessageDispatcher INFO 2011-10-31 14:42:12,589 [connector.stdio.mule.default.dispatcher.01] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'connector.stdio.mule.default.dispatcher.1619081930'. Object is: StdioMessageDispatcher [3, 2, 1, 4, 5] [9, 25, 16, 1, 4] [3, 5, 4, 1, 2] [1, 4, 16, 9, 25] [1, 2, 4, 3, 5]
  • Similar Issues:
    None

Description

The default behaviour of collection-aggregator seems strange in Mule 3.2.0 and 3.1.2;
intuitively, this is a bug (or class of bugs).
If the following is correct or partially correct then there is probably room for improvement in the docs.

Take the following structure:

<flow ...
...
<collection-splitter />
...
<collection-aggregator />

<transformer ...

<outbound-endpoint ...
</flow>

  • The above flow will afaics output what is emitted by the collection-aggregator, ignoring any latter transfomer before the outbound-endpoint.
  • If the collection-splitter emits sequence ids for the correlation group (e.g. if it's fed a list) the collection-aggregator doesn't seem to make use of it by default. Of course, a collection splitter might also be fed other payload types with no inherent ordering such as sets, where ordered output should not be expected.
    There seems to have been related issues in the past as well, e.g. MULE-5844

In the attached config, the output of the outbound-endpoint and the return value of the last transformer are different. And, as per the second point above, the order of elements in the payload is different between the same constant flow input.
If the splitter and aggregator are commeted out, they will show the same message payloads, and the ordering is constant when the input is constant.

Issue Links

is duplicated by

Bug - A problem which impairs or prevents the functions of the product. MULE-5745 <script:component>'s output ignored if used after an 'All' message processor

  • Critical - Crashes, loss of data, severe memory leak.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
relates to

Bug - A problem which impairs or prevents the functions of the product. MULE-5534 CLONE - Message modifications are discarded when using Collection Aggregator

  • Critical - Crashes, loss of data, severe memory leak.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Bug - A problem which impairs or prevents the functions of the product. DOCS-43 Combine-collections-transformer is not a transformer so it should be moved from the Transformer Configuration Reference to the Routing Message Processors page

  • Critical - Crashes, loss of data, severe memory leak.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Bug - A problem which impairs or prevents the functions of the product. MULE-4213 Response transformer results are discarded when using multicasting router

  • Critical - Crashes, loss of data, severe memory leak.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
No work has yet been logged on this issue.

People

  • Assignee:
    Pablo Kraan
    Reporter:
    Tobias Stjernefeldt
Vote (11)
Watch (14)

Dates

  • Created:
    31/Oct/11 09:16 AM
    Updated:
    02/Aug/12 09:01 AM
    Resolved:
    15/Jul/12 08:58 AM

Agile

  • Completed Sprints:
    Sprint 4 ended 12/Jul/12
    Studio Sprint 1 ended 15/Feb/13
  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.