Chat Features
The Agglestone Messaging Service provides comprehensive real-time chat functionality designed to enable instant messaging between users in your applications. All features are accessible through REST APIs and WebSocket connections, making it easy to build chat capabilities directly into your own applications.
Your tenant has complete isolation, with your chats, messages, and channel memberships all tenant-scoped and completely separate from other tenants. This ensures that your chat data and conversations remain private and secure.
Real-Time Messaging
The Agglestone Messaging Service provides full real-time messaging capabilities through SignalR and WebSocket connections. When users send messages in a chat, all members of that chat channel receive instant notifications through their WebSocket connection. This enables true real-time communication where messages appear immediately for all participants.
Messages are automatically persisted in the database, ensuring that users can retrieve conversation history even if they were offline when messages were sent. This means users never miss messages, and can always catch up on conversations they weren’t actively viewing.
Chat Channels
Creating Chats
Create new chat channels to start conversations between users. When you create a chat, you specify which users should be members, and all specified members are automatically added to the chat. This makes it easy to start new conversations with the right participants from the beginning.
Chat Membership
Users must be members of a chat to send messages or view the conversation. Only existing chat members can add new members to a chat channel, ensuring that conversations remain private and controlled. Users can also remove themselves from chats, or other members can remove them if needed.
Viewing Your Chats
Users can retrieve a paginated list of all chats they are members of. This allows you to build chat lists, conversation views, or any other interface that helps users navigate their active conversations.
Chat Details
Retrieve detailed information about specific chats, including the chat name, creation date, and member count. Users can only access details for chats they are members of, ensuring privacy and security.
Message Management
Sending Messages
Send messages to any chat that you are a member of. Messages are immediately delivered to all chat members through their SignalR and WebSocket connections, providing instant real-time communication. Messages are also persisted in the database, so they can be retrieved later for conversation history.
Retrieving Messages
Retrieve paginated chat messages for any chat you are a member of. You can optionally filter messages by date range to get messages between two specific time points. This makes it easy to load conversation history, implement infinite scroll, or fetch messages from a specific time period.
Viewing Individual Messages
Retrieve specific chat messages by their ID. This is typically used after receiving a WebSocket notification event to fetch the full message details. Users can only access messages from chats they are members of.
Chat Members
Viewing Members
Retrieve a paginated list of all members in a specific chat. This allows you to display who is participating in a conversation, build member lists, or implement member management interfaces. Users must be members of the chat to view its members.
Adding Members
Add new users to existing chats. Only existing chat members can add new members, ensuring that conversations remain controlled and private. When a user is added to a chat, they automatically become able to send messages and receive real-time notifications for that chat.
Removing Members
Remove users from chats. Users can remove themselves from chats, or other chat members can remove them. When a user is removed from a chat, they will no longer receive messages or notifications from that chat.
Real-Time Notifications
When a message is sent in a chat, all chat members receive a real-time notification through their SignalR and WebSocket connection. These notifications are lightweight events that indicate a new message has arrived, allowing your application to fetch the full message details and update the user interface immediately.
The SignalR and WebSocket connection automatically handles reconnection, so users stay connected even if their network connection is temporarily interrupted. When reconnecting, users should fetch any unread messages that were created while they were disconnected.
Multi-Tenant Architecture
The Agglestone Messaging Service is built on a multi-tenant architecture where each tenant operates in complete isolation. This means:
- Tenant-Scoped Chats – Chats belong to specific tenants and can only be accessed within that tenant
- Isolated Messages – All chat messages are tenant-scoped and cannot be accessed across tenant boundaries
- Separate Memberships – Chat memberships are tenant-scoped, ensuring users can only participate in chats within their tenant
- Independent Data – All chat data, including messages and channel information, is completely separate between tenants
This architecture ensures that your chat data and conversations remain completely private and secure, while allowing you to build rich real-time communication features into your applications.
—
Ready to see how notifications work? Check out Notifications Features.