> For the complete documentation index, see llms.txt.
Skip to main content

Check out Port for yourself ➜ 

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 scheduledResyncInterval is 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.

Overlapping resyncs

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.

TypeHow resync requests arriveResyncsLive eventsActions
POLLINGThe integration queries Port at a fixed interval.✅✅✅
KAFKAThe integration consumes messages from your organization's dedicated Kafka topic.✅✅✅
WEBHOOKPort sends an HTTP request to the integration.✅✅✅
ONCEThe integration runs a single resync and exits.✅❌❌
WEBHOOKS_ONLYNone. The integration only processes live events.❌✅❌
ACTIONS_ONLYNone. The integration only processes action runs.❌❌✅
Multiple instances

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
ParameterDescriptionDefault
resyncOnStartWhether to run a resync when the integration starts.true
intervalThe 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
ParameterDescriptionDefault
brokersA comma-separated list of Kafka brokers.Port's Kafka brokers
securityProtocolThe security protocol used to connect to the brokers.SASL_SSL
authenticationMechanismThe authentication mechanism used to connect to the brokers.SCRAM-SHA-512
kafkaSecurityEnabledWhether to authenticate to the brokers with your organization's Kafka credentials.true
consumerPollTimeoutThe 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"
ParameterDescriptionDefault
appHostThe 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.

Choosing an interval

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.