[jboss-svn-commits] JBL Code SVN: r14515 - labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Aug 24 04:40:56 EDT 2007


Author: mark.little at jboss.com
Date: 2007-08-24 04:40:56 -0400 (Fri, 24 Aug 2007)
New Revision: 14515

Modified:
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
Log:
http://jira.jboss.com/jira/browse/JBESB-876

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java	2007-08-24 08:39:23 UTC (rev 14514)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java	2007-08-24 08:40:56 UTC (rev 14515)
@@ -311,12 +311,19 @@
         } catch (Throwable t) {
             logger.warn("Unexpected exception during Courier lookup for EPR [" + epr + "] for Service [" + service + "].", t);
         }
-
+        
         // Try delivering the message using the courier we just looked up....
+        
         if (courier != null) {
+            // make sure the message header does not change when we exit
+            
+            EPR currentEpr = message.getHeader().getCall().getTo();
+            
             try {
                 EPR replyToEPR = message.getHeader().getCall().getReplyTo();
 
+                message.getHeader().getCall().setTo(epr);
+                
                 if (synchronous) {
                     if (replyToEPR == null)
                         replyToEPR = getReplyToAddress(epr);
@@ -349,6 +356,11 @@
             } finally {
                 // TODO: So does this mean that Couriers are stateful?  If so, do we need to synchronize on using them??
                 CourierUtil.cleanCourier(courier);
+                
+                // put back the old To since we will have changed it.
+                
+                if (currentEpr != null)
+                	message.getHeader().getCall().setTo(currentEpr);
             }
         }
 




More information about the jboss-svn-commits mailing list