Skip to content

feat: Implement WebSocket chat functionality with message handling and storage#7

Merged
PasinduOG merged 2 commits intodevfrom
feature/websocket
Apr 11, 2026
Merged

feat: Implement WebSocket chat functionality with message handling and storage#7
PasinduOG merged 2 commits intodevfrom
feature/websocket

Conversation

@PasinduOG
Copy link
Copy Markdown
Owner

This pull request introduces a real-time chat feature for events using WebSockets and STOMP messaging in the application. The main changes include the full setup for WebSocket communication, message handling, and persistence of chat messages related to specific events.

WebSocket and Messaging Infrastructure:

  • Added WebSocketConfig to enable and configure WebSocket message broker with STOMP endpoints for event chat (/ws-event-chat endpoint, /app prefix for application destinations, /topic for broadcasting messages).

Chat Messaging Functionality:

  • Implemented ChatController to handle incoming chat messages for specific events and broadcast them to subscribers using STOMP.
  • Introduced ChatMessageRequest and ChatMessageResponse DTOs for structured chat message data transfer. [1] [2]

Persistence Layer:

  • Defined ChatMessageRepository interface and its implementation ChatMessageRepositoryImpl to save incoming chat messages to the database using JdbcTemplate. [1] [2]

Service Layer:

  • Added ChatMessageService interface and its implementation ChatMessageServiceImpl to handle business logic for saving chat messages. [1] [2]

@PasinduOG PasinduOG self-assigned this Apr 11, 2026
@PasinduOG PasinduOG added the enhancement New feature or request label Apr 11, 2026
@PasinduOG PasinduOG requested a review from Copilot April 11, 2026 14:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces real-time event chat via Spring WebSocket/STOMP, including message broadcasting and persistence of chat messages per event.

Changes:

  • Added WebSocket/STOMP broker configuration and a chat messaging endpoint.
  • Implemented chat message handling (controller/service) and JDBC persistence (repository).
  • Added request/response DTOs for chat message payloads.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/main/java/dev/pasinduog/eventsphere/config/WebSocketConfig.java Configures STOMP endpoint and broker prefixes for event chat.
src/main/java/dev/pasinduog/eventsphere/controller/ChatController.java Handles inbound chat messages per event and broadcasts responses.
src/main/java/dev/pasinduog/eventsphere/dto/ChatMessageRequest.java Defines inbound chat message payload structure.
src/main/java/dev/pasinduog/eventsphere/dto/ChatMessageResponse.java Defines outbound/broadcast chat message payload structure.
src/main/java/dev/pasinduog/eventsphere/repository/ChatMessageRepository.java Declares persistence operation for chat messages.
src/main/java/dev/pasinduog/eventsphere/repository/impl/ChatMessageRepositoryImpl.java Persists chat messages to chat_messages via JdbcTemplate.
src/main/java/dev/pasinduog/eventsphere/service/ChatMessageService.java Declares business operation for saving messages.
src/main/java/dev/pasinduog/eventsphere/service/impl/ChatMessageServiceImpl.java Implements message persistence via repository and returns stored response.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main/java/dev/pasinduog/eventsphere/service/impl/ChatMessageServiceImpl.java Outdated
Comment thread src/main/java/dev/pasinduog/eventsphere/config/WebSocketConfig.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Owner Author

@PasinduOG PasinduOG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Reviewed.

@PasinduOG PasinduOG merged commit 5c38070 into dev Apr 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants