Oracle GlassFish Message Queue 4.4.2 Administration Guide

Dead Message Queue (DMQ) Processing

Each JMS bridge includes a built-in Dead Message Queue (DMQ) named built-in-dmq. This DMQ is a designated Queue destination named imq.bridge.jms.dmq in the broker hosting the JMS bridge. You can also configure additional DMQs for the JMS bridge, in which case the DMQ can use any JMS destination in any configured JMS provider.


Note –

In a production environment, the built-in DMQ, imq.bridge.jms.dmq, should be administratively created and have its access controls set appropriately before starting a broker that uses JMS bridge services.


When a DMQ uses Message Queue as the JMS provider, it can be configured such that messages sent to it will automatically be transferred to the Message Queue broker's DMQ. To do so, set physical destination properties of the JMS bridge's DMQ as follows:


useDMQ=true
limitBehavior=REMOVE_OLDEST
maxNumMsgs=0

When a message is sent to the DMQ, the JMS bridge follows this sequence with the built-in DMQ first:

  1. The bridge creates a new DMQ javax.jms.ObjectMessage object and sets the properties listed in Table 12–1 to the ObjectMessage.

  2. If the DMQ has defined a message transformer, the original message is passed to the transformer's MessageTransformer.transform() method.

  3. The body of the javax.jms.ObjectMessage is set to the transformed message (or original message if no message transformer is defined). If this action fails (usually because the message is not serializable), the body of the ObjectMessage is instead set to the toString() value of the original message.

  4. The javax.jms.ObjectMessage is sent (up to send-attempts times) to the DMQ's destination with a timeToLive value based on the DMQ's time-to-live-in-millis attribute and with the same JMSDeliveryMode and JMSPriority as the original message.

  5. If sending the message fails, the bridge repeats Steps 2 through 4 for each DMQ defined in the bridge's XML configuration file in the order they appear in the file, stopping when a send attempt succeeds, unless it is the built-in DMQ.

  6. If the message can't be sent to any DMQ, a log message is generated, containing the properties and headers of the original message and the properties set in Step 1.

Table 12–1 DMQ Message Propeties

Property 

Type 

Description 

JMS_SUN_JMSBRIDGE_DMQ_BODY_TRUNCATED

String 

If unable to set the original message or the transformed message (if the DMQ has a message transformer) to the body of the DMQ ObjectMessage. In that case the message's toString() is set to the body of the DMQ ObjectMessage.

JMS_SUN_JMSBRIDGE_DMQ_EXCEPTION

String 

The Exception.getMessage() if exception occurred or detailed comments on the failure; null if none.

JMS_SUN_JMSBRIDGE_DMQ_REASON

String 

One of: MESSAGE_EXPIRED, SEND_FAILURE, ACK_FAILURE, TRANSFORM_FAILURE, COMMIT_FAILURE.

JMS_SUN_JMSBRIDGE_DMQ_TIMESTAMP

String 

The timestamp when the JMS bridge sends the message to the DMQ. 

JMS_SUN_JMSBRIDGE_SOURCE_CORRELATIONID

String 

The original message's getJMSCorrelationID().

JMS_SUN_JMSBRIDGE_SOURCE_DESTINATION

String 

The original message's source destination name. 

JMS_SUN_JMSBRIDGE_SOURCE_JMSTYPE

String 

The original message's getJMSType().

JMS_SUN_JMSBRIDGE_SOURCE_MESSAGEID

String 

The orginal message's getJMSMessageID(), or null if not available.

JMS_SUN_JMSBRIDGE_SOURCE_PROVIDER

String 

The ConnectionMetaData.getJMSProviderName of the connection the original message was received on; if not available, the source connection factory's getClass().getName().

JMS_SUN_JMSBRIDGE_SOURCE_TIMESTAMP

Long 

The original message's getJMSTimestamp().

JMS_SUN_JMSBRIDGE_TARGET_DESTINATION

String 

The name of the target destination where the original message was intended to send to. 

JMS_SUN_JMSBRIDGE_TARGET_PROVIDER

String 

The ConnectionMetaData.getJMSProviderName of the connection the original message was intended to send on; if not available, the target connection factory's getClass().getName().