> For the complete documentation index, see [llms.txt](https://docs.ecotone.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ecotone.tech/messaging/messaging-concepts/message-channel.md).

# Message Channel

Message Channel PHP

![](https://1452285857-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmAUnBnyZgZuLF2eWLn%2Fuploads%2Fgit-blob-89f538be698c8b752bd8178e8c71e5a3aaf2f624%2Fmessage-channel-connection.svg?alt=media)

In Symfony Messenger, you `dispatch()` and the framework chooses a transport. In Laravel, you `dispatch()` to a queue. A **Message Channel** is the same idea: it's the pipe. The point of giving channels first-class names ("orders", "notifications", "tenant\_a\_orders") is that **everything else in Ecotone — async processing, retries, dead letter, scaling — configures per channel**.

You'll declare a Message Channel explicitly when:

* You want a specific async handler to use a specific transport (one handler on RabbitMQ, another on a database queue).
* You want one handler to retry differently than another — different channels = different policies.
* You're going multi-tenant and want to isolate noisy tenants (see [Dynamic Channels](/modelling/asynchronous-handling/dynamic-message-channels.md)).

A message channel may follow either point-to-point or publish-subscribe semantics. With a **point-to-point** channel, only one consumer can receive each message. **Publish-subscribe** channels broadcast each message to all subscribers.

```php
interface MessageChannel
{
    /**
     * Send message to this channel
     */
    public function send(Message $message): void;
}
```

*`Pollable channels`* extends Message Channels with capability of buffering Messages within a queue. The advantage of buffering is that it allows for throttling the inbound messages and preventing of message loss.

```php
interface PollableChannel extends MessageChannel
{
    /**
     * Receive a message from this channel.
     * Return the next available {@see \Ecotone\Messaging\Message} or {@see null} if interrupted.
     */
    public function receive(): ?Message;

    /**
     * Receive with timeout
     * Tries to receive message till time out passes
     */
    public function receiveWithTimeout(int $timeoutInMilliseconds): ?Message;
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ecotone.tech/messaging/messaging-concepts/message-channel.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
