---
source_url: https://www.pubnub.com/docs/sdks/java/entities/channel
title: Channel Entity
updated_at: 2026-06-16T12:51:15.058Z
sdk_name: PubNub Java SDK
sdk_version: 6.4.5
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Channel Entity

PubNub Java SDK, use the latest version: 6.4.5

Install:

```bash
Add PubNub dependency to your build@6.4.5
```

As of version 9.0.0, the Java software development kit (SDK) supports entities. Entities are SDK objects that bundle operations for a specific resource type and simplify working with PubNub application programming interfaces (APIs).

Use entities to perform common tasks without manually wiring requests. Some PubNub APIs are exposed via entities. Other operations remain available on the `pubnub` object.

## Create a Channel

Use this factory method to return a local `Channel` entity for a single channel. A Channel entity centralizes common operations—such as subscribing and publishing—so you can prototype and build faster.

```java
pubnub.channel(String name)
```

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| name | String | Yes |  | Name of the [channel](https://www.pubnub.com/docs/general/channels/overview) for which to create the entity. |

#### Sample code

:::tip Reference code
This example is a self-contained code snippet ready to be run. It includes necessary imports and executes methods with console logging. Use it as a reference when working with other examples in this document.
:::

```java
import com.pubnub.api.PubNubException;
import com.pubnub.api.java.PubNub;
import com.pubnub.api.java.v2.PNConfiguration;
import com.pubnub.api.UserId;
import com.pubnub.api.java.v2.entities.Channel;

public class ChannelApp {
    public static void main(String[] args) throws PubNubException {
        // Configure PubNub instance
        PNConfiguration.Builder configBuilder = PNConfiguration.builder(new UserId("demoUserId"), "demo");
        configBuilder.publishKey("demo");
        configBuilder.secure(true);

        PubNub pubnub = PubNub.create(configBuilder.build());

        // Create a Channel entity
        Channel singleChannel = pubnub.channel("myChannel");

        System.out.println("Channel created: " + singleChannel.getName());
    }
}
```

## Available operations

The `Channel` entity provides operations for PubNub [channels](https://www.pubnub.com/docs/general/channels/overview).

| Operation (click for more information) | Description |
| --- | --- |
| [subscription(subscriptionOptions)](https://www.pubnub.com/docs/sdks/java/api-reference/publish-and-subscribe#subscribe) | Returns a local channel [subscription object](https://www.pubnub.com/docs/general/channels/subscribe#subscription-types) with [optional parameters](https://www.pubnub.com/docs/general/channels/subscribe#subscription-options). You can then subscribe to receive real-time updates for that channel. |
| [publish(message, shouldStore, meta, queryParam, usePost, ttl)](https://www.pubnub.com/docs/sdks/java/api-reference/publish-and-subscribe#publish) | Sends a message to all channel subscribers. |
| [fire(message, meta, usePost)](https://www.pubnub.com/docs/sdks/java/api-reference/publish-and-subscribe#fire) | Sends a message to [Illuminate](https://www.pubnub.com/docs/illuminate/business-objects/external-data-sources) and [Functions](https://www.pubnub.com/docs/serverless/functions/overview#on-request-functions) event handlers registered on the channel and triggers their execution. |
| [signal(message, meta, usePost)](https://www.pubnub.com/docs/sdks/java/api-reference/publish-and-subscribe#signal) | Sends a signal to all subscribers of the channel. |

## Terms in this document

* **Channel** - A pathway for sending and receiving messages between devices, created automatically when you first use it, that can handle any number of users and messages for different communication needs, like 1-1 text chats, group conversations, and other data streaming.
* **Channel pattern** - A way to group and analyze channel data to track performance metrics like message counts and user engagement over time with PubNub Insights.
* **Signal** - A non-persistent message limited to 64 bytes designed for high-volume usecases where the the most recent data is relevant, like GPS location updates.