User Guide

Table Of Contents
1044 Chapter 42: Using Event Gateways
The gateway passes the contents of the message to the configured CFC in the event structure,
as follows:
The listener CFC method must be named
onIncomingMessage. If the CFC method does not
send a message in response, it should return a structure containing a status field with a value of
OK or EXCEPTION. (In this case, The gateway checks the return status field, but does not
process these return values further.) To send a message, the CFC method must return a structure
as documented in the following section.
Using the JMS Gateway as a producer
To send a JMS message, the return value of your CFC method or the second, messageStruct,
parameter to the
SendGatewayMessage function must be a structure with the following fields:
If you send the message in a
SendGatewayMessage function, the function returns OK if the
gateway sends the message, or EXCEPTION if it fails to send the message.
Menu example application
ColdFusion MX is installed with a menu-based responder application. The menu application is
written to work with any of the standard ColdFusion MX event gateways (SMS, XMPP, and
Sametime) and with the Socket example event gateway, and ColdFusion MX is preconfigured
with an instance of the application that uses SMS, as follows:
The Gateways page in the ColdFusion MX Administrator includes a gateway instance for this
application that uses the SMS gateway type.
The gateway/cfc/examples/menu directory and its subdirectories include the CFML for the
application
Field Contents
data.id Message correlation ID
data.msg Text of the message
gatewayType Gateway type: JMS
originatorID Topic name from which the message was consumed
Field Contents
status Must be SEND.
topic Name of the topic to publish the message to.
id (Optional) The JMS correlation ID to associate with the message. The default is
null.
message Text of the message to publish.
asBytes (Optional) How to publish the message:
If omitted, no, or false, send the message as text.
If any other value, send the message as byte-encoded UTF-8.