Event Gateways - Gateway Types
Configure gateway types and drivers for event processing
Overview
Gateway types define the underlying drivers and Java classes that implement specific event gateway protocols. Each gateway type represents a communication protocol or integration pattern (SMS, XMPP, directory monitoring, etc.) and provides the foundation for creating gateway instances.
ColdFusion includes several built-in gateway types, and you can add custom gateway types by developing Java classes that implement the ColdFusion Gateway API interfaces.
Gateway Type Configuration
Essential settings for configuring gateway types.
Gateway Type Name
CFEvent.setGatewayType(), as Adobe recommends, so events and configuration stay consistent.Java Class
cf_root/gateway/lib/examples.jarcf_root/gateway/lib/, which the ColdFusion class loader adds to its classpathcoldfusion.eventgateway.Gateway (interface your class implements)coldfusion.eventgateway.GatewayServices (class the runtime provides, used to send events and get a logger)Startup Timeout (seconds)
STARTTIMEOUT, shipped in Adobe's official Docker image)Stop on Startup Timeout
start() method returns quickly. Do not enable it for single-threaded gateways where start() is the listener and does not return until the gateway stopsDescription
Built-in Gateway Types
Adobe's Administrator documentation lists CFML, XMPP, and a set of sample gateway types (DirectoryWatcher, JMS, Socket). Several older types have been deprecated or removed.
CFML
- Purpose
- Triggers asynchronous events from ColdFusion
- Use Cases
- Running CFC work asynchronously
Built-in gateway type for asynchronous CFC calls.
SMS
- Java Class
- coldfusion.eventgateway.sms.SMSGateway
- Status
- Deprecated in ColdFusion 2025
SMS messaging gateway. Adobe lists it as deprecated; avoid it for new development.
XMPP
- Protocol
- Extensible Messaging and Presence Protocol
- Use Cases
- Instant messaging
Sends and receives instant messages through XMPP. Adobe's deprecated-features list shows the Jabber event gateway as removed in ColdFusion 2021, so confirm availability on your version.
DirectoryWatcher
- Java Class
- DirectoryWatcherGateway (sample)
- Monitoring
- File system changes (add, change, delete)
- Use Cases
- File import automation, batch processing
Example gateway (source in gateway/src/examples/watcher, compiled in gateway/lib/examples.jar). Logs errors to watcher.log.
JMS and Socket
- Java Class
- JMSGateway, SocketGateway (samples)
- Use Cases
- JMS consumer/producer; TCP/IP listener
Example gateways compiled in gateway/lib/examples.jar. Adobe describes the samples as examples only, not product-quality implementations.
DataManagement, DataServicesMessaging, FMS
- Protocol
- Flex / Flash data and messaging services
- Status
- Removed in ColdFusion 2025
Removed because Adobe removed Flash and Flex.
Creating Custom Gateway Types
You can extend ColdFusion's event gateway capabilities by developing custom gateway types in Java.
Custom Gateway Requirements
coldfusion.eventgateway.Gatewaystart(), stop(), restart(), outgoingMessage(), getStatus(), getHelper(), getGatewayID(), setGatewayID(), setCFCListeners()cf_root/gateway/lib/- Create Java class implementing Gateway interface
- Compile and package as JAR file
- Deploy JAR to the
cf_root/gateway/lib/directory - Enable event gateway services (Data & Services > Event Gateways > Settings)
- Add gateway type in Administrator (Manage Gateway Types)
- Create gateway instances
Custom Gateway Java Interface
Basic structure of a custom gateway implementation:
package com.example.gateway;
import coldfusion.eventgateway.*;
import java.util.HashMap;
import java.util.Map;
/**
* Custom event gateway for processing webhook events
*/
public class WebhookGateway implements Gateway {
private String gatewayID;
private String configFile;
private String[] listeners = new String[0];
private int status = STOPPED;
private final GatewayServices gatewayServices = GatewayServices.getGatewayServices();
private final Logger logger = gatewayServices.getLogger();
/**
* ColdFusion passes the gateway ID and the configuration file path
*/
public WebhookGateway(String id, String configFile) {
this.gatewayID = id;
this.configFile = configFile;
}
public void setGatewayID(String id) { this.gatewayID = id; }
public String getGatewayID() { return gatewayID; }
public void setCFCListeners(String[] listeners) { this.listeners = listeners; }
public GatewayHelper getHelper() { return null; }
public int getStatus() { return status; }
/**
* Start the gateway
*/
public void start() {
status = STARTING;
// Read settings from configFile (for example with java.util.Properties)
// and start your HTTP listener here
status = RUNNING;
logger.info("Webhook gateway " + gatewayID + " started");
}
/**
* Stop the gateway
*/
public void stop() {
status = STOPPING;
// Shut down your HTTP listener and release resources here
status = STOPPED;
logger.info("Webhook gateway " + gatewayID + " stopped");
}
public void restart() {
stop();
start();
}
/**
* Handle outgoing messages from sendGatewayMessage()
*/
public String outgoingMessage(CFEvent event) {
Map data = event.getData();
String url = (String) data.get("url");
String payload = (String) data.get("payload");
// Send payload to url with your HTTP client here
return "OK";
}
/**
* Call this from your listener when a webhook arrives
*/
private void processIncomingWebhook(String payload) {
for (String listener : listeners) {
Map<String, Object> data = new HashMap<>();
data.put("payload", payload);
data.put("timestamp", String.valueOf(System.currentTimeMillis()));
CFEvent event = new CFEvent(gatewayID);
event.setData(data);
event.setGatewayType("Webhook");
event.setOriginatorID("webhook");
event.setCFCPath(listener);
event.setCFCMethod("onIncomingMessage");
// Route to the listener CFC
if (!gatewayServices.addEvent(event)) {
logger.warn("Event queue full, webhook event dropped");
}
}
}
}# webhook.cfg - Gateway configuration file
# HTTP server port
port=8080
# Timeout for outgoing webhooks (milliseconds)
timeout=30000
# Retry attempts for failed webhooks
retryAttempts=3
# Security token for incoming webhooks
securityToken=your-secret-token-here
# Enable SSL/TLS
useSSL=false
# SSL certificate path (if useSSL=true)
# sslCertPath=/path/to/certificate.jks
# SSL certificate password
# sslCertPassword=password- start(): Initialize connections, start listeners, read configuration
- stop(): Clean shutdown, close connections, release resources
- outgoingMessage(): Handle messages sent from ColdFusion CFCs
- addEvent(): Route incoming events to ColdFusion CFCs
- Logging: Use the Logger returned by
GatewayServices.getLogger() - GenericGateway: Extending
coldfusion.eventgateway.GenericGateway(implement startGateway, stopGateway, outgoingMessage) saves boilerplate; alternatively, start from thegateway/src/examples/EmptyGateway.javatemplate - Source: Adobe: Event gateway elements and Building an event gateway
Gateway Type Management
Adding Gateway Types
2. Add gateway type in Administrator
3. Configure type settings
4. Create gateway instances
cf_root/gateway/lib/. The ColdFusion class loader includes that directory and its JAR files on its classpath.Editing Gateway Types
Deleting Gateway Types
Common Issues & Solutions
Gateway Type Class Not Found
- Verify JAR file is in the
cf_root/gateway/lib/directory - Check that fully qualified class name is correct
- Restart ColdFusion if the JAR was added while the server was running
- Verify JAR file is not corrupted (test with jar -tf command)
- Check that class implements required Gateway interface
Gateway Type Already Exists
- Choose a different, unique name for the gateway type
- Edit the existing gateway type instead of creating new one
- Delete old gateway type if no longer needed (remove instances first)
Custom Gateway Not Working
- Review eventgateway.log for Java exceptions
- Verify all required Gateway interface methods are implemented
- Check that start() method completes without throwing exceptions
- Ensure configuration file is properly formatted and accessible
- Add logging in Java code to debug initialization
- Test gateway class standalone before integrating with ColdFusion