The subtopic capability lets you divide the messages that a producers send to a destination into specific categories at the destination. You can configure a Consumer component that subscribes to the destination to receive only messages sent to a specific subtopic or set of subtopics. Use wildcard characters (*) to send or receive messages from more than one subtopic.
In the subtopic property of a Producer component specify the subtopics that the component sends messages to.
var message:AsyncMessage = new AsyncMessage(); producer.subtopic = "chat.john"; producer.destination="ChatTopic" // Generate message. producer.send(message);
In the subtopic property of a Consumer component specify the subtopic to which the Consumer is subscribed.
consumer.destination = "ChatTopic"; consumer.subtopic = "chat.john"; consumer.subscribe();
To allow subtopics for a destination set the allow-subtopics element to true in the destination definition in the configuration file. Please note that only subtopic separator currently accepted is "." (period).
<destination id="ChatTopic">
<properties>
<network>
<subscription-timeout-minutes>0</subscription-timeout-minutes>
</network>
<server>
<allow-subtopics>true</allow-subtopics>
</server>
</properties>
<channels>
<channel ref="my-rtmp"/>
</channels>
</destination>