【发布时间】:2017-08-12 23:42:52
【问题描述】:
我正在使用 webstomp 与我的消息代理(在本例中为兔子)通信。
当我想写消息时,我会执行以下操作:
import * as SockJS from 'sockjs-client';
let client = Stomp.over(new SockJS(serverAddress));
client.connect(user, pass, onConnect, onError);
client.send('/exchange/amq.direct/test', {test: 'one', test2: 'two'});
Rabbit 正确接收到此消息,但我希望通过一种方式来确认这一点,而不是通过口耳相传。类似于:
client.send('/exchange/amq.direct/test', {test: 'one', test2: 'two'})
.then(() => {console.log('Message received correctly')})
.catch((err) => {console.log('Imposible send the message')})
有没有办法做到这一点?
提前致谢。
【问题讨论】:
标签: javascript rabbitmq stomp sockjs web-stomp