AxisEngine meddles with concerns of the transports, and creates a thread when sending out a message ---------------------------------------------------------------------------------------------------
Key: AXIS2-4196 URL: https://issues.apache.org/jira/browse/AXIS2-4196 Project: Axis 2.0 (Axis2) Issue Type: Bug Components: kernel Affects Versions: nightly Reporter: Asankha C. Perera Priority: Critical One of the most used widely methods of Axis2, the AxisEngine.send() method contains the following code, which causes the send operation to execute within another thread. // This boolean property only used in client side fireAndForget invocation //It will set a property into message context and if some one has set the //property then transport sender will invoke in a diffrent thread Object isTransportNonBlocking = msgContext.getProperty(MessageContext.TRANSPORT_NON_BLOCKING); if (isTransportNonBlocking != null && ((Boolean) isTransportNonBlocking).booleanValue()) { msgContext.getConfigurationContext().getThreadPool().execute( new TransportNonBlockingInvocationWorker(msgContext, sender)); } else { sender.invoke(msgContext); } //REVIEW: In the case of the TransportNonBlockingInvocationWorker, does this need to wait until that finishes? In addition, the OutOnlyAxisOperation, in its executeImpl() method does: // ship it out if (!block) { mc.setProperty(MessageContext.TRANSPORT_NON_BLOCKING, Boolean.TRUE); } The MessageContext defines this property as: /** * To invoke fireAndforget method we have to hand over transport sending logic to a thread * other wise user has to wait till it get transport response (in the case of HTTP its HTTP * 202) */ public static final String TRANSPORT_NON_BLOCKING = "transportNonBlocking"; The AxisEngine code creates a new thread "if the transport is non-blocking" which seems weired. AFAIK, the Kernel code should not be creating any threads like this, nor an AxisOperation set a property on the message about the transport. A transport blocking or non-blocking is outside of the purview of the Axis2 kernel, as even the Axis2 HTTP transports has already been implemented in both blocking and non-blocking manner. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.