Newer Version Available

This content describes an older version of this product. View Latest

Example: Subscribe to Events Using a Java Client (EMP Connector) on the Command Line

Learn how to use the EMP Connector open-source tool on the command line. EMP Connector is a thin wrapper around the CometD library. It hides the complexity of creating a CometD client and subscribing to Streaming API in Java. The example subscribes to a platform event, receives notifications, and supports replaying events with durable streaming.

EMP Connector is a free, open-source, community-supported tool. Salesforce provides this tool as an example of how to subscribe to events using CometD. To contribute to the EMP Connector project with your own enhancements, submit pull requests to the repository at https://github.com/forcedotcom/EMP-Connector.

Important

EMP Connector is based on Java and uses CometD version 3.1.0. It supports username and password authentication and OAuth bearer token authentication. This walkthrough shows steps only for username and password authentication.