1
我正在使用webstomp與我的消息代理(本例中是兔子)進行通信。如何知道是否發送了一個stomp消息?
當我想要寫一個消息我做到以下幾點:由兔正確接收
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'});
此消息,但我想有一個方法來確認比viasually更多。類似於:
client.send('/exchange/amq.direct/test', {test: 'one', test2: 'two'})
.then(() => {console.log('Message received correctly')})
.catch((err) => {console.log('Imposible send the message')})
有沒有辦法做到這一點?
謝謝先進。