I am aggregating two payloads using the scatter gather in mule. but the problem is sometimes one of the payloads don't contain any values then the aggregation payload looks like:
[{postalCode=7560, addressLine4=-1}, {NullPayload}]
how can i remove the null payload. or how do i set the aggregation to only aggregate when both payloads contain values.
this is my scatter gather:
<scatter-gather doc:name="Scatter-Gather">
<processor-chain>
<http:outbound-endpoint exchange-pattern="request-response"
method="GET"
address="http://localhost:8080/service/address/postal/#[sessionVars['entityId']]"
doc:name="HTTP" />
<data-mapper:transform config-ref="JSON_To_Map_1"
doc:name="JSON To Map" />
</processor-chain>
<processor-chain>
<http:outbound-endpoint exchange-pattern="request-response"
method="GET"
address="http://localhost:8080/service/address/email/#[sessionVars['entityId']]"
doc:name="HTTP" />
<data-mapper:transform config-ref="JSON_To_Map"
doc:name="JSON To Map" />
</processor-chain>
</scatter-gather>
so basically its two services that return postal address and email address. but sometimes there is no email address. then the payload must only contain the postal address and no the postal address with a null payload.