17.6.2. Configure JMS Address Settings

The JMS subsystem has several configurable options which control aspects of how and when a message is delivered, how many attempts should be made, and when the message expires. These configuration options all exist within the <address-settings> configuration element.
A common feature of address configurations is the syntax for matching multiple addresses, also known as wild cards.
Wildcard Syntax

Address wildcards can be used to match multiple similar addresses with a single statement, similar to how many systems use the asterisk ( *) character to match multiple files or strings with a single search. The following characters have special significance in a wildcard statement.

Table 17.1. JMS Wildcard Syntax

Character Description
. (a single period) Denotes the space between words in a wildcard expression.
# (a pound or hash symbol) Matches any sequence of zero or more words.
* (an asterisk) Matches a single word.

Table 17.2. JMS Wildcard Examples

Example Description
Matches news.europe, news.europe.sport, news.europe.politic, but not news.usa or europe.
Matches news.europe but not news.europe.sport.
Matches news.europe.sport and news.usa.sport, but not news.europe.politics.

Example 17.2. Default Address Setting Configuration

The values in this example are used to illustrate the rest of this topic.
    <!--default for catch all-->
    <address-setting match="#">

Table 17.3. Description of JMS Address Settings

Element Description Default Value Type
Determines what happens when an address where max-size-bytes is specified becomes full.
If a dead letter address is specified, messages are moved to the dead letter address if max-delivery-attempts delivery attempts have failed. Otherwise, these undelivered messages are discarded. Wildcards are allowed.
If the expiry address is present, expired messages are sent to the address or addresses matched by it, instead of being discarded. Wildcards are allowed.
Defines whether a queue only uses last values or not.
The maximum number of times to attempt to re-deliver a message before it is sent to dead-letter-address or discarded.
The maximum bytes size.
Day limit for the message counter history.
The number of page files to keep in memory to optimize IO during paging navigation.
The paging size.
Time to delay between re-delivery attempts of messages, expressed in milliseconds. If set to 0, re-delivery attempts occur indefinitely.
Defines how long to wait when the last consumer is closed on a queue before redistributing any messages.
A parameter for an address that sets the condition of a message not routed to any queues to instead be sent the to the dead letter address (DLA) indicated for that address.
  • Configure Address Setting and Pattern Attributes

    Choose either the Management CLI or the Management Console to configure your pattern attributes as required.
    • Configure the Address Settings Using the Management CLI

      Use the Management CLI to configure address settings.
      1. Add a New Pattern

        Use the add operation to create a new address setting if required. You can run this command from the root of the Management CLI session, which in the following examples creates a new pattern titled patternname, with a max-delivery-attempts attribute declared as 5. The examples for both Standalone Server and a Managed Domain editing on the full profile are shown.
        [domain@localhost:9999 /] /profile=full/subsystem=messaging/hornetq-server=default/address-setting=patternname/:add(max-delivery-attempts=5)
        [standalone@localhost:9999 /] /subsystem=messaging/hornetq-server=default/address-setting=patternname/:add(max-delivery-attempts=5)
      2. Edit Pattern Attributes

        Use the write operation to write a new value to an attribute. You can use tab completion to help complete the command string as you type, as well as to expose the available attributes. The following example updates the max-delivery-attempts value to 10
        [domain@localhost:9999 /] /profile=full/subsystem=messaging/hornetq-server=default/address-setting=patternname/:write-attribute(name=max-delivery-attempts,value=10)
        [standalone@localhost:9999 /] /subsystem=messaging/hornetq-server=default/address-setting=patternname/:write-attribute(name=max-delivery-attempts,value=10)
      3. Confirm Pattern Attributes

        Confirm the values are changed by running the read-resource operation with the include-runtime=true parameter to expose all current values active in the server model.
        [domain@localhost:9999 /] /profile=full/subsystem=messaging/hornetq-server=default/address-setting=patternname/:read-resource
        [standalone@localhost:9999 /] /subsystem=messaging/hornetq-server=default/address-setting=patternname/:read-resource
    • Configure the Address Settings Using the Management Console

      Use the Management Console to configure address settings.
      1. Log into the Management Console.

        Log into the Management Console of your Managed Domain or Standalone Server.
      2. If you use a Managed Domain, choose the correct profile.

        Select the Profiles tab at the top right, and then select the correct profile from the Profile menu at the top left of the next screen. Only the full and full-ha profiles have the messaging subsystem enabled.
      3. Select the Messaging item from the navigation menu.

        Expand the Messaging menu item from the navigation menu, and click Destinations.
      4. View the JMS Provider.

        A list of JMS Providers is shown. In the default configuration, only one provider, called default, is shown. Click the View link to view the detailed settings for this provider.
      5. View the Address Settings.

        Click the Addressing tab. Either add a new pattern by clicking the Add button, or edit an existing one by clicking its name and clicking the Edit button.
      6. Configure the options.

        If you are adding a new pattern, the Pattern field refers to the match parameter of the address-setting element. You can also edit the Dead Letter Address, Expiry Address, Redelivery Delay, and Max Delivery Attempts. Other options need to be configured using the Management CLI.