
1313
DEVELOPING
COLDFUSION 9 APPLICATIONS
Using External Resources
Las
t
upda
te
d 8/5/2010
Configuring a Data Services Messaging event gateway
Although you can configure an instance of a Data Services Messaging event gateway by creating a configuration file
and specifying that file as the configuration file when you create an instance of the event gateway, you can also provide
the configuration information in the message sent from the Flex application. You provide configuration information
to the Data Services Messaging event gateway in a configuration file to do either of the following:
•
Have the Data Services Messaging event gateway send messages to Flex Enterprise Services 2 on a different
computer
•
Use the Data Services Messaging event gateway with a specific Flex destination, and ignore any destination
specified in the message
The Data Services Messaging event gateway configuration file is a simple Java properties file that contains the following
properties:
The following example is a configuration file:
#
# Flex event gateway configuration
#
# This is the destination of the messages.
destination=Gateway1
# host name or IP address of the Flex Enterprise Server
host=127.0.0.1
If you create a configuration file, save it in the
cf_root
/gateway/config/ directory, with the extension .cfg.
Sending outgoing messages
Your ColdFusion application sends a message to a Flex application by doing the following actions:
1
The ColdFusion application sends an outgoing message, in a
cfreturn
tag in the listener method of the listener
CFC, or by calling the ColdFusion
SendGatewayMessage
function.
2
A method provided by the Data Services Messaging gateway gets called when you send an outgoing message.
In outgoing messages sent from CFML, the following structure members are translated to the Flex message:
Property
Description
destination
A hard-coded destination. If you specify this value, any destination information in the message is ignored.
host
The host name or IP address of the Flex Enterprise Services 2 server.
Name
Contents
body
Body of the message. Required.
CorrelationID
Correlation identifier of the message.
Destination
Flex destination of the message. Required if it is not specified in the configuration file.
Headers
If the message contains any headers, the CFML structure that contains the header names as keys and values.
LowercaseKeys
If the value is set to
yes
, the structure keys are converted to lowercase during creation of ActionScript types.
TimeToLive
Number of milliseconds during which this message is valid.