Event listeners and resync triggers
An event listener is the component that tells an Ocean integration when to run a resync. It receives requests from Port, such as a mapping change or a manual resync, and starts a resync in the integration.
The event listener also determines whether the integration processes live events and actions, as described in event listener types below.
Resync triggers
An Ocean integration starts a full resync in the following cases:
- On startup - When the integration starts, if the event listener is configured to resync on start.
- Configuration change - When the integration's configuration or mapping is updated in Port, for example from the connectors page.
- Manual resync - When you click Resync on the connectors page, or call the resync API endpoint.
- Scheduled resync - At a fixed interval, if
scheduledResyncIntervalis set.
Before a resync starts, Ocean reports the resync as running in Port. When the resync ends, Ocean reports it as completed or failed, and this status appears on the integration's sync status page.
If a new full resync is triggered while another is still running, the running resync is aborted and the new one starts. If resyncs keep aborting each other, the integration never completes a full resync. See sync interactions for details.
Event listener types
The event listener is configured using the eventListener.type parameter (OCEAN__EVENT_LISTENER__TYPE environment variable). The default is POLLING.
| Type | How resync requests arrive | Resyncs | Live events | Actions |
|---|---|---|---|---|
POLLING | The integration queries Port at a fixed interval. | ✅ | ✅ | ✅ |
KAFKA | The integration consumes messages from your organization's dedicated Kafka topic. | ✅ | ✅ | ✅ |
WEBHOOK | Port sends an HTTP request to the integration. | ✅ | ✅ | ✅ |
ONCE | The integration runs a single resync and exits. | ✅ | ❌ | ❌ |
WEBHOOKS_ONLY | None. The integration only processes live events. | ❌ | ✅ | ❌ |
ACTIONS_ONLY | None. The integration only processes action runs. | ❌ | ❌ | ✅ |
Event listeners that trigger resyncs do not support running multiple instances of the same integration. To scale live events processing horizontally, see live events at scale.
POLLING
The integration queries Port at a fixed interval and checks whether the configuration changed or a resync was requested. If so, it starts a resync.
eventListener:
type: POLLING
resyncOnStart: true
interval: 60
| Parameter | Description | Default |
|---|---|---|
resyncOnStart | Whether to run a resync when the integration starts. | true |
interval | The time in seconds between queries to Port. | 60 |
The polling listener requires only outbound traffic from the integration to Port, which makes it the simplest option for most self-hosted deployments.
KAFKA
The integration consumes resync requests from a Kafka topic dedicated to your organization. When the configuration is updated in Port, Port publishes a message to the topic and the integration starts a resync.
eventListener:
type: KAFKA
| Parameter | Description | Default |
|---|---|---|
brokers | A comma-separated list of Kafka brokers. | Port's Kafka brokers |
securityProtocol | The security protocol used to connect to the brokers. | SASL_SSL |
authenticationMechanism | The authentication mechanism used to connect to the brokers. | SCRAM-SHA-512 |
kafkaSecurityEnabled | Whether to authenticate to the brokers with your organization's Kafka credentials. | true |
consumerPollTimeout | The time in seconds the consumer waits for messages before returning an empty response. | 1 |
The defaults connect to Port's managed Kafka brokers, so you usually do not need to change them. Your organization's Kafka credentials are fetched from Port automatically.
WEBHOOK
Port sends an HTTP POST request to the integration's <appHost>/resync endpoint whenever the configuration is updated or a resync is requested.
eventListener:
type: WEBHOOK
appHost: "https://my-ocean-integration.example.com"
| Parameter | Description | Default |
|---|---|---|
appHost | The URL of the integration, reachable by Port. | - |
The appHost URL must accept inbound requests from Port. Port's requests originate from a fixed set of outbound IP addresses.
ONCE
The integration runs a single resync and then exits. This listener is used to run integrations as scheduled jobs, for example from a CI pipeline or a Kubernetes CronJob.
eventListener:
type: ONCE
When incremental sync is enabled for the integration, a ONCE run performs an incremental sync instead of a full resync.
Scheduled resync
The scheduledResyncInterval parameter (OCEAN__SCHEDULED_RESYNC_INTERVAL environment variable) sets the number of minutes between automatic full resyncs.
- When set, the integration fetches fresh data at this interval, regardless of configuration changes.
- When not set, resyncs run only when triggered by the event listener.
Scheduled resyncs work alongside any event listener that supports resyncs. For hosted integrations, you select the resync interval in Port when installing the integration.
Set an interval long enough for a full resync to complete. Otherwise, the next scheduled resync aborts the running one. Start with a large interval, such as 2 hours, and reduce it only if you need more frequent updates.