我使用Spring实现将websocket + stomp作为服务器,将SockJS作为客户端使用。当连接正常时,这非常有效。但是,当连接断开时,我试图保持消息重新发送。这是我的代码。
HdfsIO hdfsIO = new HdfsIO(hdfsCoreSite,hdfsSite);
FileSystem fs = FileSystem.get(hdfsIO.getConfiguration());
FSDataOutputStream out = fs.append(new Path("/test_dir_10/append_data_to_this_file.txt"));
out.writeUTF("Append demo...");
fs.close();
我的问题是我只是无法知道 convertAndSend 失败,即使我断开了网络并且websocket连接中断,它也不会抛出MessagingException。有没有办法让我知道失败?