14
Using the Flex Messaging Event Gateway
About Flex and ColdFusion
ColdFusion includes the Flex Messaging event gateway, which uses the ColdFusion Event
Gateway Adapter to send messages to and receive messages from Adobe Flex Data Services.
This means that ColdFusion applications and Flex applications can publish to and consume
events from the same event queue.
How ColdFusion and Flex interact
You can send messages from a ColdFusion application to a Flex application, through the Flex
Messaging event gateway. Conversely, you can send messages from a Flex application to a
ColdFusion application.
Either the ColdFusion application or the Flex application can initiate sending a message. The
following image shows the message handling process in which a message is sent from the Flex
application to the ColdFusion application, and then from the ColdFusion application to the
Flex application.
1.
The Flex application generates a message.
2.
The Flex Message Service passes the message to the ColdFusion Event Gateway Adapter.
3.
The ColdFusion Event Gateway Adapter sends the message to the Flex Messaging event
gateway, by using Java Remote Method Invocation (Java RMI).
4.
The Flex Messaging event gateway and the ActionScript translator convert ActionScript
3.0 data types to the appropriate ColdFusion values and add the message to the event
gateway queue.
5.
The ColdFusion server invokes the
onIncomingMessage
method of the Flex Messaging
event gateway listener CFC.
6.
The ColdFusion application generates a message, which it sends to the ColdFusion server.
7.
The ColdFusion server sends the message to the Flex Messaging event gateway.
NO
T
E
To use the Flex Messaging event gateway to interact with a Flex application, the Flex
application must be running on Flex Data Services.