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 2012/04/19 17:38:58 UTC

svn commit: r1328003 - in /uima/uima-as/trunk/uimaj-as-jms/src/main: java/org/apache/uima/adapter/jms/client/ resources/

Author: cwiklik
Date: Thu Apr 19 15:38:58 2012
New Revision: 1328003

URL: http://svn.apache.org/viewvc?rev=1328003&view=rev
Log:
UIMA-2389 Added queue,broker to a timeout exception thrown in uima-as client

Modified:
    uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java
    uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/ClientServiceDelegate.java
    uima/uima-as/trunk/uimaj-as-jms/src/main/resources/jms_adapter_messages.properties

Modified: uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java?rev=1328003&r1=1328002&r2=1328003&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java (original)
+++ uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java Thu Apr 19 15:38:58 2012
@@ -971,7 +971,8 @@ public abstract class BaseUIMAAsynchrono
                   JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                   "UIMAJMS_received_exception_msg_INFO",
                   new Object[] { message.getStringProperty(AsynchAEMessage.MessageFrom),
-                      message.getStringProperty(AsynchAEMessage.CasReference), exception });
+                    getBrokerURI(),  
+                    message.getStringProperty(AsynchAEMessage.CasReference), exception });
         }
       } else {
         // After receiving CPC reply there may be cleanup to do. Delegate this
@@ -1045,6 +1046,7 @@ public abstract class BaseUIMAAsynchrono
                   JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                   "UIMAJMS_received_exception_msg_INFO",
                   new Object[] { message.getStringProperty(AsynchAEMessage.MessageFrom),
+                      getBrokerURI(),
                       message.getStringProperty(AsynchAEMessage.CasReference), exception });
         }
         abort = true;
@@ -1478,6 +1480,7 @@ public abstract class BaseUIMAAsynchrono
               JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
               "UIMAJMS_received_exception_msg_INFO",
               new Object[] { serviceDelegate.getComponentName(),
+                getBrokerURI(),
                 casReferenceId, exception });
     }
     try {
@@ -2047,12 +2050,38 @@ public abstract class BaseUIMAAsynchrono
     }
     // check if timeout exception
     if (cachedRequest.isTimeoutException()) {
-      throw new ResourceProcessException(new UimaASProcessCasTimeout());
+      String qName="";
+      try {
+        qName = getEndPointName();
+      } catch( Exception e) {
+          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
+                  "sendAndReceiveCAS", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
+                  "UIMAJMS_exception__WARNING", e);
+      }
+      
+      
+     // Request To Process Cas Has Timed-out.  Service Queue:NoOpAnnotatorQueueLongDelay. Cas Timed-out on host: 9.2.35.127
+      throw new ResourceProcessException(JmsConstants.JMS_LOG_RESOURCE_BUNDLE, "" +
+      		"UIMAJMS_process_timeout_WARNING", 
+      		new Object[]{qName, getBrokerURI(), cachedRequest.getHostIpProcessingCAS()},
+      		new UimaASProcessCasTimeout("UIMA AS Client Timed Out Waiting for Reply From Service:"+qName+" Broker:"+getBrokerURI()));
     }
     // If a reply contains process exception, throw an exception and let the
     // listener decide what happens next
     if (cachedRequest.isProcessException()) {
-      throw new ResourceProcessException(cachedRequest.getException());
+      String qName="";
+      try {
+        qName = getEndPointName();
+      } catch( Exception e) {
+          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
+                  "sendAndReceiveCAS", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
+                  "UIMAJMS_exception__WARNING", e);
+      }
+      throw new ResourceProcessException(
+              JmsConstants.JMS_LOG_RESOURCE_BUNDLE, "" +
+              "UIMAJMS_received_exception_msg_INFO",
+              new Object[]{qName, getBrokerURI(), casReferenceId},
+              cachedRequest.getException());
     }
     try {
       // Process reply in the send thread
@@ -2151,7 +2180,7 @@ public abstract class BaseUIMAAsynchrono
     	          if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
     	            UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
     	                  "notifyOnTimout", JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
-    	                  "UIMAJMS_process_timeout_WARNING", new Object[] { anEndpoint, cachedRequest.getHostIpProcessingCAS() });
+    	                  "UIMAJMS_process_timeout_WARNING", new Object[] { anEndpoint, getBrokerURI(), cachedRequest.getHostIpProcessingCAS() });
     	          }
     	        } else {
     	          if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {

Modified: uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/ClientServiceDelegate.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/ClientServiceDelegate.java?rev=1328003&r1=1328002&r2=1328003&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/ClientServiceDelegate.java (original)
+++ uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/ClientServiceDelegate.java Thu Apr 19 15:38:58 2012
@@ -110,7 +110,7 @@ public class ClientServiceDelegate exten
                   UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, getClass().getName(),
                           "handleError", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                           "UIMAJMS_process_timeout_WARNING",
-                          new Object[] { getEndpoint().getEndpoint(), cachedRequest.getHostIpProcessingCAS() });
+                          new Object[] { getEndpoint().getEndpoint(), clientUimaAsEngine.getBrokerURI(), cachedRequest.getHostIpProcessingCAS() });
                 }
                 if (cachedRequest != null && cachedRequest.isRemote()) {
                   cas = cachedRequest.getCAS();

Modified: uima/uima-as/trunk/uimaj-as-jms/src/main/resources/jms_adapter_messages.properties
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-jms/src/main/resources/jms_adapter_messages.properties?rev=1328003&r1=1328002&r2=1328003&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-jms/src/main/resources/jms_adapter_messages.properties (original)
+++ uima/uima-as/trunk/uimaj-as-jms/src/main/resources/jms_adapter_messages.properties Thu Apr 19 15:38:58 2012
@@ -55,12 +55,12 @@ UIMAJMS_sending_cas_FINEST = Sending Cas
 UIMAJMS_handling_meta_reply_FINEST = Received Metadata From:{0} Metadata:{1}
 UIMAJMS_handling_process_reply_FINEST = Received Cas From:{0} Cas Identifier:{1} Message:{2}
 UIMAJMS_received_expired_msg_INFO = Received Expired Message From:{0} Cas Identifier:{1}
-UIMAJMS_received_exception_msg_INFO = Received Exception In Message From:{0} Cas Identifier:{1} Exception:{2}
+UIMAJMS_received_exception_msg_INFO = Received Exception In Message From Service on Queue:{0} Broker: {1} Cas Identifier:{2} Exception:{3}
 UIMAJMS_received_msg_FINEST = Received New Message From: {0}
 UIMAJMS_timer_detail_FINEST = Service Timing: {0} {1} {2} 
 UIMAJMS_meta_timeout_WARNING = Request For Metadata Has Timed-out. Service Queue:{0}
 UIMAJMS_cpc_timeout_INFO = Collection Process Complete Has Timed-out. Service Queue:{0}
-UIMAJMS_process_timeout_WARNING = Request To Process Cas Has Timed-out.  Service Queue:{0}. Cas Timed-out on host: {1}
+UIMAJMS_process_timeout_WARNING = Request To Process Cas Has Timed-out.  Service Queue:{0}. Broker: {1} Cas Timed-out on host: {2}
 UIMAJMS_timer_expired_INFO = Timer Has Expired. Service Queue: {0} Message Identifier:{1}
 UIMAJMS_inactivity_timer_expired__INFO = Inactivity Timer Expired. Thread: {0} Controller: {1} Timeout Value: {2} Endpoint Name: {3}
 UIMAJMS_closing_connection_to_endpoint__FINE = Closing Connection To Endpoint:{0}