1. 程式人生 > >openfire接收離線訊息

openfire接收離線訊息

先接收離線訊息後再通知openfire上線

//獲取離線訊息
        OfflineMessageManager offlineMessageManager=new OfflineMessageManager(connection);
       Iterator<Message> messages=offlineMessageManager.getMessages();
       while (messages.hasNext()){
           Message msg=messages.next();
           System.out.println(msg.toXML());
       }