-
Notifications
You must be signed in to change notification settings - Fork 441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Scatter Gather mediator #2231
Conversation
8e410ba
to
1c0e2ef
Compare
modules/core/src/main/java/org/apache/synapse/mediators/v2/ScatterGather.java
Outdated
Show resolved
Hide resolved
684fb76
to
6c6b6eb
Compare
cae9aeb
to
d304c77
Compare
modules/core/src/main/java/org/apache/synapse/mediators/MediatorWorker.java
Show resolved
Hide resolved
MessageContext newCtx = null; | ||
if (Objects.equals(contentType, JSON_TYPE)) { | ||
JsonArray jsonArray = new JsonArray(); | ||
log.debug("Merging aggregated JSON responses to body"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we check before log debug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are not doing any string concatenations, we don't need to check debugEnabled
1b4379f
to
f320da0
Compare
|
||
OMAttribute contentTypeAttr = elem.getAttribute(CONTENT_TYPE_Q); | ||
if (contentTypeAttr == null || StringUtils.isBlank(contentTypeAttr.getAttributeValue())) { | ||
String msg = "The 'content-type' attribute is required for the configuration of a Scatter Gather mediator"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed to derive this from the message context, and make this optional right? Was that changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are creating a new message after aggregating the responses we cannot derive this. Since the new synapse expression return a JSON object from XML payload and vice versa, the new message will be converted to the given content type. Further we need to have a root element to append XML payload, Hence we will need to have this content type parameter.
f28de29
to
3f9d901
Compare
...apse/aspects/flow/statistics/tracing/opentelemetry/management/handling/span/SpanHandler.java
Outdated
Show resolved
Hide resolved
3f9d901
to
e0c7d37
Compare
Purpose
Add new mediator to clone the messages and aggregate the results.
Syntax
Sample configuration