Handling Incoming Messages - MACROMEDIA COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 Use Manual

Table of Contents

Advertisement

Sending outgoing message example
The following example from a CFM page creates a structure that contains the message. The
is the destination ID specified in the messaging-config.xml file for the instance
destination
of the Flex Messaging event gateway to send the message to. The
message. The
sendGatewyMessage
gateway.
<cfset success = StructNew()>
<cfset success.msg = "Email was sent at " & Now()>
<cfset success.Destination = "gateway1">
<cfset ret = SendGatewayMessage("Flex2CF2", success)>

Handling incoming messages

When a Flex application sends a message to a ColdFusion application, the Flex Messaging
event gateway sends a CFEvent structure to the
configured CFC, with the following information mapped to the data of the event:
Name
Contents
body
Body of the message.
ClientID
ID of the client that sent the message.
CorrelationID
Correlation identifier of the message.
Destination
Flex destination of the message.
Headers
If the message contains any headers, the CFML structure that contains the
header names as keys and values.
Timestamp
Timestamp of the message.
The incoming message data structure also includes the values of
from the Flex message.
Incoming message handling example
The following example puts data that is contained in the body of the message from the Flex
application into a structure. It then uses the contents of the structure to generate an e-mail
message.
<cfcomponent displayname="SendEmail" hint="Handles incoming message from
Flex">
<cffunction name="onIncomingMessage" returntype="any">
<cfargument name="event" type="struct" required="true">
20
Using the Flex Messaging Event Gateway
CFML function sends the message to the instance of the
onIncomingMessage
is the body of the
body
function of the
and
messageID
timeToLive

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION MX 7.0.2-USING COLDFUSION MX WITH FLEX 2 and is the answer not in the manual?

This manual is also suitable for:

Coldfusion mx

Table of Contents