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

PurposeUnique identifier for the gateway type
RequirementsMust be unique across all gateway types
ExamplesSMS, XMPP, DirectoryWatcher, CustomQueue
Note: Use the same name that the gateway class sets with CFEvent.setGatewayType(), as Adobe recommends, so events and configuration stay consistent.

Java Class

PurposeFully qualified Java class name that implements the gateway
Built-in ClassesExample gateways (DirectoryWatcher, JMS, Socket) are compiled in cf_root/gateway/lib/examples.jar
Custom ClassesPlace in cf_root/gateway/lib/, which the ColdFusion class loader adds to its classpath
Required Interfacescoldfusion.eventgateway.Gateway (interface your class implements)
coldfusion.eventgateway.GatewayServices (class the runtime provides, used to send events and get a logger)
Development: Custom gateway classes must implement every method of the Gateway interface, including the lifecycle methods (start, stop, restart) and outgoingMessage. Refer to Adobe's Event Gateway reference for Java API details.

Startup Timeout (seconds)

PurposeMaximum time allowed for gateway to start before timing out
Shipped Value30 seconds on every gateway type ColdFusion ships preconfigured (verified in the ColdFusion 2025 Update 14 configuration, neo-event.xml, key STARTTIMEOUT, shipped in Adobe's official Docker image)
RecommendationIncrease for gateways that need time to establish connections
Warning: If a gateway consistently times out during startup, investigate connection issues or increase the timeout.

Stop on Startup Timeout

PurposeStartup time-out behavior for gateway instances of this type
BehaviorWhen enabled, ColdFusion stops the gateway if it times out on startup. When disabled, ColdFusion logs a warning when the timeout is exceeded
RecommendationEnable for gateways whose start() method returns quickly. Do not enable it for single-threaded gateways where start() is the listener and does not return until the gateway stops

Description

PurposeHuman-readable description of the gateway type's purpose
RecommendationInclude protocol, use cases, and any special requirements
Best Practice: Write clear descriptions that help other administrators understand when to use this gateway type and what it does.

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

ProgrammingJava development knowledge required
InterfacesMust implement coldfusion.eventgateway.Gateway
Required Methodsstart(), stop(), restart(), outgoingMessage(), getStatus(), getHelper(), getGatewayID(), setGatewayID(), setCFCListeners()
DeploymentJAR file in cf_root/gateway/lib/
Development Process:
  • 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:

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
Key Implementation Points:
  • 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 the gateway/src/examples/EmptyGateway.java template
  • Source: Adobe: Event gateway elements and Building an event gateway

Gateway Type Management

Adding Gateway Types

Steps1. Deploy Java classes to classpath
2. Add gateway type in Administrator
3. Configure type settings
4. Create gateway instances
Important: Place the JAR in cf_root/gateway/lib/. The ColdFusion class loader includes that directory and its JAR files on its classpath.

Editing Gateway Types

ImpactChanges affect all instances using this type
Restart RequiredGateway instances must be restarted to use new settings
Best Practice: Test gateway type changes in development before modifying production configurations.

Deleting Gateway Types

PrerequisitesStop and remove the gateway instances that use this type first
Best Practice: Stop and delete all instances that use a type before removing the type.

Common Issues & Solutions

Gateway Type Class Not Found

Symptom: ClassNotFoundException when adding gateway type or starting instances
Solutions:
  • 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

Symptom: Error when trying to add a gateway type with existing name
Solutions:
  • 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

Symptom: Custom gateway instances fail to start or don't process events
Solutions:
  • 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

Related Resources

Event Gateways - Gateway Types | ColdFusion Administrator | CFGuide