Adobe COLDFUSION 9 Manual page 1319

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
In addition, the Data Services Messaging event gateway automatically provides values for the following Flex message
fields:
Name
Contents
MessageID
A UUID that identifies the message.
Timestamp
Time the message is sent.
ClientID
ID of the Data Services Messaging event gateway instance.
Note: A single instance of the Data Services Messaging event gateway can send messages to any destination that is
registered with the ColdFusion Event Gateway Adapter. However, if the destination is configured in the Data Services
Messaging gateway configuration file, the destination in the message is ignored.
Sending outgoing message example
The following example from a CFM page creates a structure that contains the message. The destination is the
destination ID specified in the flex-services.xml file for the instance of the Data Services Messaging event gateway to
send the message to. The body is the body of the message. The
to the instance of the gateway.
<cfset success = StructNew()>
<cfset success.msg = "E-mail was sent at " & Now()>
<cfset success.Destination = "gateway1">
<cfset ret = SendGatewayMessage("Flex2CF2", success)>
To ensure that properties maintain the correct case, define Flex-related information as follows:
myStruct['mySensitiveProp']['myOtherSensitiveProp']
The following is an example of using headers to send to a specific subtopic of the destination:
<cfset var msg = structnew()>
<cfset msg.destiNation = 'ColdFusionGateway'>
<cfset msg.body = 'somebody'>
<cfset msg['headers']['DSSubtopic'] = 'somesubtopic'>
<cfset sendgatewaymessage('CF2FLEX2' , msg)>
Handling incoming messages
When a Flex application sends a message to a ColdFusion application, the Data Services Messaging event gateway
sends a CFEvent structure to the onIncomingMessage function of 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 messageID and timeToLive from the Flex message.
sendGatewyMessage
Last updated 8/5/2010
CFML function sends the message
1314

Advertisement

Table of Contents
loading

Table of Contents