Newer Version Available
Learn More About EMP Connector
Authenticating
User credential information is passed in to the login function. The login function’s return value is passed in to the main connector class later.
For OAuth authentication, use the BayeuxParameters constructor to override the methods in the BayeuxParameters class and provide the token and URL values.
Listening to Events
To listen to events, the connector uses the Java event in a lambda expression. This statement prints the event message to the output for each received event notification. Place this statement before the statement that subscribes to the topic.
Subscribing to a Topic
The EmpConnector class is the main class that exposes the functionality of starting a connection and subscribing. The class contains functions to create a connection, subscribe to a topic, cancel a subscription, and stop a connection.
To end a subscription, call these functions.