---
title: "Channel"
description: "This page lists the Java SDK names for Channels."
canonical_url: "https://docs.superdurable.io/zh-Hans/reference/java/channel/"
source: "docs/reference/java/channel.mdx"
locale: "zh-Hans"
---

# Channel

This page lists the Java SDK names for [Channels](https://docs.superdurable.io/zh-Hans/concepts/primitives/channel.md).
The doc comment of each API gives its parameters, defaults, and errors. Read
them in the [Java SDK API reference](https://docs.superdurable.io/zh-Hans/reference/java.md#api-reference).

<a id="api-names"></a>

## API names

| Task                                           | Java API                                                                                                                                                                                              | Dex behavior                                                                                                                       |
| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Define a Channel                               | **Channel.define**                                                                                                                                                                                    | [Channels](https://docs.superdurable.io/zh-Hans/reference/server/runtime-data.md#channels)                                         |
| Define a ChannelMap                            | **ChannelMap.define**                                                                                                                                                                                 | [ChannelMap](https://docs.superdurable.io/zh-Hans/reference/server/runtime-data.md#channelmap)                                     |
| Declare it in the Flow                         | **PersistenceSchema.of**, returned from **getPersistenceSchema**                                                                                                                                      | [Flow definition](https://docs.superdurable.io/zh-Hans/reference/java/flow.md#flow-definition)                                     |
| Publish a message from a Step or RPC           | **publish**                                                                                                                                                                                           | [Commits](https://docs.superdurable.io/zh-Hans/reference/java/step.md#commit-boundary)                                             |
| Wait for messages                              | **forOne**, **forN**, **atLeast**, **atMost**, and **range**                                                                                                                                          | [Wait conditions](https://docs.superdurable.io/zh-Hans/reference/server/runtime-data.md#channel-conditions)                        |
| Read the messages a wait consumed              | **getConditionResults**                                                                                                                                                                               | [Channel results](https://docs.superdurable.io/zh-Hans/reference/java/waits.md#channel-results)                                    |
| Load pending messages for a method             | **addWaitForLoadChannel**, **addExecuteLoadChannel**, and their ChannelMap variants of **StepOptions.Builder**, or **loadChannels**, **loadChannelMaps**, and **loadChannelMapInstances** of **@RPC** | [Selective state loading](https://docs.superdurable.io/zh-Hans/reference/java/step-options.md#selective-state-loading)             |
| Read loaded pending messages                   | **pendingMessages** and **findPendingMessage**                                                                                                                                                        | [Pending messages](https://docs.superdurable.io/zh-Hans/reference/server/runtime-data.md#manage-pending-messages)                  |
| Delete a pending message                       | **delete**                                                                                                                                                                                            | [Pending messages](https://docs.superdurable.io/zh-Hans/reference/server/runtime-data.md#manage-pending-messages)                  |
| Read the number of pending messages            | **size**                                                                                                                                                                                              | [Selective state loading](https://docs.superdurable.io/zh-Hans/reference/java/step-options.md#selective-state-loading)             |
| Count ChannelMap instances and list their keys | **ChannelMap.getMapSize** and **ChannelMap.getAllInstanceKeys**                                                                                                                                       | [ChannelMap](https://docs.superdurable.io/zh-Hans/reference/server/runtime-data.md#channelmap)                                     |
| Complete the Flow only when Channels are empty | **StepDecision.forceCompleteIfChannelsEmpty**                                                                                                                                                         | [ForceCompleteIfChannelsEmpty](https://docs.superdurable.io/zh-Hans/reference/java/step-decisions.md#forcecompleteifchannelsempty) |

<a id="example"></a>

## Example

Example: [examples/java/src/main/java/io/superdurable/dex/primitives/channel/ChannelFlow.java](https://github.com/superdurable/dex/tree/main/examples/java/src/main/java/io/superdurable/dex/primitives/channel/ChannelFlow.java)
