Author: cwiklik
Date: Thu Oct 20 22:36:55 2011
New Revision: 1187107

URL: http://svn.apache.org/viewvc?rev=1187107&view=rev
Log:
UIMA-2251 Mark endpoint as FAILED as soon as send fails

Modified:
    
uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsOutputChannel.java

Modified: 
uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsOutputChannel.java
URL: 
http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsOutputChannel.java?rev=1187107&r1=1187106&r2=1187107&view=diff
==============================================================================
--- 
uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsOutputChannel.java
 (original)
+++ 
uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsOutputChannel.java
 Thu Oct 20 22:36:55 2011
@@ -1386,6 +1386,10 @@ public class JmsOutputChannel implements
 
   private void dispatch(Message aMessage, Endpoint anEndpoint, CacheEntry 
entry, boolean isRequest,
           JmsEndpointConnection_impl endpointConnection, long msgSize) throws 
Exception {
+         
+         if ( anEndpoint == null ) { 
+                 throw new UimaEEServiceException("UIMA AS 
service:"+getAnalysisEngineController().getComponentName()+" unable to dispatch 
request to a remote delegate. Endpoint is null. This is an invalid state.");
+         }
     // Add stats
     populateStats(aMessage, anEndpoint, entry.getCasReferenceId(), 
AsynchAEMessage.Process,
             isRequest);
@@ -1444,8 +1448,10 @@ public class JmsOutputChannel implements
              // check if the broker connection entry contains an endpoint that 
we failed on while
              // sending a message. If it exits, remove the endpoint to allow 
recovery to work on 
              // a subsequent message. 
-             if (brokerConnectionEntry.endpointExists(key)) {
-               brokerConnectionEntry.removeEndpoint(key);
+             if ( brokerConnectionEntry != null ) {
+                     if (brokerConnectionEntry.endpointExists(key)) {
+                       brokerConnectionEntry.removeEndpoint(key);
+                     }
              }
            } 
         // Spin recovery thread to handle send error. After the recovery thread


Reply via email to