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 2010/10/15 21:42:20 UTC
svn commit: r1023083 -
/uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/JmsOutputChannel.java
Author: cwiklik
Date: Fri Oct 15 19:42:20 2010
New Revision: 1023083
URL: http://svn.apache.org/viewvc?rev=1023083&view=rev
Log:
UIMA-1902 Modified sendReply() used by JmsInputChannel implementation to throw an exception if there is a send failure while attempting to send an ACK msg to a client. If a failure occurs the JmsInputChannel drops the msg since most likely a client has gone away.
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=1023083&r1=1023082&r2=1023083&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 Fri Oct 15 19:42:20 2010
@@ -927,7 +927,10 @@ public class JmsOutputChannel implements
// Free CAS notifications need to be sent from the client
tm.setJMSReplyTo(freeCASTempQueue);
}
- endpointConnection.send(tm, 0, false);
+ // Check if there was a failure while sending a message
+ if ( !endpointConnection.send(tm, 0, false, notifyOnJmsException) && notifyOnJmsException ) {
+ throw new JMSException("JMS Send Failed. Check UIMA Log For Details.");
+ }
addIdleTime(tm);
if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINE)) {
UIMAFramework.getLogger(CLASS_NAME).logrb(
@@ -940,6 +943,9 @@ public class JmsOutputChannel implements
anEndpoint.getEndpoint() });
}
} catch (JMSException e) {
+ if ( notifyOnJmsException ) {
+ throw new AsynchAEException(e);
+ }
// Unable to establish connection to the endpoint. Log it and continue
if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
@@ -950,9 +956,6 @@ public class JmsOutputChannel implements
JmsConstants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_exception__WARNING",
e);
}
- if ( notifyOnJmsException ) {
- throw new AsynchAEException(e);
- }
}
catch (ServiceShutdownException e) {