我正在使用Spring的SimpMessagingTemplate convertAndSend()通过websocket发送消息,如何捕获该函数中的错误?我找不到任何显示此内容的示例代码。
我的代码(在Quartz作业中):
import org.springframework.messaging.simp.SimpMessagingTemplate
class MyJob {
static triggers = {
simple repeatInterval: 2500L
}
def execute() {
brokerMessagingTemplate.convertAndSend("/topic/mytopic", myMsg)
// Need to find out if convertAndSend had an error or sent successfully here
}
}