Skip to content

Commit

Permalink
Fix source payload not preserving in call mediator
Browse files Browse the repository at this point in the history
When there isn't a defined source when using source and target with call
mediator the source supposed to be the body and after mediation the
original payload in this case source should be preserved but in this
case there isn't a define source it was not happening and I have fixed
it by adding a dummy source.

Fixes: wso2/product-micro-integrator#3086
  • Loading branch information
malakaganga committed Feb 16, 2024
1 parent 564af81 commit f4333c8
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ public Mediator createSpecificMediator(OMElement elem, Properties properties) {

OMElement targetEle = elem.getFirstChildWithName(TARGET_Q);
if (targetEle != null) {
if (sourceEle == null) {
Source source = CallMediatorEnrichUtil.createSourceWithBody();
callMediator.setSourceAvailable(true);
callMediator.setSourceForOutboundPayload(source);
}
Target target = new Target();
populateTarget(callMediator, target, targetEle);
callMediator.setTargetForInboundPayload(target);
Expand Down

0 comments on commit f4333c8

Please sign in to comment.