https://github.com/cosium/matrix-communication-client
A java client for the Matrix protocol.
https://github.com/cosium/matrix-communication-client
matrix
Last synced: 10 months ago
JSON representation
A java client for the Matrix protocol.
- Host: GitHub
- URL: https://github.com/cosium/matrix-communication-client
- Owner: Cosium
- License: mit
- Created: 2023-06-28T21:09:24.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-08-12T09:44:42.000Z (10 months ago)
- Last Synced: 2025-08-18T11:57:57.937Z (10 months ago)
- Topics: matrix
- Language: Java
- Homepage: https://matrix.org/
- Size: 94.7 KB
- Stars: 41
- Watchers: 5
- Forks: 10
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/Cosium/matrix-communication-client/actions/workflows/ci.yml)
[](https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.cosium.matrix_communication_client%22%20AND%20a%3A%22matrix-communication-client%22)
# Matrix Communication Client
A [Matrix](https://matrix.org/) java client.
# Example
```java
public class Example {
public static void main(String[] args) {
MatrixResources matrix =
MatrixResources.factory()
.builder()
.https()
.hostname("matrix.example.org")
.defaultPort()
.usernamePassword("jdoe", "secret")
.build();
RoomResource room = matrix
.rooms()
.create(
CreateRoomInput.builder()
.name("Science")
.roomAliasName("science")
.topic("Anything about science")
.build());
room.sendMessage(Message.builder().body("Hello !").formattedBody("Hello !").build());
}
}
```
Another example with existing room:
```java
public class Example {
public static void main(String[] args) {
MatrixResources matrix =
MatrixResources.factory()
.builder()
.https()
.hostname("matrix.example.org")
.defaultPort()
.usernamePassword("jdoe", "secret")
.build();
RoomResource room = matrix
.rooms()
.byId("!PVvauSmjcHLwoAJkyT:matrix.example.org");
room.sendMessage(Message.builder().body("Hello !").formattedBody("Hello !").build());
}
}
```
# Dependency
```xml
com.cosium.matrix_communication_client
matrix-communication-client
${matrix-communication-client.version}
```