[jboss-svn-commits] JBL Code SVN: r7388 - labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Nov 3 16:10:12 EST 2006


Author: kurt.stam at jboss.com
Date: 2006-11-03 16:10:11 -0500 (Fri, 03 Nov 2006)
New Revision: 7388

Modified:
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/CbrJmsQueueListener.java
Log:
Handling exceptions

Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/CbrJmsQueueListener.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/CbrJmsQueueListener.java	2006-11-03 21:07:31 UTC (rev 7387)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/CbrJmsQueueListener.java	2006-11-03 21:10:11 UTC (rev 7388)
@@ -75,51 +75,38 @@
 	    			(_config.getFirstChild(ListenerTagNames.CBR_TAG).getAttribute(ListenerTagNames.RULE_SET_TAG)==null)) {
 	    		_logger.debug("No " + ListenerTagNames.CBR_TAG + " child element was found in " + _config.getName()
 	    				+ ". Assuming the ruleSet will be passed in via the Message");
-	    	} else {
 	    		ruleSet =_config.getFirstChild(ListenerTagNames.CBR_TAG).getAttribute(ListenerTagNames.RULE_SET_TAG);
-	    	}
-	    	_controller.register(_config,_epr);
-	    	while (_controller.continueLooping()) {
-	    		long lwait = _controller.millisToWait();
-	    		Message message = (lwait > 0 ) ? receiveEsbMessage(100) : null;
-	        	if (null!=message) {
-	        		if (ruleSet!=null) {
-	        			_logger.log(Priority.DEBUG, "Sending message to the Content Based Router.");
-	        			Collection<String> destinationServices = cbr.route(ruleSet, message);
-	        			_logger.log(Priority.INFO, destinationServices);
-	        			if (Boolean.FALSE.equals(message.getProperties().getProperty(MessageRouter.DELIVER_MESSAGES))) {
-	        				//CallBack to the action processor.
-	        			}
-	        			message.getBody().add(MessageRouter.ROUTING_DESTINATION_SERVICE_LIST, destinationServices);
-	        			try 
-	        			{ 
-	        				EPR reply = message.getHeader().getCall().getReplyTo();
-	        				CourierFactory.getCourier(reply).deliver(message);
-	        			}
-	        			catch (URISyntaxException e)
-	        			{
-	        				
-	        			}
-	        			catch (CourierException e)
-	        			{
-	        				
-	        			}
-	        		} else {
-	        			//TODO allow for getting the ruleSet from the message and not from the configuration
-	        			//String messageRuleSet = message.getRuleSet();
-	        			String messageRuleset=null;
-	                    if (messageRuleset!=null) {
-	                    	Collection<String> destinationServices = cbr.route(messageRuleset, message);
-	                    	_logger.log(Priority.INFO, destinationServices);
-	                    } else {
-	                    	_logger.log(Priority.ERROR, "Ruleset could not be obtained from the message.");
-	                    }
+	    	
+		    	_controller.register(_config,_epr);
+		    	while (_controller.continueLooping()) {
+		    		long lwait = _controller.millisToWait();
+		    		Message message = (lwait > 0 ) ? receiveEsbMessage(100) : null;
+		        	if (null!=message) {
+		        		if (ruleSet!=null) {
+		        			_logger.log(Priority.DEBUG, "Sending message to the Content Based Router.");
+		        			Collection<String> destinationServices = cbr.route(ruleSet, message);
+		        			if (Boolean.FALSE.equals(message.getProperties().getProperty(MessageRouter.DELIVER_MESSAGES))) {
+		        				message.getBody().add(MessageRouter.ROUTING_DESTINATION_SERVICE_LIST, destinationServices);
+		        				try  { 
+		        					EPR reply = message.getHeader().getCall().getReplyTo();
+		        					CourierFactory.getCourier(reply).deliver(message);
+		        				} catch (URISyntaxException use) {
+		        					_logger.log(Priority.ERROR, "Unable to reply to caller. "+ use.getLocalizedMessage(), use);
+		        				} catch (CourierException ce) {
+		        					_logger.log(Priority.ERROR, "Unable to reply to caller. "+ ce.getLocalizedMessage(), ce);
+		        				}
+		        			} else {
+		                    	_logger.log(Priority.ERROR, "No Ruleset could not be obtained, neither from the configuration nor from the message.");
+		                    }
+		        		}
 	        		}
-        		}
-	        }
-	    	_controller.unRegister(_eprCategoryName, _eprName, _epr);
+		        }
+		    	_controller.unRegister(_eprCategoryName, _eprName, _epr);
+	    	} else {
+	    		_logger.log(Priority.FATAL, "Could not obtain ruleset.");
+	    	}
 	    } catch (RegistryException mre) {
-		_logger.log(Priority.FATAL, mre.getLocalizedMessage(), mre);
+	    	_logger.log(Priority.FATAL, mre.getLocalizedMessage(), mre);
     	} catch (MessageRouterException mre) {
 			_logger.log(Priority.FATAL, mre.getLocalizedMessage(), mre);
 		} finally {




More information about the jboss-svn-commits mailing list