axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asan...@apache.org
Subject svn commit: r524745 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms: JMSConnectionFactory.java JMSSender.java
Date Mon, 02 Apr 2007 08:46:27 GMT
Author: asankha
Date: Mon Apr  2 01:46:26 2007
New Revision: 524745

URL: http://svn.apache.org/viewvc?view=rev&rev=524745
Log:
apply fix for issue reported by shantanau on jboss and add a couple of lines of debug logging

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSConnectionFactory.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSSender.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSConnectionFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSConnectionFactory.java?view=diff&rev=524745&r1=524744&r2=524745
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSConnectionFactory.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSConnectionFactory.java
Mon Apr  2 01:46:26 2007
@@ -180,32 +180,35 @@
 
         serviceJNDINameMapping.put(destinationJndi, serviceName);
         String destinationName = getDestinationName(destinationJndi);
-        log.warn("JMS Destination with JNDI name : " + destinationJndi + " does not exist");
 
-        Connection con = null;
-        try {
-            con = conFactory.createConnection();
-            Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
-            Queue queue = session.createQueue(destinationJndi);
-            destinationName = queue.getQueueName();
-            log.warn("JMS Destination with JNDI name : " + destinationJndi + " created");
-            
-        } catch (JMSException e) {
-            log.error("Unable to create a Destination with JNDI name : " + destinationJndi,
e);
-            // mark service as faulty
-            JMSUtils.markServiceAsFaulty(
-                (String) serviceJNDINameMapping.get(destinationJndi),
-                "Error looking up JMS destination : " + destinationJndi,
-                msgRcvr.getAxisConf().getAxisConfiguration());
+        if (destinationName == null) {
+            log.warn("JMS Destination with JNDI name : " + destinationJndi + " does not exist");
 
-        } finally {
-            if (con != null) {
-                try {
-                    con.close();
-                } catch (JMSException ignore) {}
+            Connection con = null;
+            try {
+                con = conFactory.createConnection();
+                Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
+                Queue queue = session.createQueue(destinationJndi);
+                destinationName = queue.getQueueName();
+                log.warn("JMS Destination with JNDI name : " + destinationJndi + " created");
+
+            } catch (JMSException e) {
+                log.error("Unable to create a Destination with JNDI name : " + destinationJndi,
e);
+                // mark service as faulty
+                JMSUtils.markServiceAsFaulty(
+                    (String) serviceJNDINameMapping.get(destinationJndi),
+                    "Error looking up JMS destination : " + destinationJndi,
+                    msgRcvr.getAxisConf().getAxisConfiguration());
+
+            } finally {
+                if (con != null) {
+                    try {
+                        con.close();
+                    } catch (JMSException ignore) {}
+                }
             }
         }
-
+        
         serviceDestinationMapping.put(destinationName, serviceName);
         log.info("Mapping JNDI name : " + destinationJndi + " and JMS Destination name :
" +
             destinationName + " against service : " + serviceName);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSSender.java?view=diff&rev=524745&r1=524744&r2=524745
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSSender.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/jms/JMSSender.java
Mon Apr  2 01:46:26 2007
@@ -29,16 +29,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
+import javax.jms.*;
 import javax.xml.stream.XMLStreamException;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
@@ -103,12 +94,21 @@
             Destination dest = transportInfo.getDestination();
 
             if (dest == null) {
-                // if it does not exist, create it
-                String name = JMSUtils.getDestination(targetAddress);
-                try {
-                    dest = session.createQueue(name);
-                } catch (JMSException e) {
-                    handleException("Error creating destination Queue : " + name, e);
+                if (targetAddress != null) {
+
+                    // if it does not exist, create it
+                    String name = JMSUtils.getDestination(targetAddress);
+                    if (log.isDebugEnabled()) {
+                        log.debug("Creating JMS Destination : " + name);
+                    }
+
+                    try {
+                        dest = session.createQueue(name);
+                    } catch (JMSException e) {
+                        handleException("Error creating destination Queue : " + name, e);
+                    }
+                } else {
+                    handleException("Cannot send reply to unknown JMS Destination");
                 }
             }
 
@@ -154,6 +154,11 @@
                     }
                 }
                 message.setJMSReplyTo(replyDest);
+                if (log.isDebugEnabled()) {
+                    log.debug("Expecting a response to JMS Destination : " +
+                        (replyDest instanceof Queue ?
+                            ((Queue) replyDest).getQueueName() : ((Topic) replyDest).getTopicName()));
+                }
             }
 
             try {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message