7.8.2 Destination management and routing services

This subsection describes the CJMSP Broker-based destination management and routing services.

CJMSP Broker creates and manages the queues and topics in the system memory as physical destinations.

The routing service is used to send and receive messages between the producers, consumers, and destinations reliably and smoothly while using the resources efficiently.

Organization of this subsection
(1) Types of destinations
(2) Setting up and managing the destinations
(3) Managing the dead message queue

(1) Types of destinations

The destinations can be classified into the following two types based on the method of creation and period of existence:

The features of each destination are as follows:

Destinations created using commands
This destination is explicitly created using commands by the user who manages the system.
The command-created destinations are not deleted until explicitly deleted using commands.
Temporary destinations created using APIs
This destination is created by APIs in the J2EE application. The destination required for sending and receiving messages is created and deleted in the programs. A temporary destination is only stored in the connection in which the destination was created. Also, message persistence cannot be performed, and the destination is not recreated even if CJMSP Broker is restarted.
Note
A consumer that uses a temporary destination can only be created in the connection in which the temporary destination was created.

Apart from the destinations used for the normal sending and receiving of messages, there is a destination called the dead message queue that is automatically created by CJMSP Broker.

The dead message queue is created when CJMSP Broker is first started. CJMSP Broker registers the following messages (dead messages) in this destination:

The messages that could not be processed at other destinations and are discarded are stored in the dead message queue; therefore, the messages can be used to check for problems occurring during the sending and receiving of messages.

For details on the management of the dead message queue, see (3) Managing the dead message queue.

(2) Setting up and managing the destinations

With CJMSP Broker, you can execute the following processing to set up and manage the destinations:

You execute the above processing using commands. For details, see 5.3 Details of commands for managing CJMSP Broker in the uCosminexus Application Server Command Reference Guide.

(3) Managing the dead message queue

The settings specify that the dead message queue always be used with all the destinations.

You specify the processing to be performed when a message is registered in the dead message queue, in the message properties for each message.

The following table describes the content that can be set in the message properties.

Table 7-3 Content that can be set in the message properties as the processing for registration in the dead message queue

PropertyData typeExplanation
CJMS_PRESERVE_UNDELIVERED#BooleanSpecifies the processing to be performed when a message cannot be delivered.
  • If true is specified, the message is registered in the dead message queue.
  • If false is specified, the message is not registered in the dead message queue.
CJMS_LOG_DEAD_MESSAGES#BooleanSpecifies whether the information about the messages deleted from the destination and registered in the dead message queue will be output to the log.
  • If true is specified, the information is output to the log.
  • If false is specified, the information is not output to the log.
CJMS_TRUNCATE_MSG_BODY#BooleanSpecifies whether to delete the message body of the message registered in the dead message queue.
  • If true is specified, the message is registered in the dead message queue after deleting the message body.
  • If false is specified, the message is registered in the dead message queue without deleting the message body.

# This property is not supported with CJMS Provider.


Also, CJMSP Broker sets the properties for the dead messages registered in the dead message queue. Based on the specified property information, you can check the reason for the registration of the message in the dead message queue, and the processing that formed the contributing factor.

The following table describes the properties specified for the dead messages by CJMSP Broker.

Table 7-4 Properties specified for the dead messages by CJMSP Broker

PropertyData typeExplanation
JMSXDeliveryCountIntegerSpecifies the maximum number of messages delivered to a specific consumer.
This value is only specified when ERROR or UNDELIVERABLE is set in the CJMS_DMQ_UNDELIVERED_REASON property.
CJMS_DMQ_UNDELIVERED_TIMESTAMPLongSpecifies the time registered in the dead message queue in milliseconds.
CJMS_DMQ_UNDELIVERED_REASONStringSpecifies the value indicating the reason for registration in the dead message queue. The following values are set up:
  • OLDEST
    Indicates that the message was not processed because it was the oldest.
  • LOW_PRIORITY
    Indicates that the message was not processed because the priority order was low.
  • EXPIRED
    Indicates that the message was not processed because the validity period of the message had expired.
  • UNDELIVERABLE
    Indicates that the message was not delivered.
  • ERROR
    Indicates that an error occurred. The messages for which this reason is specified cannot be processed due to internal reasons; therefore, the messages must be resent from the producer.
Note that if multiple reasons are applicable, only one of the reasons is specified.
CJMS_DMQ_PRODUCING_BROKERStringSpecifies the name and port number of CJMSP Broker that created this message. If null is specified, it indicates a locally operating CJMSP Broker.
CJMS_DMQ_DEAD_BROKERStringSpecifies the name and port number of CJMSP Broker that manages the dead message queue. If null is specified, it indicates a locally operating CJMSP Broker.
CJMS_DMQ_UNDELIVERED_EXCEPTIONStringSpecifies the name of the exception occurring in the application or CJMSP Broker, for the messages that were not delivered because an exception occurred.
CJMS_DMQ_UNDELIVERED_COMMENTStringSpecifies the additional reasons, if any, due to which the messages were not sent.
CJMS_DMQ_BODY_TRUNCATEDBooleanSpecifies whether the message body was deleted during registration in the dead message queue.
If true, the message body has been deleted.
If false, the message body has not been deleted.