Upgrade the existing REST-based group messaging API to support real-time chat delivery using Spring WebSocket/STOMP. The current REST implementation should remain as the persistence and fallback layer, while WebSocket should reuse the existing GroupMessageService so membership checks, group status validation, and message saving stay centralized.
Acceptance Criteria:
Add WebSocket/STOMP configuration.
Authenticated group members can send messages in real time.
Authenticated group members can subscribe to group message updates.
Non-members cannot subscribe to or send messages for a group.
Messages are still persisted through the existing GroupMessageService.
REST endpoints continue to work as fallback/history API.
Frontend receives newly sent group messages without manual refresh.
Archived/cancelled groups reject real-time messaging.
Tests or documented manual verification cover member send/receive and non-member rejection.
Technical Notes:
Reuse existing GroupMessageService.sendMessage(...).
Broadcast saved messages to a group-specific topic, for example /topic/groups/{groupId}/messages.
Add WebSocket dependency only in this task, not in the basic REST messaging task.
Decide how JWT authentication will be passed during WebSocket connection before implementation.
Upgrade the existing REST-based group messaging API to support real-time chat delivery using Spring WebSocket/STOMP. The current REST implementation should remain as the persistence and fallback layer, while WebSocket should reuse the existing GroupMessageService so membership checks, group status validation, and message saving stay centralized.
Acceptance Criteria:
Add WebSocket/STOMP configuration.
Authenticated group members can send messages in real time.
Authenticated group members can subscribe to group message updates.
Non-members cannot subscribe to or send messages for a group.
Messages are still persisted through the existing GroupMessageService.
REST endpoints continue to work as fallback/history API.
Frontend receives newly sent group messages without manual refresh.
Archived/cancelled groups reject real-time messaging.
Tests or documented manual verification cover member send/receive and non-member rejection.
Technical Notes:
Reuse existing GroupMessageService.sendMessage(...).
Broadcast saved messages to a group-specific topic, for example /topic/groups/{groupId}/messages.
Add WebSocket dependency only in this task, not in the basic REST messaging task.
Decide how JWT authentication will be passed during WebSocket connection before implementation.