Title: [812] branches/servicemix-2.0/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
812
Author
gnt
Date
2005-11-13 06:33:12 -0500 (Sun, 13 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: branches/servicemix-2.0/trunk/core/src/main/java/org/servicemix/jbi/nmr/flow/seda/SedaFlow.java (811 => 812)

--- branches/servicemix-2.0/trunk/core/src/main/java/org/servicemix/jbi/nmr/flow/seda/SedaFlow.java	2005-11-13 01:43:11 UTC (rev 811)
+++ branches/servicemix-2.0/trunk/core/src/main/java/org/servicemix/jbi/nmr/flow/seda/SedaFlow.java	2005-11-13 11:33:12 UTC (rev 812)
@@ -128,7 +128,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 {

Reply via email to