1 Reply Latest reply on Dec 4, 2008 3:20 AM by Daniel Bevenius

    Exception when trying to redeliver message from DLQ

    dema Newbie

      I have strange issue when the exception is thrown somewhere in actions pipeline. The guilty message goes into DLQ queue, then goes into DeadLetterService. Then I'm trying to trigger redelivering of message by making "UPDATE message SET classification = 'RDLVR'". Here is a stacktrace that goes when RedeliverService tries to redeliver message:

      16:57:28,787 WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline: header: [ ]
      java.lang.NullPointerException
       at org.jboss.internal.soa.esb.persistence.format.db.DBMessageStoreImpl.redeliver(DBMessageStoreImpl.java:392)
       at org.jboss.soa.esb.actions.MessageRedeliverer.process(MessageRedeliverer.java:74)
       at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:316)
       at org.jboss.soa.esb.listeners.ScheduleListener.onSchedule(ScheduleListener.java:121)
       at org.jboss.soa.esb.schedule.ScheduleProvider$ESBScheduledJob.execute(ScheduleProvider.java:227)
       at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
       at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
      


      It falls in this code:
      /* 390*/ Service to = (Service)message.getProperties().getProperty("org.jboss.soa.esb.deliver.to");
      /* 392*/ try
       {
      /* 392*/ ServiceInvoker si = new ServiceInvoker(to.getCategory(), to.getName());
      /* 393*/ message.getProperties().setProperty("org.jboss.soa.esb.deliver.isRedelivery", Boolean.valueOf(true));
      /* 394*/ si.deliverAsync(message);
      /* 395*/ isDelivered = true;
       }
      /* 396*/ catch(MessageDeliverException e)
       {
      /* 397*/ logger.debug(e.getMessage(), e);
       }
      

      I looked at the message in .../server/esb/data/hypersonic/jbossesb.script (table "message")
      and I think it is because of absense org.jboss.soa.esb.deliver.to property in that message.

      Here is the code from
      org.jboss.soa.esb.listeners.message.ActionProcessingPipeline

       private void faultTo(Call callDetails, Message message)
       {
      /* 460*/ if(!DefaultFaultTo.initialiseReply(message, callDetails, oneWay))
       {
      /* 462*/ if(defaultProcessing || oneWay)
       {
      /* 464*/ LOGGER.warn((new StringBuilder()).append("No fault address defined for fault message! ").append(callDetails).toString());
      /* 465*/ sendToDLQ(callDetails, message, MessageType.fault);
       }
       } else
       {
      /* 470*/ EPR faultToEPR = message.getHeader().getCall().getTo();
      /* 471*/ messageTo(faultToEPR, message, MessageType.fault);
       }
       }
      
       private void sendToDLQ(Call callDetails, Message message, MessageType messageType)
       {
      /* 484*/ Properties properties = message.getProperties();
      /* 485*/ properties.setProperty("org.jboss.soa.esb.messagestore.classification", "DLQ");
      /* 486*/ properties.setProperty("org.jboss.soa.esb.failure.call", callDetails.toString());
      /* 487*/ properties.setProperty("org.jboss.soa.esb.failure.responseType", messageType.name());
      /* 491*/ try
       {
      /* 491*/ ServiceInvoker serviceInvoker = new ServiceInvoker(ServiceInvoker.dlqService);
      /* 493*/ serviceInvoker.deliverAsync(message);
       }
      /* 495*/ catch(MessageDeliverException mde)
       {
      /* 497*/ LOGGER.warn("Failed to send response failure to DLQ service");
      /* 498*/ LOGGER.debug("Failed to send response failure to DLQ service", mde);
       }
       }
      



      I think that there must be the code like this
      properties.setProperty("org.jboss.soa.esb.deliver.to", "XXXXX");


      Is this correct? Or maybe I missed something? I can attach the testcase reproducing this issue.