source: bus-n-go-pavel-216049/bus-n-go-backend/src/main/kotlin/mk/ukim/finki/busngobackend/service/WebSocketService.kt

Last change on this file was baf4cc4, checked in by ppaunovski <paunovskipavel@…>, 3 months ago

split group project and individual project into two separate folders

  • Property mode set to 100644
File size: 415 bytes
Line 
1package mk.ukim.finki.busngobackend.service
2
3import org.springframework.messaging.simp.SimpMessagingTemplate
4import org.springframework.stereotype.Service
5
6@Service
7class WebSocketService(
8 private val messagingTemplate: SimpMessagingTemplate,
9) {
10 fun sendMessage(
11 topicSuffix: String,
12 message: String,
13 ) {
14 messagingTemplate.convertAndSend("/topic/$topicSuffix", message)
15 }
16}
Note: See TracBrowser for help on using the repository browser.