Skip to content

Instantly share code, notes, and snippets.

@GDLMadushanka
Created November 17, 2018 07:25
Show Gist options
  • Save GDLMadushanka/e155379f3b827e2414d103aa3ea936c9 to your computer and use it in GitHub Desktop.
Save GDLMadushanka/e155379f3b827e2414d103aa3ea936c9 to your computer and use it in GitHub Desktop.
JSON support in Aggregate mediator
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="AggregateMessageProxy"
transports="http https"
startOnLoad="true">
<description/>
<target>
<inSequence>
<property name="enclosing_element" scope="default">
<Aggregated_Stations/>
</property>
<clone>
<target>
<endpoint name="Cape">
<address uri="http://www.mocky.io/v2/5befbf782f000067007a0be4" format="get"/>
</endpoint>
</target>
<target>
<endpoint name="KSC">
<address uri="http://www.mocky.io/v2/5befbfd22f00009a007a0be5" format="get"/>
</endpoint>
</target>
<target>
<endpoint name="Vandenberg">
<address uri="http://www.mocky.io/v2/5befbffe2f00006a007a0be6" format="get"/>
</endpoint>
</target>
<target>
<endpoint name="BocaChica">
<address uri="http://www.mocky.io/v2/5befc02b2f00008a007a0be7" format="get"/>
</endpoint>
</target>
</clone>
</inSequence>
<outSequence>
<aggregate>
<correlateOn expression="json-eval($.station.no_of_launches)"/>
<completeCondition>
<messageCount min="3" max="-1"/>
</completeCondition>
<onComplete expression="json-eval($.)" enclosingElementProperty="enclosing_element">
<property name="messageType" value="application/json" scope="axis2"/>
<log level="custom">
<property name="Aggregated_Stations =========================== "
expression="json-eval($.)"/>
</log>
<respond/>
</onComplete>
</aggregate>
</outSequence>
</target>
</proxy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment