servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1523536 - /servicemix/components/trunk/engines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/JbiHelper.java
Date Mon, 16 Sep 2013 02:46:17 GMT
Author: ffang
Date: Mon Sep 16 02:46:17 2013
New Revision: 1523536

URL: http://svn.apache.org/r1523536
Log:
[SMXCOMP-973]Servicemix-drools - exchange submited two times, second raise error in logs

Modified:
    servicemix/components/trunk/engines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/JbiHelper.java

Modified: servicemix/components/trunk/engines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/JbiHelper.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/JbiHelper.java?rev=1523536&r1=1523535&r2=1523536&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/JbiHelper.java
(original)
+++ servicemix/components/trunk/engines/servicemix-drools/src/main/java/org/apache/servicemix/drools/model/JbiHelper.java
Mon Sep 16 02:46:17 2013
@@ -18,6 +18,7 @@ package org.apache.servicemix.drools.mod
 
 import javax.jbi.component.ComponentContext;
 import javax.jbi.messaging.DeliveryChannel;
+import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.Fault;
 import javax.jbi.messaging.InOnly;
 import javax.jbi.messaging.MessageExchange;
@@ -194,14 +195,17 @@ public class JbiHelper {
      * @param content the response
      * @throws Exception
      */    
-    public void answer(Source content) throws Exception {
-        MessageExchange me = this.exchange.getInternalExchange();
-        NormalizedMessage out = me.createMessage();
-        out.setContent(content);
-        me.setMessage(out, "out");
-        getChannel().send(me);
-        exchangeHandled = true;
-        update();
+    public void answer(Source content) throws Exception {        
+        MessageExchange me = this.exchange.getInternalExchange();               
+        if (me.getStatus() == ExchangeStatus.ACTIVE)
+        {            
+            NormalizedMessage out = me.createMessage();        
+            out.setContent(content);
+            me.setMessage(out, "out");
+            getChannel().send(me);
+            exchangeHandled = true;
+            update();
+        }
     }
 
     /**



Mime
View raw message