Sending Messages to the DLQ in JBoss ESB

The page 65 of the Programmers Guide says that if you are trying to deliver the message (…) it will send the message to the DeadLetterService, but doesn’t say how to do so.

import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.addressing.eprs.LogicalEPR;
import org.jboss.soa.esb.client.ServiceInvoker;
import org.jboss.soa.esb.message.Message;

public static final DQLSampleAction extends AbstractActionPipelineProcessor {
  private static final EPR DLQ_EPR = new LogicalEPR(ServiceInvoker.INTERNAL_SERVICE_CATEGORY, ServiceInvoker.DEAD_LETTER_SERVICE_NAME);

  public Message process(final Message msg) {
    msg.getHeader().getCall().setReplyTo(DLQ_EPR);

    return msg;
  }

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s