# Channel Message

The `ChannelMessageEvent` is used to monitor internal channel messages in the Cloud. You can send and receive channel messages to services through the API and process them there.

### Methods

1. **`getServiceIdFrom()`** Returns the service ID from which the message originates.
2. **`getServiceIdTo()`** Returns the service ID to which the message should be sent.
3. **`getChannel()`** Returns the channel that was specified during the sending.
4. **`getMessage()`** Returns the message that was sent.

### Code example

```java
@Eventable
public void handle(ChannelMessageEvent event) {
    var channel = event.getChannel();
    var message = event.getMessage();
    System.out.printf("Message received: Channel %s and message %s%n", channel, message);
}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.walecloud.com/api-documentation/events/channel-message.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
