Sun Java System Message Queue 4.1 Developer's Guide for JMX Clients

Destination Configuration

The destination configuration MBean is used for configuring a destination. There is one such MBean for each destination.

Object Name

The destination configuration MBean has an object name of the following form:

com.sun.messaging.jms.server:type=Destination,subtype=Config,desttype=destinationType,name=destinationName

where destinationType is one of the destination types shown in Table 3–33 and destinationName is the name of the destination. For example:

com.sun.messaging.jms.server:type=Destination,subtype=Config,desttype=t,name="Dest"

The utility class MQObjectName provides a static method, createDestinationConfig, for constructing object names of this form.

Attributes

The destination configuration MBean has the attributes shown in Table 3–32. The names of these attributes are defined as static constants in the utility class DestinationAttributes.

Table 3–32 Destination Configuration Attributes

Name 

Type 

Settable? 

Description 

Name

String

No 

Destination name 

Type

String

No 

Destination type 

See Table 3–33 for possible values.

MaxNumMsgs

Long

Yes 

Maximum number of unconsumed messages 

A value of -1 denotes an unlimited number of messages.

MaxBytesPerMsg

Long

Yes 

Maximum size, in bytes, of any single message 

Rejection of a persistent message is reported to the producing client with an exception; no notice is sent for nonpersistent messages.  

A value of -1 denotes an unlimited message size.

MaxTotalMsgBytes

Long

Yes 

Maximum total memory, in bytes, for unconsumed messages 

LimitBehavior

String

Yes 

Broker behavior when memory-limit threshold reached 

See Table 3–34 for possible values.

If the value is REMOVE_OLDEST or REMOVE_LOW_PRIORITY and the UseDMQ attribute is true, excess messages are moved to the dead message queue.

MaxNumProducers

Integer

Yes 

Maximum number of associated message producers 

When this limit is reached, no new producers can be created. A value of -1 denotes an unlimited number of producers.

MaxNumActiveConsumers [Queue destinations only]

Integer

Yes 

Maximum number of associated active message consumers in load-balanced delivery 

A value of -1 denotes an unlimited number of consumers.

MaxNumBackupConsumers

Integer

Yes 

Maximum number of associated backup message consumers in load-balanced delivery 

A value of -1 denotes an unlimited number of consumers.

ConsumerFlowLimit

Long

Yes 

Maximum number of messages delivered to consumer in a single batch 

In load-balanced queue delivery, this is the initial number of queued messages routed to active consumers before load balancing begins. A destination consumer can override this limit by specifying a lower value on a connection.  

A value of -1 denotes an unlimited number of consumers.

LocalOnly

Boolean

No 

Local delivery only?  

This property applies only to destinations in broker clusters, and cannot be changed once the destination has been created. If true, the destination is not replicated on other brokers and is limited to delivering messages only to local consumers (those connected to the broker on which the destination is created).

LocalDeliveryPreferred

Boolean

Yes 

Local delivery preferred?  

This property applies only to load-balanced delivery in broker clusters. If true, messages will be delivered to remote consumers only if there are no associated consumers on the local broker. The destination must not be restricted to local-only delivery (LocalOnly must be false).

UseDMQ

Boolean

Yes 

Send dead messages to dead message queue?

If false, dead messages will simply be discarded.

Table 3–33 shows the possible values for the Type attribute. These values are defined as static constants in the utility class DestinationType.

Table 3–33 Destination Configuration Type Values

Value 

Utility Constant 

Meaning 

q

DestinationType.QUEUE

Queue (point-to-point) destination 

t

DestinationType.TOPIC

Topic (publish/subscribe) destination 

Table 3–34 shows the possible values for the LimitBehavior attribute. These values are defined as static constants in the utility class DestinationLimitBehavior.

Table 3–34 Destination Limit Behaviors

Value 

Utility Constant 

Meaning 

FLOW_CONTROL

DestinationLimitBehavior.FLOW_CONTROL

Slow down producers 

REMOVE_OLDEST

DestinationLimitBehavior.REMOVE_OLDEST

Throw out oldest messages 

REMOVE_LOW_PRIORITY

DestinationLimitBehavior.REMOVE_LOW_PRIORITY

Throw out lowest-priority messages according to age; no notice to producing client 

REJECT_NEWEST

DestinationLimitBehavior.REJECT_NEWEST

Reject newest messages; notify producing client with an exception only if message is persistent 

Operations

The destination configuration MBean supports the operations shown in Table 3–35. The names of these operations are defined as static constants in the utility class DestinationOperations.

Table 3–35 Destination Configuration Operations

Name 

Parameters 

Result Type 

Description 

pause

pauseType (String)

None 

Pause message delivery 

See Table 3–36 for possible values of pauseType.

pause

None 

None 

Pause all message delivery 

Equivalent to pause(DestinationPauseType.ALL).

resume

None 

None 

Resume message delivery 

purge

None 

None 

Purge all messages 

compact [File-based persistence only]

None 

None 

Compact persistent data store 


Note –

Only a paused destination can be compacted.


Table 3–36 shows the possible values for the pause operation's pauseType parameter. These values are defined as static constants in the utility class DestinationPauseType.

Table 3–36 Destination Pause Types

Value 

Utility Constant 

Meaning 

PRODUCERS

DestinationPauseType.PRODUCERS

Pause delivery from associated message producers 

CONSUMERS

DestinationPauseType.CONSUMERS

Pause delivery to associated message consumers 

ALL

DestinationPauseType.ALL

Pause all message delivery 

Notification

The destination configuration MBean supports the notification shown in Table 3–37.

Table 3–37 Destination Configuration Notification

Name 

Description 

jmx.attribute.change

Attribute value changed