User Guide

Table Of Contents
Developing an event gateway application 1029
Developing an event gateway application
All event gateway applications handle information. They exchange event messages, and possibly
other types of information, with other resources. Event gateway applications require a listener
CFC to handle events that are sent to the event gateway. Event gateway applications can also use
the following code elements:
SendGatewayMessage CFML functions to send messages from outside the listener CFC (or,
optionally, from the CFC)
GatewayHelper objects
The eventgateway log file
The following sections provide an overview of how an application can send information:
Event gateway application models
Sending information to the event gateway
Developing event gateway listener CFCs
Sending a message using the SendGatewayMessage function
Using the GatewayHelper object
Using the event gateway error log file
Event gateway application models
Event gateway applications follow one or both of the following models:
Responder applications Where event messages from external sources initiate a response
from a ColdFusion listener CFC
Initiator applications Where a ColdFusion application generates event messages to send out
using the event gateway
Unlike other ColdFusion applications, responder applications are request-free. They do not have
CFM pages, just CFCs, and they do not respond to HTTP requests. Instead, ColdFusion the
event gateway service deliver the event messages directly to the listener CFC, and the CFC
listener method returns any response directly to the event gateway service. Applications that allow
mobile phone owners to get a news feed, check for text messages, or request other forms of
information follow this model.
Initiator applications are similar to most ColdFusion applications. At some point, ColdFusion
executes a CFM page in response to a request. (The request could be initiated by the ColdFusion
MX Administrator Scheduled Tasks page.) ColdFusion sends a message to the event gateway
when the application calls a CFML
SendGatewayMessage function. An application that uses
SMS to notify customers when orders have been shipped follows this model.