请问用C++编写的开源的消息中间件有哪些
请问用C++编写的开源的消息中间件有哪些??? --------------------编程问答-------------------- 不知,帮顶 --------------------编程问答-------------------- 有问题请先GOOGLE,BAIDU --------------------编程问答-------------------- MQ4CPP --------------------编程问答-------------------- 基本类:Thread()
Thread()Vector()
核心类:
MessageQueue():Thread,Thread
Registry():protected Vector, protected LinkedList, protected Thread
次核心类:
MessageProxy : public MessageQueue
Registry():protected Vector, protected LinkedList, protected Thread
Observer : public MessageQueue
Client(): public Observer
Server(): public Observer
LookupReplyMessage
onRequest
客户端:
MyClient* aClientA=new MyClient("MyClientA",host,"MyServerA");
// 参数包括:名称,IP地址,会话的服务器名称
1 MyClient (const char* theName, char* theHost, const char* theTarget) : Observer(theName)
// 构造函数,调用了:MessageProxyFactory::lookupAt(itsHost,9000,itsTarget,this);
setEncription(new Rijndael256());
2 virtual void onLookup(LookupReplyMessage* theMessage)
3 virtual NetworkMessage* generateMessage()
4 void sendMessage()
5 virtual NetworkMessage* onRequest(NetworkMessage* theMessage)
构造函数调用顺序:
1构造MyClient,由于继承Observer
首先调用Observer构造函数,由于继承MessageQueue
首先调用MessageQueue构造函数
调用Add(this),将当前消息加入队列
itsEncription=NULL;
itsCompression=NULL;
itsLastMessageProxy=0;
正式调用MyClient构造函数
调用MessageProxyFactory::lookupAt(itsHost,9000,itsTarget,this)。
调用父类Message对象,传入参数”LookupRequestMessage”;
调用new LookupRequestMessage构造一个对象,创建查找请求消息
itsNameToLookup=theName;
itsSender=theSenderID;
调用MessageProxyFactory 的post 方法
调用MessageQueue的lookup方法来查找消息
会调用Registry的lookup方法,
itsAction=Registry::LOOKUP;
itsFoundFlag=false;
itsQueueToLookup=theName;
如果没有找到会创建SocketClient对象来与服务器端建立连接,创建MessageProxy对象,调用MessageProxy的onMessage,
先构造MessageQueue,调用start开启线程,调用run启用线程,调用MessageProxy的onMessage,会调用onLookup,会调用sendMessage,会调用SendBytes(发送消息)
构造时会调用_mp_thread_proc,它会调用receive(接收消息),调用MessageQueue的post方法,将消息放到队列中,;如果找到了则直接利用已有连接发送。
服务器端:
MessageProxyFactory aFactory("MyFactory",9000);
调用start开启线程
MyServer* aServerA=new MyServer("MyServerA");
补充:企业软件 , WebSphere