---
source_url: https://www.pubnub.com/docs/integrations/kafka-overview
title: Kafka integration overview
updated_at: 2026-09-30T07:20:08.000Z
---

# Kafka integration overview

## Documentation index

To discover more PubNub resources:

1. Fetch [PubNub's llms.txt](https://www.pubnub.com/llms-full.txt) for a list of available pages in Markdown format.
2. Identify relevant URLs from that index.
3. Fetch the target pages.

Do not assume a path exists, always check the index first.

PubNub and Apache Kafka connect in two separate directions. The [PubNub Kafka Sink Connector](https://www.pubnub.com/docs/integrations/connect-pubnub-to-kafka.md) publishes Kafka records to PubNub channels. An [Events & Actions](https://www.pubnub.com/docs/integrations/event-forwarding/overview.md) Kafka Action forwards matching PubNub events to Kafka. They solve opposite data paths and use separate configuration.

## Choose a direction

| If you need to | Use | It runs in |
| --- | --- | --- |
| Send records from Kafka topics to connected PubNub clients | PubNub Kafka Sink Connector | Your Kafka Connect environment |
| Forward PubNub events to a Kafka topic | Events & Actions Kafka Action | PubNub, configured in the Admin Portal |

The Kafka Sink Connector is the inbound path to PubNub. A Kafka Action is the outbound path from PubNub. They are complementary, but they are not one bidirectional connector.

## How the paths work

On the inbound path, a backend producer writes records to a Kafka topic. The PubNub Kafka Sink Connector runs in Kafka Connect, reads those records, and publishes each one to a PubNub channel. PubNub then delivers each message to the client apps subscribed to that channel.

On the outbound path, activity in a client app creates a PubNub event. An Events & Actions event listener matches the event, and its Kafka Action forwards the event data to a Kafka topic.

```mermaid
flowchart TB
    subgraph IN["Kafka to PubNub"]
        direction LR
        KIN["<b>Kafka topic</b><br/>backend events"]
        CONNECT["<b>Kafka Connect</b><br/>PubNub Kafka<br/>Sink Connector"]
        CHANNEL["<b>PubNub channel</b>"]
        APPIN["<b>Client apps</b><br/>PubNub SDKs"]

        KIN -->|"records"| CONNECT
        CONNECT -->|"publishes"| CHANNEL
        CHANNEL -->|"delivers"| APPIN
    end

    subgraph OUT["PubNub to Kafka"]
        direction LR
        APPOUT["<b>Client apps</b><br/>PubNub SDKs"]
        EVENT["<b>PubNub event</b>"]
        ACTION["<b>Event listener +<br/>Kafka Action</b>"]
        KOUT["<b>Kafka topic</b><br/>forwarded PubNub events"]

        APPOUT -->|"activity"| EVENT
        EVENT -->|"matches"| ACTION
        ACTION -->|"forwards event data"| KOUT
    end

    IN ~~~ OUT

    class CHANNEL,EVENT emphasis
    class CONNECT,ACTION muted
    class KIN,KOUT external
```

## Send Kafka records to PubNub

The PubNub Kafka Sink Connector runs as a Kafka Connect plugin in your Kafka environment. By default, it publishes each Kafka record's value to a PubNub channel with the same name as the record's topic.

That default mapping keeps a simple integration easy to reason about. A producer writes to the Kafka topic `orders`, the connector publishes its records to the PubNub channel `orders`, and clients subscribe to that channel. You can provide a custom router when your application needs different channel names or message payloads.

The connector holds your PubNub credentials in server-side Kafka Connect configuration. It needs a secret key only if you use it to grant Access Manager tokens. Otherwise, keep your publish and subscribe keys in that configuration and out of client applications and source control.

## Forward PubNub events to Kafka

[Events & Actions](https://www.pubnub.com/docs/integrations/event-forwarding/overview.md) forwards PubNub activity to external systems without SDK code. An event listener watches events on a keyset. When an event matches, its Kafka Action sends the event data to your Kafka topic.

This path works when Kafka needs a copy of activity that already occurred in PubNub, such as messages, Presence changes, or App Context updates. It does not deploy or manage Kafka Connect. You configure the listener and Kafka Action in the Admin Portal.

The Kafka destination receives the event data selected by the listener. Treat Kafka as a separate system for access control, retention, and privacy decisions.

## Next steps

* [Stream Kafka records to PubNub clients](https://www.pubnub.com/docs/integrations/connect-pubnub-to-kafka.md). Run the Kafka Sink Connector locally and verify that a Kafka record reaches a PubNub channel.
* [Create a Kafka action](https://www.pubnub.com/docs/integrations/event-forwarding/create-kafka-action.md). Forward matching PubNub events to a Kafka topic.
* [Events & Actions](https://www.pubnub.com/docs/integrations/event-forwarding/overview.md). Understand event listeners, actions, retries, and billing.

Last updated at: 2026-09-30T07:20:08.000Z
