-
Notifications
You must be signed in to change notification settings - Fork 268
Add trace filter support, custom headers and add opentelemetry to dataservices #4520
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -24,6 +24,9 @@ | |||||||
| import org.apache.commons.logging.Log; | ||||||||
| import org.apache.commons.logging.LogFactory; | ||||||||
| import org.wso2.micro.integrator.dataservices.common.DBConstants; | ||||||||
| import org.wso2.micro.integrator.dataservices.core.opentelemetry.DataServicesTracingCollector; | ||||||||
|
|
||||||||
| import static org.wso2.micro.integrator.dataservices.core.opentelemetry.DataServicesTracingConstants.DATA_SERVICE_INDEX; | ||||||||
|
|
||||||||
| /** | ||||||||
| * This class represents the Axis2 message receiver used to dispatch in-only service calls. | ||||||||
|
|
@@ -42,26 +45,29 @@ public class DBInOnlyMessageReceiver extends RawXMLINOnlyMessageReceiver { | |||||||
| * on invalid method (wrong signature) or behavior (return | ||||||||
| * null) | ||||||||
| */ | ||||||||
| public void invokeBusinessLogic(MessageContext msgContext) throws AxisFault { | ||||||||
| try { | ||||||||
| if (log.isDebugEnabled()) { | ||||||||
| log.debug("Request received to DSS: Data Service - " + msgContext.getServiceContext().getName() + | ||||||||
| ", Operation - " + msgContext.getSoapAction() + ", Request body - " + | ||||||||
| msgContext.getEnvelope().getText() + ", ThreadID - " + Thread.currentThread().getId()); | ||||||||
| } | ||||||||
| DataServiceProcessor.dispatch(msgContext); | ||||||||
| msgContext.setProperty(DBConstants.TENANT_IN_ONLY_MESSAGE, Boolean.TRUE); | ||||||||
| } catch (Exception e) { | ||||||||
| log.error("Error in in-only message receiver", e); | ||||||||
| msgContext.setProperty(Constants.FAULT_NAME, DBConstants.DS_FAULT_NAME); | ||||||||
| throw DBUtils.createAxisFault(e); | ||||||||
| } finally { | ||||||||
| if (log.isDebugEnabled()) { | ||||||||
| log.debug("Request processing completed from DSS: Data Service - " + | ||||||||
| msgContext.getServiceContext().getName() + ", Operation - " + msgContext.getSoapAction() + | ||||||||
| ", ThreadID - " + Thread.currentThread().getId()); | ||||||||
| } | ||||||||
| } | ||||||||
| } | ||||||||
|
|
||||||||
| public void invokeBusinessLogic(MessageContext msgContext) throws AxisFault { | ||||||||
| try { | ||||||||
| if (log.isDebugEnabled()) { | ||||||||
| log.debug("Request received to DSS: Data Service - " + msgContext.getServiceContext().getName() + | ||||||||
| ", Operation - " + msgContext.getSoapAction() + ", Request body - " + | ||||||||
| msgContext.getEnvelope().getText() + ", ThreadID - " + Thread.currentThread().getId()); | ||||||||
| } | ||||||||
| DataServicesTracingCollector.reportEntryEvent(msgContext); | ||||||||
| DataServiceProcessor.dispatch(msgContext); | ||||||||
| msgContext.setProperty(DBConstants.TENANT_IN_ONLY_MESSAGE, Boolean.TRUE); | ||||||||
| DataServicesTracingCollector.closeEntryEvent(msgContext, null); | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Log Improvement Suggestion No: 2
Suggested change
|
||||||||
| } catch (Exception e) { | ||||||||
| log.error("Error in in-only message receiver", e); | ||||||||
| msgContext.setProperty(Constants.FAULT_NAME, DBConstants.DS_FAULT_NAME); | ||||||||
| DataServicesTracingCollector.closeFlowForcefully(msgContext, DATA_SERVICE_INDEX, e); | ||||||||
| throw DBUtils.createAxisFault(e); | ||||||||
| } finally { | ||||||||
| if (log.isDebugEnabled()) { | ||||||||
| log.debug("Request processing completed from DSS: Data Service - " + | ||||||||
| msgContext.getServiceContext().getName() + ", Operation - " + msgContext.getSoapAction() + | ||||||||
| ", ThreadID - " + Thread.currentThread().getId()); | ||||||||
| } | ||||||||
| } | ||||||||
| } | ||||||||
|
|
||||||||
| } | ||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -29,9 +29,12 @@ | |||||||||||||||||
| import org.apache.commons.logging.Log; | ||||||||||||||||||
| import org.apache.commons.logging.LogFactory; | ||||||||||||||||||
| import org.wso2.micro.integrator.dataservices.common.DBConstants; | ||||||||||||||||||
| import org.wso2.micro.integrator.dataservices.core.opentelemetry.DataServicesTracingCollector; | ||||||||||||||||||
|
|
||||||||||||||||||
| import java.util.Map; | ||||||||||||||||||
|
|
||||||||||||||||||
| import static org.wso2.micro.integrator.dataservices.core.opentelemetry.DataServicesTracingConstants.DATA_SERVICE_INDEX; | ||||||||||||||||||
|
|
||||||||||||||||||
| /** | ||||||||||||||||||
| * This class represents the Axis2 message receiver used to dispatch in-out service calls. | ||||||||||||||||||
| */ | ||||||||||||||||||
|
|
@@ -59,6 +62,7 @@ public void invokeBusinessLogic(MessageContext msgContext, | |||||||||||||||||
| ", Operation - " + msgContext.getSoapAction() + ", Request body - " + | ||||||||||||||||||
| msgContext.getEnvelope().getText() + ", ThreadID - " + Thread.currentThread().getId()); | ||||||||||||||||||
| } | ||||||||||||||||||
| DataServicesTracingCollector.reportEntryEvent(msgContext); | ||||||||||||||||||
| boolean isAcceptJson = false; | ||||||||||||||||||
| Map transportHeaders = (Map) msgContext.getProperty(MessageContext.TRANSPORT_HEADERS); | ||||||||||||||||||
| if (transportHeaders != null) { | ||||||||||||||||||
|
|
@@ -91,9 +95,11 @@ public void invokeBusinessLogic(MessageContext msgContext, | |||||||||||||||||
| newMsgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, | ||||||||||||||||||
| HTTPConstants.MEDIA_TYPE_APPLICATION_JSON); | ||||||||||||||||||
| } | ||||||||||||||||||
| DataServicesTracingCollector.closeEntryEvent(msgContext, result); | ||||||||||||||||||
|
Comment on lines
95
to
+98
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Log Improvement Suggestion No: 4
Suggested change
|
||||||||||||||||||
| } catch (Exception e) { | ||||||||||||||||||
| log.error("Error in in-out message receiver", e); | ||||||||||||||||||
| msgContext.setProperty(Constants.FAULT_NAME, DBConstants.DS_FAULT_NAME); | ||||||||||||||||||
| DataServicesTracingCollector.closeFlowForcefully(msgContext, DATA_SERVICE_INDEX, e); | ||||||||||||||||||
| throw DBUtils.createAxisFault(e); | ||||||||||||||||||
| } finally { | ||||||||||||||||||
| if (msgContext.getProperty(DATA_SERVICE_LATENCY_TIMER) != null) { | ||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -26,6 +26,7 @@ | |||||||||||||
| import org.wso2.micro.integrator.dataservices.core.dispatch.DataServiceRequest; | ||||||||||||||
| import org.wso2.micro.integrator.dataservices.core.dispatch.DispatchStatus; | ||||||||||||||
| import org.wso2.micro.integrator.dataservices.core.engine.DataService; | ||||||||||||||
| import org.wso2.micro.integrator.dataservices.core.opentelemetry.DataServicesTracingCollector; | ||||||||||||||
|
|
||||||||||||||
| import javax.xml.namespace.QName; | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -37,7 +38,8 @@ public class DataServiceProcessor { | |||||||||||||
| public static OMElement dispatch(MessageContext msgContext) throws DataServiceFault { | ||||||||||||||
| DispatchStatus.clearRequestStatus(); | ||||||||||||||
| DataServiceRequest request = DataServiceRequest.createDataServiceRequest(msgContext); | ||||||||||||||
| OMElement result = request.dispatch(); | ||||||||||||||
| DataServicesTracingCollector.reportQueryExecutionEvent(msgContext, request); | ||||||||||||||
|
Comment on lines
40
to
+41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Log Improvement Suggestion No: 5
Suggested change
|
||||||||||||||
| OMElement result = request.dispatch(msgContext); | ||||||||||||||
| if (result == null) { | ||||||||||||||
| DataService ds = request.getDataService(); | ||||||||||||||
| String requestName = request.getRequestName(); | ||||||||||||||
|
|
@@ -46,6 +48,7 @@ public static OMElement dispatch(MessageContext msgContext) throws DataServiceFa | |||||||||||||
| result = generateRequestSuccessElement(); | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| DataServicesTracingCollector.closeQueryExecutionEvent(msgContext, result); | ||||||||||||||
| return result; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,10 +23,14 @@ | |||||||||||||||||||||||||||||||||||||||||||||||
| import javax.xml.stream.XMLStreamException; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.axiom.om.OMElement; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.axis2.context.MessageContext; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import org.apache.commons.io.output.NullOutputStream; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import org.wso2.micro.integrator.dataservices.core.DBUtils; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import org.wso2.micro.integrator.dataservices.core.DataServiceFault; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import org.wso2.micro.integrator.dataservices.core.dispatch.DataServiceRequest; | ||||||||||||||||||||||||||||||||||||||||||||||||
| import org.wso2.micro.integrator.dataservices.core.opentelemetry.DataServicesTracingCollector; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| import static org.wso2.micro.integrator.dataservices.core.opentelemetry.DataServicesTracingConstants.MULTI_REQUEST_LAST_INDEX_PROPERTY; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||||||||||
| * Represents a boxcarring session service request group. | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -56,13 +60,16 @@ public void clear() { | |||||||||||||||||||||||||||||||||||||||||||||||
| * and the stored requests will be executed, | ||||||||||||||||||||||||||||||||||||||||||||||||
| * the result of the last operation is returned. | ||||||||||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||||||||||
| public synchronized OMElement execute() throws DataServiceFault { | ||||||||||||||||||||||||||||||||||||||||||||||||
| public synchronized OMElement execute(MessageContext messageContext) throws DataServiceFault { | ||||||||||||||||||||||||||||||||||||||||||||||||
| OMElement result; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+63
to
64
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Log Improvement Suggestion No: 7
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||
| List<DataServiceRequest> reqList = this.getRequests(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| int n = reqList.size(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| OMElement resultElement = null; | ||||||||||||||||||||||||||||||||||||||||||||||||
| for (int i = 0; i < n; i++) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| result = reqList.get(i).dispatch(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| DataServicesTracingCollector.reportMultiEvent(messageContext, i, reqList.get(i)); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
68
to
+69
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Log Improvement Suggestion No: 8
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||
| messageContext.setProperty(MULTI_REQUEST_LAST_INDEX_PROPERTY, i); | ||||||||||||||||||||||||||||||||||||||||||||||||
| result = reqList.get(i).dispatch(messageContext); | ||||||||||||||||||||||||||||||||||||||||||||||||
| DataServicesTracingCollector.closerMultiEvent(messageContext, i, result); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+63
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential NullPointerException if Line 70 calls Consider adding a null guard: for (int i = 0; i < n; i++) {
DataServicesTracingCollector.reportMultiEvent(messageContext, i, reqList.get(i));
- messageContext.setProperty(MULTI_REQUEST_LAST_INDEX_PROPERTY, i);
+ if (messageContext != null) {
+ messageContext.setProperty(MULTI_REQUEST_LAST_INDEX_PROPERTY, i);
+ }
result = reqList.get(i).dispatch(messageContext);
DataServicesTracingCollector.closerMultiEvent(messageContext, i, result);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check this suggestion There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AmilaSamith, I've reviewed the suggestion. The concern is valid based on the code flow: Tracing the null path:
Result: If the no-arg The suggested null guard is appropriate since:
Would you like to apply this fix, or is there a guarantee that |
||||||||||||||||||||||||||||||||||||||||||||||||
| if (result != null) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||
| /* if it's the last request, return the result, | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| import org.apache.axiom.om.OMElement; | ||||||||||||||||||||||||||||||||
| import org.apache.axiom.om.OMFactory; | ||||||||||||||||||||||||||||||||
| import org.apache.axis2.context.MessageContext; | ||||||||||||||||||||||||||||||||
| import org.wso2.micro.integrator.dataservices.common.DBConstants.BoxcarringOps; | ||||||||||||||||||||||||||||||||
| import org.wso2.micro.integrator.dataservices.core.DBUtils; | ||||||||||||||||||||||||||||||||
| import org.wso2.micro.integrator.dataservices.core.DSSessionManager; | ||||||||||||||||||||||||||||||||
|
|
@@ -48,10 +49,10 @@ public DataServiceRequest getDSRequest() { | |||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||
| * @see DataServiceRequest#processRequest() | ||||||||||||||||||||||||||||||||
| * @see DataServiceRequest#processRequest(MessageContext messageContext) | ||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||
| @Override | ||||||||||||||||||||||||||||||||
| public OMElement processRequest() throws DataServiceFault { | ||||||||||||||||||||||||||||||||
| public OMElement processRequest(MessageContext messageContext) throws DataServiceFault { | ||||||||||||||||||||||||||||||||
| if (BoxcarringOps.BEGIN_BOXCAR.equals(this.getRequestName())) { | ||||||||||||||||||||||||||||||||
| /* clear earlier boxcarring sessions */ | ||||||||||||||||||||||||||||||||
| DSSessionManager.getCurrentRequestBox().clear(); | ||||||||||||||||||||||||||||||||
|
|
@@ -65,7 +66,7 @@ public OMElement processRequest() throws DataServiceFault { | |||||||||||||||||||||||||||||||
| if (!this.getDataService().isInDTX()) { | ||||||||||||||||||||||||||||||||
| this.getDataService().getDSSTxManager().begin(); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| OMElement lastRequestResult = DSSessionManager.getCurrentRequestBox().execute(); | ||||||||||||||||||||||||||||||||
| OMElement lastRequestResult = DSSessionManager.getCurrentRequestBox().execute(messageContext); | ||||||||||||||||||||||||||||||||
| error = false; | ||||||||||||||||||||||||||||||||
|
Comment on lines
66
to
70
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Log Improvement Suggestion No: 12
Suggested change
|
||||||||||||||||||||||||||||||||
| return lastRequestResult; | ||||||||||||||||||||||||||||||||
| } finally { | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -299,7 +299,8 @@ private static List<Map<String, ParamValue>> getBatchInputValuesFromOM( | |||||||||||||||
| */ | ||||||||||||||||
| @SuppressWarnings("unchecked") | ||||||||||||||||
| private static DataServiceRequest createRequestBoxRequest(DataService dataService, String requestName, | ||||||||||||||||
| OMElement inputMessage) throws DataServiceFault { | ||||||||||||||||
| OMElement inputMessage) | ||||||||||||||||
| throws DataServiceFault { | ||||||||||||||||
| RequestBoxRequest dsRequest = new RequestBoxRequest(dataService, requestName); | ||||||||||||||||
|
|
||||||||||||||||
| if (inputMessage == null) { | ||||||||||||||||
|
|
@@ -352,11 +353,11 @@ public String[] getUserRoles() { | |||||||||||||||
|
|
||||||||||||||||
| /** | ||||||||||||||||
| * Dispatches the current request. This method does common dispatching logic and call the | ||||||||||||||||
| * request type specific {@link DataServiceRequest}{@link #processRequest()} method. | ||||||||||||||||
| * request type specific {@link DataServiceRequest}{@link #processRequest(MessageContext messageContext)} method. | ||||||||||||||||
| * @return The result of the request invocation | ||||||||||||||||
| * @throws DataServiceFault | ||||||||||||||||
| */ | ||||||||||||||||
| public OMElement dispatch() throws DataServiceFault { | ||||||||||||||||
| public OMElement dispatch(MessageContext messageContext) throws DataServiceFault { | ||||||||||||||||
|
Comment on lines
359
to
+360
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Log Improvement Suggestion No: 13
Suggested change
|
||||||||||||||||
| /* set user */ | ||||||||||||||||
| if (this.getUserRoles() != null) { | ||||||||||||||||
| DataServiceUser currentUser = new DataServiceUser(this.getUser(), | ||||||||||||||||
|
|
@@ -365,7 +366,7 @@ public OMElement dispatch() throws DataServiceFault { | |||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| /* request specific processing */ | ||||||||||||||||
| OMElement result = this.processRequest(); | ||||||||||||||||
| OMElement result = this.processRequest(messageContext); | ||||||||||||||||
| /* check disable streaming */ | ||||||||||||||||
|
Comment on lines
+369
to
370
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Log Improvement Suggestion No: 14
Suggested change
|
||||||||||||||||
| if (this.isDisableStreaming()) { | ||||||||||||||||
| /* if result is of type OMSourcedElementImpl, that means, | ||||||||||||||||
|
|
@@ -376,12 +377,22 @@ public OMElement dispatch() throws DataServiceFault { | |||||||||||||||
| } | ||||||||||||||||
| return result; | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| /** | ||||||||||||||||
| * Dispatches the current request. | ||||||||||||||||
| * | ||||||||||||||||
| * @return The result of the request invocation | ||||||||||||||||
| * @throws DataServiceFault | ||||||||||||||||
| */ | ||||||||||||||||
| public OMElement dispatch() throws DataServiceFault { | ||||||||||||||||
| return dispatch(null); | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| /** | ||||||||||||||||
| * This method must implement the request specific request processing logic. | ||||||||||||||||
| * @param messageContext Axis2 message context of the request | ||||||||||||||||
| * @return The result of the request invocation | ||||||||||||||||
| * @throws DataServiceFault | ||||||||||||||||
| */ | ||||||||||||||||
| public abstract OMElement processRequest() throws DataServiceFault; | ||||||||||||||||
|
|
||||||||||||||||
| */ | ||||||||||||||||
| public abstract OMElement processRequest(MessageContext messageContext) throws DataServiceFault; | ||||||||||||||||
| } | ||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,11 +18,13 @@ | |||||||
| package org.wso2.micro.integrator.dataservices.core.dispatch; | ||||||||
|
|
||||||||
| import org.apache.axiom.om.OMElement; | ||||||||
| import org.apache.axis2.context.MessageContext; | ||||||||
| import org.wso2.micro.integrator.dataservices.core.DataServiceFault; | ||||||||
| import org.wso2.micro.integrator.dataservices.core.TLConnectionStore; | ||||||||
| import org.wso2.micro.integrator.dataservices.core.boxcarring.RequestBox; | ||||||||
| import org.wso2.micro.integrator.dataservices.core.boxcarring.TLParamStore; | ||||||||
| import org.wso2.micro.integrator.dataservices.core.engine.DataService; | ||||||||
| import org.wso2.micro.integrator.dataservices.core.opentelemetry.DataServicesTracingCollector; | ||||||||
|
|
||||||||
| /** | ||||||||
| * Request box data service request for request grouping. | ||||||||
|
|
@@ -54,18 +56,18 @@ public void addRequests(DataServiceRequest request) { | |||||||
| } | ||||||||
|
|
||||||||
| /** | ||||||||
| * @see DataServiceRequest#processRequest() | ||||||||
| * @see DataServiceRequest#processRequest(MessageContext messageContext) | ||||||||
| */ | ||||||||
| @Override | ||||||||
| public OMElement processRequest() throws DataServiceFault { | ||||||||
| public OMElement processRequest(MessageContext messageContext) throws DataServiceFault { | ||||||||
|
|
||||||||
| boolean error = true; | ||||||||
| try { | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Log Improvement Suggestion No: 15
Suggested change
|
||||||||
| DispatchStatus.setBoxcarringRequest(); | ||||||||
| if (!this.getDataService().isInDTX()) { | ||||||||
| this.getDataService().getDSSTxManager().begin(); | ||||||||
| } | ||||||||
| OMElement lastRequestResult = this.requestBox.execute(); | ||||||||
| OMElement lastRequestResult = this.requestBox.execute(messageContext); | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Log Improvement Suggestion No: 16
Suggested change
|
||||||||
| error = false; | ||||||||
| return lastRequestResult; | ||||||||
| } finally { | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -24,6 +24,7 @@ | |||||||||||||
|
|
||||||||||||||
| import org.apache.axiom.om.OMElement; | ||||||||||||||
| import org.apache.axiom.om.impl.llom.OMSourcedElementImpl; | ||||||||||||||
| import org.apache.axis2.context.MessageContext; | ||||||||||||||
| import org.wso2.micro.integrator.dataservices.core.DBUtils; | ||||||||||||||
| import org.wso2.micro.integrator.dataservices.core.DataServiceFault; | ||||||||||||||
| import org.wso2.micro.integrator.dataservices.core.XSLTTransformer; | ||||||||||||||
|
|
@@ -55,10 +56,10 @@ public Map<String, ParamValue> getParams() { | |||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| /** | ||||||||||||||
| * @see DataServiceRequest#processRequest() | ||||||||||||||
| * @see DataServiceRequest#processRequest(MessageContext messageContext) | ||||||||||||||
| */ | ||||||||||||||
| @Override | ||||||||||||||
| public OMElement processRequest() throws DataServiceFault { | ||||||||||||||
| public OMElement processRequest(MessageContext messageContext) throws DataServiceFault { | ||||||||||||||
|
Comment on lines
61
to
+62
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Log Improvement Suggestion No: 17
Suggested change
|
||||||||||||||
| try { | ||||||||||||||
| Query.resetQueryPreprocessing(); | ||||||||||||||
| Query.setQueryPreprocessingInitial(true); | ||||||||||||||
|
|
||||||||||||||
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.
Log Improvement Suggestion No: 1