You can use the MSMQ adapter to subscribe to MSMQ queues configured on a Windows system. The MSMQ adapter lets MSMQ publishers and subscribers connect to the same destination as a Flex client application. .NET code can publish messages to the Flex application, and .NET code can receive messages that the Flex application publishes.
Please note that no server-side code is needed in order to handle Flex/MSMQ communication.
You connect to a message service destination using Producer and Consumer components and the corresponding ActionScript API.
Sample:
<service id="message-service" class="flex.messaging.services.MessageService" messageTypes="flex.messaging.messages.AsyncMessage"> <adapters> <adapter id="msmqAdapter" class="FluorineFx.Messaging.Services.Messaging.MsmqAdapter" default="true"/> </adapters> <destination id="orderProcessor"> <channels> <channel ref="my-rtmp"/> </channels> <properties> <msmq> <name>.\private$\orderqueuein</name> <formatter>BinaryMessageFormatter</formatter> </msmq> <server> <allow-subtopics>true</allow-subtopics> </server> <properties> </destination> </service> ... <channels> <channel-definition id="my-rtmp" class="mx.messaging.channels.RTMPChannel"> <endpoint uri="rtmp://{server.name}:1951" class="flex.messaging.endpoints.RTMPEndpoint"/> </channel-definition> </channels> ...
The MSMQ Service adapter in FluorineFx is provided by the FluorineFx.Messaging.Services.Messaging.MsmqAdapter class.
<adapter id="msmqAdapter" class="FluorineFx.Messaging.Services.Messaging.MsmqAdapter" default="true"/>
| Property element | Description |
|---|---|
name |
The location of the queue. For valid values check the MessageQueue class documentation |
formatter |
Formatter used to serialize an object into or deserialize an object from the body of a message. Valid values are BinaryMessageFormatter and XmlMessageFormatter. Defaults to "BinaryMessageFormatter". For XmlMessageFormatter the set of possible types must be specified that will be deserialized by the formatter. Type names are separated by ";". For example <formatter>XmlMessageFormatter;ServiceLibrary.Order</formatter> |
label |
Optional label set for messages sent by producers. If not specified the adapter will set the Producer's client identity. |