Packagemx.messaging
Classpublic class MultiTopicProducer

A MultiTopicProducer sends messages to a destination with zero or more subtopics. It is like the regular Producer but it can direct the message to any consumer who is subscribing to any one of a number of subtopics. If the consumer is a MultiTopicConsumer and that consumer has subscribed to more than on subtopic in the list of subtopics used by the producer, the consumer only receives the message once.

The MultiTopicProducer will dispatch a MessageAckEvent or MessageFaultEvent for each message they send depending upon whether the outbound message was sent and processed successfully or not.



Public Properties
 PropertyDefined By
  subtopics : ArrayCollection
Provides access to the list of subtopics used in publishing any messages
MultiTopicProducer
Public Methods
 MethodDefined By
  
Constructs a Producer.
MultiTopicProducer
  
addSubtopic(subtopic:String):void
Adds a subtopic to the current list of subtopics for messages sent by this producer.
MultiTopicProducer
  
Removes the subtopic from the subtopics property.
MultiTopicProducer
Protected Methods
 MethodDefined By
  
internalSend(message:IMessage, waitForClientId:Boolean = true):void
MultiTopicProducer
Property Detail
subtopicsproperty
subtopics:ArrayCollection  [read-write]

Provides access to the list of subtopics used in publishing any messages

This property can be used as the source for data binding.


Implementation
    public function get subtopics():ArrayCollection
    public function set subtopics(value:ArrayCollection):void
Constructor Detail
MultiTopicProducer()Constructor
public function MultiTopicProducer()

Constructs a Producer.


Example
       function sendMessage():void
       {
           var producer:MultiTopicProducer = new MultiTopicProducer();
           producer.destination = "NASDAQ";
           var msg:AsyncMessage = new AsyncMessage();
           msg.headers.operation = "UPDATE";
           msg.body = {"SYMBOL":50.00};
           // only send to subscribers to subtopic "SYMBOL" and "ALLSTOCKS"
           msg.addSubtopic("SYMBOL");
           msg.addSubtopic("ALLSTOCKS");
           producer.send(msg);
       }
       
Method Detail
addSubtopic()method
public function addSubtopic(subtopic:String):void

Adds a subtopic to the current list of subtopics for messages sent by this producer. This is a shortcut to adding this subtopic to the subtopics property.

Parameters

subtopic:String

internalSend()method 
protected override function internalSend(message:IMessage, waitForClientId:Boolean = true):void

Parameters

message:IMessage
 
waitForClientId:Boolean (default = true)

removeSubtopic()method 
public function removeSubtopic(subtopic:String):void

Removes the subtopic from the subtopics property. Throws an error if the subtopic is not in the list.

Parameters

subtopic:String





 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/common/langref/mx/messaging/MultiTopicProducer.html