站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 3.2.7 server API Documentation 英文版文档

DLQHandler (JBoss Server API) - JBoss 3.2.7 server API Documentation 英文版文档


org.jboss.ejb.plugins.jms
Class DLQHandler

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended byorg.jboss.system.ServiceMBeanSupport
          extended byorg.jboss.ejb.plugins.jms.DLQHandler
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class DLQHandler
extends org.jboss.system.ServiceMBeanSupport

Places redeliveded messages on a Dead Letter Queue.

The Dead Letter Queue handler is used to not set JBoss in an endles loop when a message is resent on and on due to transaction rollback for message receipt.

It sends message to a dead letter queue (configurable, defaults to queue/DLQ) when the message has been resent a configurable amount of times, defaults to 10.

The handler is configured through the element MDBConfig in container-invoker-conf.

The JMS property JBOSS_ORIG_DESTINATION in the resent message is set to the name of the original destination (Destination.toString()) if it is present.

The JMS property JBOSS_ORIG_MESSAGEID in the resent message is set to the id of the original message. Created: Thu Aug 23 21:17:26 2001

Version:
$Revision: 1.11.2.10 $
Author:
???, Jason Dillon

Nested Class Summary
protected  class DLQHandler.DLQSynchronization
          Remove a redelivered message from the DLQ's buffer when it is acknowledged
 
Field Summary
static String JBOSS_ORIG_DESTINATION
          JMS property name holding original destination.
static String JBOSS_ORIG_MESSAGEID
          JMS property name holding original JMS message id.
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
DLQHandler(JMSProviderAdapter providerAdapter)
           
 
Method Summary
protected  void createService()
          Initalize the service.
protected  void deleteFromBuffer(String id)
          Delete the entry in the message counter buffer for specifyed JMS id.
protected  void destroyService()
           
 boolean handleRedeliveredMessage(javax.jms.Message msg, Transaction tx)
          Check if a message has been redelivered to many times.
 void importXml(Element element)
          Takes an MDBConfig Element
protected  int incrementResentCount(String id)
          Increment the counter for the specific JMS message id.
protected  javax.jms.Message makeWritable(javax.jms.Message msg, boolean trace)
          Make the Message properties writable.
protected  void sendMessage(javax.jms.Message msg)
          Send message to the configured dead letter queue, defaults to queue/DLQ.
 String toString()
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, destroy, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, startService, stop, stopService
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

JBOSS_ORIG_DESTINATION

public static final String JBOSS_ORIG_DESTINATION
JMS property name holding original destination.

See Also:
Constant Field Values

JBOSS_ORIG_MESSAGEID

public static final String JBOSS_ORIG_MESSAGEID
JMS property name holding original JMS message id.

See Also:
Constant Field Values
Constructor Detail

DLQHandler

public DLQHandler(JMSProviderAdapter providerAdapter)
Method Detail

createService

protected void createService()
                      throws Exception
Initalize the service.

Throws:
Exception - Service failed to initalize.

destroyService

protected void destroyService()
                       throws Exception
Throws:
Exception

handleRedeliveredMessage

public boolean handleRedeliveredMessage(javax.jms.Message msg,
                                        Transaction tx)
Check if a message has been redelivered to many times. If message has been redelivered to many times, send it to the dead letter queue (default to queue/DLQ).

Returns:
true if message is handled (i.e resent), false if not.

sendMessage

protected void sendMessage(javax.jms.Message msg)
                    throws javax.jms.JMSException
Send message to the configured dead letter queue, defaults to queue/DLQ.

Throws:
javax.jms.JMSException

incrementResentCount

protected int incrementResentCount(String id)
Increment the counter for the specific JMS message id.

Returns:
the new counter value.

deleteFromBuffer

protected void deleteFromBuffer(String id)
Delete the entry in the message counter buffer for specifyed JMS id.


makeWritable

protected javax.jms.Message makeWritable(javax.jms.Message msg,
                                         boolean trace)
                                  throws javax.jms.JMSException
Make the Message properties writable.

Returns:
the writable message.
Throws:
javax.jms.JMSException

importXml

public void importXml(Element element)
               throws org.jboss.deployment.DeploymentException
Takes an MDBConfig Element

Throws:
org.jboss.deployment.DeploymentException

toString

public String toString()


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.