Rules for Destination Specification

As we mentioned in the introduction, Message Publication, you can specify the destination in the attach frame or in a message (anonymous relay). We'll look at both ways.

In the Attach Frame

You can set the target capabilities in the attach frame, with role=sender, from the client with one of the settings in the following table.

Target Capabilities Action
not present Subsequent options will be used to determine the destination type; if no other options are set, it defaults to 'queue'.
queue All messages sent on this link will be processed by the event broker as published to a durable queue.
topic All messages sent on this link will be processed by the event broker as published to a topic.
temporary-queue All messages sent on this link will be processed by the event broker as published to a temporary queue.
temporary-topic All messages sent on this link will be processed by the event broker as published to a temporary topic.

Setting the target capabilities will override any other settings you make in the other fields we discuss below, even those In a Message.

You can set the prefix of the target address in the attach frame, with role=sender, from the client with one of the settings in the following table.

Target Address Action
not present Subsequent options will be used to determine the destination type; if no other options are set, it defaults to 'queue'.
unprefixed Subsequent options will be used to determine the destination type, if no other options are present it defaults to 'queue'.
prefixed by queue:// All messages sent on this link will be processed by the event broker as published to a queue. If this is in conflict with specified target capabilities, then the target capabilities value overwrites the prefix value, the prefix is stripped, and a warning is logged to debug.log.
prefixed by topic:// All messages sent on this link will be processed by the event broker as published to a topic. If this is in conflict with specified target capabilities, then the target capabilities value overwrites the prefix value, the prefix is stripped, and a warning is logged to debug.log.
prefixed by #P2P/QTMP/ All messages sent on this link will be processed by the event broker as published to a temporary queue.
prefixed by #P2P/TTMP/ All messages sent on this link will be processed by the event broker as published to a temporary topic.

Recommendation

Leave target capabilities unset and set the desired prefixed target address in the attach frame, with role=sender.

In a Message

You can set the x-opt-jms-dest message-annotation with one of the settings in the following table.

x-opt-jms-dest Action
not present Subsequent options will be used to determine the destination type; if no other options are set, it defaults to 'queue'.
0 The message will be processed by the event broker as published to a durable queue.
1 The message will be processed by the event broker as published to a topic.
2 The message will be processed by the event broker as published to a temporary queue.
3 The message will be processed by the event broker as published to a temporary topic.

You can set the to message property with one of the settings in the following table.

'to' message property Action
not present Defaults to 'queue'.
unprefixed The message will be processed by the event broker as published to a queue.
prefixed by queue:// The message will be processed by the event broker as published to a queue. If the prefix is in conflict with what's specified in the x-opt-jms-dest message-annotation, then the x-opt-jms-dest value overwrites the prefix value and the prefix is silently stripped.
prefixed by topic:// The message will be processed by the event broker as published to a topic. If the prefix is in conflict with what's specified in the x-opt-jms-dest message-annotation, then the x-opt-jms-dest value overwrites the prefix value and the prefix is silently stripped.
prefixed by #P2P/QTMP/ The message will be processed by the event broker as published to a temporary queue
prefixed by #P2P/TTMP/ The message will be processed by the event broker as published to a temporary topic

Recommendation

Leave the x-opt-jms-dest message-annotation unset and set the to message property with the desired prefixed destination.