我试图从nodejs
. 我采用了与 solace web 消息演示中给出的相同的代码。如下例所示是session
属性:
my_web_server_url = "http://<ip:port>/smf";
my_client_username = "<username>";
my_vpn = "<vpnname>";
my_password = "<password>";
当我调试 的回调方法的代码时solace.SessionEventCBInfo
,solace.SolclientFactory.createSession
我发现以下条件永远不会满足:
if (event.sessionEventCode === solace.SessionEventCode.UP_NOTICE) {
console.log(":::Connected:::");
}
并且控制进入所有 3 个传输方案(HTTP_BASIC、HTTP_BASE64 和 HTTP_STREAMING)的连接状态,最后进入错误状态。
else if (event.sessionEventCode === solace.SessionEventCode.CONNECTING) {
console.log(":::Connecting.....");
} else {
console.log(":::Error!:::");
}
solace 设备上是否有任何配置问题?配置时是否应该在 solace 设备上启用 Web 消息传递?还是我在代码中做错了什么?
更新
活动详情请见下方session
:
Session event: sessionEventCode=CONNECTING, infoStr=Establishing connection (transport:HTTP_BINARY_STREAMING), responseCode=, errorSubCode=, correlationKey=, reason=()
(index):105 Connecting.....
(index):102 Session event: sessionEventCode=CONNECTING, infoStr=Establishing connection (transport:HTTP_BINARY), responseCode=, errorSubCode=, correlationKey=, reason=()
(index):105 Connecting.....
(index):102 Session event: sessionEventCode=CONNECTING, infoStr=Establishing connection (transport:HTTP_BASE64), responseCode=, errorSubCode=, correlationKey=, reason=()
(index):105 Connecting.....
(index):102 Session event: sessionEventCode=DISCONNECTED, infoStr=Session is destroyed, responseCode=, errorSubCode=, correlationKey=, reason=(Transport session event: sessionEventCode=2, infoStr=Session is destroyed, responseCode=, sid=)
(index):109 Error!!!!!