Openfire WebService接口实现发送消息
XMPPServer server = XMPPServer.getInstance();SessionManager sessionManager = server.getSessionManager();MessageRouter messageRouter = server.getMessageRouter();Message message = new Message();message.setFrom(new JID(from + "@" + domain));message.setTo(new JID(to + "@" + domain));message.setBody(msg);message.setType(Message.Type.chat);messageRouter.route(message);
基本上内容都是由 messageRouter 去路由消息 具体消息内容只需要写 form 和 to 如果广播的话就得用到
sessionManager的 brodcastMsg 这个方法 路由 状态的话 需要 PresenceManager
?