tigase-IM服务器组成介绍(十八)

一、BOSH

BOSH (Bidirectional-streams Over Synchronous HTTP)是一种在客户端和服务器端之间通过HTTP的请求/响应进行客户端和服务器双向通信的技术,BOSH在XMPP系列规范中的XEP-0124中定义,应用场合为基于浏览器的客户端访问XMPP服务器。 下面的内容来自XEP-0124规范。http://www.xmpp.org/extensions/xep-0124.html http://shallon.iteye.com/blog/126428

二、tigase-auth sasl 开发例子

https://github.com/Smartupz/tigase-oauth

三、xmpp3个顶层XML元素: Message、Presence、IQ

Message 用于在两个jabber用户之间发送信息。Jsm(jabber会话管理器)负责满足所有的消息,不管目标用户的状态如何。如果用户在线jsm立即提交;否则jsm就存储。 To :标识消息的接收方。 from : 指发送方的名字或标示(id)o Text: 此元素包含了要提交给目标用户的信息Message 用于在两个jabber用户之间发送信息。Jsm(jabber会话管理器)负责满足所有的消息,不管目标用户的状态如何。如果用户在线jsm立即提交;否则jsm就存储。 To :标识消息的接收方。 from : 指发送方的名字或标示(id)o Text: 此元素包含了要提交给目标用户的信息

Presence

用来表明用户的状态,如:online、away、dnd(请勿打扰)等。当用户离线或改变自己的状态时,就会在stream的上下文中插入一个Presence元素,来表明自身的状态.结构如下所示:

IQ

一种请求/响应机制,从一个实体从发送请求,另外一个实体接受请求,并进行响应.例如,client在stream的上下文中插入一个元素,向Server请求得到自己的好友列表,Server返回一个,里面是请求的结果. 主要的属性是type。包括: Get :获取当前域值。 Set :设置或替换get查询的值。 Result :说明成功的响应了先前的查询。 Error: 查询和响应中出现的错误。 http://www.baidu.com/#wd=xmpp%20message%E2%80%9D%EF%BC%8C%E2%80%9Cpresence%E2%80%9D%E5%92%8C%E2%80%9Ciq%E2%80%9D&tn=baidu&ie=utf-8&f=8&rsv_bp=1&rsv_sug3=3&rsv_sug4=50&rsv_sug1=1&rsv_n=2&inputT=593&rsv_sug=2&bs=xmpp&rsv_spt=3

XMPP通信原语有3种:message、presence和iq。

四、plugin and component

plugin是session manager的,是基于xmpp的标签来进行处理,

component处理,是被MessageRouter根据它的component jid 选择进行处理 sm c2s s2s sm - session manager component. c2s - client connection manager component s2s - server connection manager component ext2s - external component connection manager ssender - StanzaSender component

源码 tigase packet 的from jid 和to jid 和xmpp协议的jid是不一样的 domain vhost vitual host 集群 http://www.tigase.org/content/clustering-tigase-42

gc优化,参考注释 http://www.tigase.org/content/how-packets-are-processed-sm-and-plugins

I personally recommend to use concurrent Mark Sweep and incremental mode GC which runs GC in background whenever possible.

Configuration wizards

配置向导 http://www.tigase.org/node/173

离线消息处理 https://projects.tigase.org/projects/tigase-server/repository/entry/trunk/src/main/java/tigase/xmpp/impl/OfflineMessages.java

http://hi.baidu.com/bngoogle/archive/tag/tigase

https://projects.tigase.org/projects/message-archiving/wiki/Configuration

学海无涯、何时是岸
原文地址:https://www.cnblogs.com/veblen/p/14703967.html