Hi,
This is regarding the BAM Mediator 4.2.0.
As it looks like currently the BAM Mediator is executing the data
publishing logic in the same thread which the current message mediation is
happening:
public class BamMediator:
public boolean mediate(MessageContext messageContext) {
...
try {
stream.sendEvents(messageContext);
} catch (BamMediatorException e) {
return true;
}
}
}
public class Stream {
...
public void sendEvents(MessageContext messageContext) throws
BamMediatorException {
ActivityIDSetter activityIDSetter = new ActivityIDSetter();
activityIDSetter.setActivityIdInTransportHeader(messageContext);
try {
if (!isPublisherCreated) {
initializeDataPublisher(this);
isPublisherCreated = true;
}
this.publishEvent(messageContext);
} catch (BamMediatorException e) {
String errorMsg = "Problem occurred while logging events
in the BAM Mediator. " + e.getMessage();
log.error(errorMsg, e);
throw new BamMediatorException(errorMsg, e);
}
}
...
}
I think if we move this logic to a new thread we could reduce the time it
takes to execute the data publishing logic from the main message flow. WDYT?
Thanks
--
*Imesh Gunaratne*
Technical Lead
WSO2 Inc: http://wso2.com
T: +94 11 214 5345 M: +94 77 374 2057
W: http://imesh.gunaratne.org
Lean . Enterprise . Middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev