无法使用Stomp Websocket发送标题'userId'

时间:2017-02-03 14:04:18

标签: java websocket stomp

当我尝试使用命令从Java客户端向服务器发送消息时:

connectedHeaders.add("userId", UUID.randomUUID().toString());     
session.send("/app/start_smpp", connectedHeaders.getFirst("userId"));

我收到错误:

11:49:43.596 [clientInboundChannel-7] ERROR o.s.w.s.m.WebSocketAnnotationMethodMessageHandler - Unhandled exception
org.springframework.messaging.MessageHandlingException: Missing header 'userId' for method parameter type [class java.lang.String]

我不知道如何在java中发送标头userID

在js代码中看起来像这样:

 session.send(destination, {headers}, body);

0 个答案:

没有答案
相关问题