Connectors
Listeners
Sometimes it is necessary to run a connector continuously to handle data that is received asynchronously. Jobs are generally a better solution for scheduling connectors, but they aren’t intended to run indefinitely. Connector Listeners run a connector at a regular interval in the background indefinitely.
An example of a listener configuration is in webcentral-application-connectors\src\main\resources\com\archibus\app\common\connectors\appContext-services.xml. Adding one will require repackaging the jar. This is configured for OnSite, but this can be configured for any connector that needs to run continuously in the background by creating a copy of this <bean>
with a different id
and p:connectorId
.
<bean id="connectKafkaListener" class="com.archibus.app.common.connectors.transfer.common.ConnectorListener" p:connectorId="connect_listener_controller" p:checkListenerFlagDelayMs="2000" p:enableConnectorListner="${core.enableConnectorListner}"> </bean>
Item | Description |
---|---|
p:connectorId | The connector to run. |
p:checkListenerFlagDelayMs | How often to run it when Listening? is set on the connector |
p:enableConnectorListner="${core.enableConnectorListner}"> | Is required to ensure the thread is only run on a designated server in a load balanced architecture. |
p:projectIdis | Specify a project in afm-projects.xml in context of which to run the connector. If not specified, it defaults to the value configured in login.properties for autoLogin. |