Implementing ListenConnector
The com.boomi.connector.api.ListenConnector interface (refer to the Javadoc) lets you create a connector with a Listen operation.
Examples of event-driven connectors that have implemented the ListenConnector include JMS, Kafka, Rabbit MQ, and Microsoft Azure Service Bus.
Boomi Connector SDK Version 2.0 or later is required to implement the ListenConnector interface.
Considerations
Consider the following when you want to create and implement a Listen connector:
-
Currently, Listen connectors can only be uploaded as private connectors. As a result, Listen operations are only supported for private connectors. Additionally, you can only run them on containers owned by the same account.
-
Listen connectors can create standard connector operations, similar to the base
Connectorinterface. -
Listen operations do not extend the base
Operationinterface because they cannot be executed. -
You can deploy Listeners to local Runtimes and private clouds, but not to a Boomi Runtime cloud.
-
Listeners support both Low Latency and General mode.
-
With the
ListenConnectorinterface, you can createListenOperationandListenManagerinstances. Once aListenOperationis started, a listener instance is provided by Boomi. That instance can submit payloads for execution.noteAs of SDK version 2.1, you can submit multiple payloads for a single process execution using batches. For more information, refer to the Implementing the Listen operation topic.
-
Browse is optional and you can implement it the same way you would for other connectors.
-
createListenManageris required by the framework, but your connector may not need a manager.
Code sample
Here is a sample connector using the ListenConnector interface with comments included for context:
* Simple {@link ListenConnector} implementation. This connector currently only creates a {@link ListenOperation} and
* its corresponding {@link ListenManager}. This ultimately implements {@link Connector} so {@link Browser} and
* {@link Operation} instances could be created here as well if applicable.
*/
public class SimpleListenConnector extends BaseListenConnector<SimpleListenManager> {
/**
* Creates a new simple listen operation using the provided operation context
*/
@Override
public ListenOperation<SimpleListenManager> createListenOperation(OperationContext context) {
return new SimpleListenOperation(context);
}
/**
* Creates a new simple listen manager using the provided connector context
*/
@Override
public SimpleListenManager createListenManager(ConnectorContext context) {
return new SimpleListenManager(context);
}
/**
* Creates a new browser. Not currently supported.
*/
@Override
public Browser createBrowser(BrowseContext context) {
throw new UnsupportedOperationException();
}
}