Title: [809] trunk/core/src/main/java/org/servicemix/jbi/nmr/flow/seda/SedaFlow.java: If the message has been sent synchronously, do not use seda as it would consume threads from the work manager in a useless way.
- Revision
- 809
- Author
- gnt
- Date
- 2005-11-12 20:35:36 -0500 (Sat, 12 Nov 2005)
Log Message
If the message has been sent synchronously, do not use seda as it would consume threads from the work manager in a useless way. This could lead to deadlocks.
Modified Paths
Diff
Modified: trunk/core/src/main/java/org/servicemix/jbi/nmr/flow/seda/SedaFlow.java (808 => 809)
--- trunk/core/src/main/java/org/servicemix/jbi/nmr/flow/seda/SedaFlow.java 2005-11-12 23:15:42 UTC (rev 808)
+++ trunk/core/src/main/java/org/servicemix/jbi/nmr/flow/seda/SedaFlow.java 2005-11-13 01:35:36 UTC (rev 809)
@@ -23,6 +23,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.servicemix.JbiConstants;
import org.servicemix.jbi.framework.ComponentNameSpace;
import org.servicemix.jbi.framework.ComponentPacketEvent;
import org.servicemix.jbi.framework.ComponentPacketEventListener;
@@ -128,7 +129,12 @@
* @throws JBIException
*/
protected void doSend(MessageExchangeImpl me) throws JBIException {
- if (me.getProperty(MessageExchange.JTA_TRANSACTION_PROPERTY_NAME) == null) {
+ // If the message has been sent synchronously, do not use seda
+ // as it would consume threads from the work manager in a useless
+ // way. This could lead to deadlocks.
+ if (me.getProperty(MessageExchange.JTA_TRANSACTION_PROPERTY_NAME) == null &&
+ me.getSyncState() == MessageExchangeImpl.SYNC_STATE_ASYNC &&
+ me.getMirror().getSyncState() == MessageExchangeImpl.SYNC_STATE_ASYNC) {
enqueuePacket(me);
}
else {