[jboss-svn-commits] JBL Code SVN: r14750 - labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Aug 30 05:28:42 EDT 2007


Author: kevin.conner at jboss.com
Date: 2007-08-30 05:28:42 -0400 (Thu, 30 Aug 2007)
New Revision: 14750

Modified:
   labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingSyncAction.java
Log:
Change to use redeliver queue: JBESB-942

Modified: labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingSyncAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingSyncAction.java	2007-08-30 01:25:21 UTC (rev 14749)
+++ labs/jbossesb/trunk/product/samples/quickstarts/deadletter/src/org/jboss/soa/esb/samples/quickstart/deadletter/MyFailingSyncAction.java	2007-08-30 09:28:42 UTC (rev 14750)
@@ -66,9 +66,9 @@
         
         try {
             //empty out the DLQ
-            Map<URI, Message> messageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_DLQ);
+            Map<URI, Message> messageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_RDLVR);
             for (URI key : messageMap.keySet()) {
-                ms.removeMessage(key, MessageStore.CLASSIFICATION_DLQ);
+                ms.removeMessage(key, MessageStore.CLASSIFICATION_RDLVR);
             }
             Service noneExistingService = new Service("none-exising-category", "none-existing-service-name");
             ServiceInvoker si = new ServiceInvoker(noneExistingService);
@@ -79,16 +79,18 @@
             //Adding this control code to show where the message now is.
             //We should get here on and we should have a message in the DLQ.
             try {
-                Map<URI, Message> messageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_DLQ);
+                Map<URI, Message> messageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_RDLVR);
                 while (messageMap.size() == 0) { //we may have to wait for the DLQ Service to act.
-                    messageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_DLQ);
+                    messageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_RDLVR);
                     for (URI key : messageMap.keySet()) {
                         Message dlqMessage = messageMap.get(key);
                         logger.info("*******************************");
-                        logger.info("Message in the DLQ should be the same message: " + message.getBody().toString().equals(dlqMessage.getBody().toString()));
+                        logger.info("Message in the RDLVR queue should be the same message: " + message.getBody().toString().equals(dlqMessage.getBody().toString()));
                         logger.info("Message=" + message.getBody());
                         logger.info("dlqMessage=" + dlqMessage.getBody());
                         logger.info("*******************************");
+                        logger.info("Removing message to avoid future redeliveries");
+                        ms.removeMessage(key, MessageStore.CLASSIFICATION_RDLVR);
                     }
                     if (messageMap.size() == 0) {
                         logger.info("...Waiting for the DLQ Service to act.");
@@ -102,7 +104,6 @@
             } catch (MessageStoreException mse) {
                 throw new ActionProcessingException(mse.getMessage(), mse);
             }
-            throw new ActionProcessingException(mde.getMessage(), mde);
         } catch (RegistryException re) {
             throw new ActionProcessingException(re.getMessage(), re);
         } catch (FaultMessageException fme) {




More information about the jboss-svn-commits mailing list