You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2011/03/04 16:53:55 UTC

svn commit: r1078023 - /uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java

Author: cwiklik
Date: Fri Mar  4 15:53:55 2011
New Revision: 1078023

URL: http://svn.apache.org/viewvc?rev=1078023&view=rev
Log:
UIMA-2081 Added delay before sending getMeta request to remote delegates to enable broker to 'finalize' creation of a temp reply queues.

Modified:
    uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java

Modified: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java?rev=1078023&r1=1078022&r2=1078023&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java (original)
+++ uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java Fri Mar  4 15:53:55 2011
@@ -1451,6 +1451,19 @@ public class AggregateAnalysisEngineCont
 
   public void sendRequestForMetadataToRemoteDelegates() throws AsynchAEException {
     synchronized(childControllerList) {
+      //  Add a delay of 100ms before sending requests for metadata to remote delegates.
+      //  This is done to give the broker enough time to 'finalize' creation of
+      //  temp reply queues for each remote delegate. It's been observed (on MAC OS only) that AMQ
+      //  broker QueueSession.createTemporaryQueue() call is not synchronous. Meaning,
+      //  return from createTemporaryQueue() does not guarantee immediate availability
+      //  of the temp queue. It seems like this operation is asynchronous, causing: 
+      //  "InvalidDestinationException: Cannot publish to a deleted Destination..."
+      //  when a request is send quickly to a service before the broker 'finalizes'
+      //  creation of the temp queue.
+      try {
+        childControllerList.wait(100);
+      } catch( InterruptedException e) {}
+      
       if ( childControllerList.size() > 0 ) {
         for( AnalysisEngineController childController : childControllerList ) {
           if (childController instanceof AggregateAnalysisEngineController) {