qpid 记录

最近在折腾qpid,遇到一些问题,记录一下

0)qpid 虽然还在更新,但是版本0.3个人感觉还是不够成熟,后面试试zeromq,看文档更全一点。。

1)qpid-proton pqid broker的关系


qpid-proton的核心是Messenger,也就是一个AMQP兼容的开发包(可以作为客户端,看参数,似乎可以独立作为一个AMQP的接受服务器?)

qpid broker可以理解为server,可以理解为一个传统意义上的ESB中心节点


2)queue exchange的区别


了解ESB技术(JMS)等,知道分为 queue 和topic两种,还有一些其他参数 AMQP协议更细化,

AMQP node分为queue和exchange(topic)(P2P、P2N、Pub-Sub等)

exchange又分为Direct、topic、fanout、headers四种:Both brokers support:

  • Direct Exchange (类似JMS 的QUEUE,但是不保存)
  • Topic Exchange  (类似JMS的Topic + 消息主题,支持匹配#*)
  • Fanout Exchange (类似JMS的Topic)
  • Headers Exchange (类似JMS的Topic + 多个消息中的key过滤)

    direct     Direct exchange for point-to-point communication
    fanout     Fanout exchange for broadcast communication
    topic      Topic exchange that routes messages using binding keys with wildcards
    headers    Headers exchange that matches header fields against the binding keys
    xml        XML Exchange - allows content filtering using an XQuery

In additional the C++ broker supports

  • XML Exchange - Query routing
  • Custom exchange via plug-in.

3)ubuntu默认安装的qpidd版本过低、以及奇怪的问题

    14.04默认安装的是 0.13 ?? 

    默认的python-qpid 是 0.22


    只能下载编译安装了,同时需要注意,默认编译生成的qpidd式按照RHEL的rc脚本写,不兼容debian系列

    后来换了centos, 需要把 /usr/local/etc/init.d/qpidd 拷贝到对应目录,记得添加qpidd用户,并且为其添加/var/lib/


4)qpid-proton 和qpidd的问题

    用qpid messeaging api 的测试没有问题,但是


    导致python写的qpid-proton 调用Messenger报错:[0x1583640]:ERROR amqp:connection:framing-error SASL header mismatch: 'AMQP\x01\x01\x00\x0a'

    刚开始还以为是操作系统的问题,后来换centos6 也不行,为了测试amqp协议支持,又换了rabbitmq,发现还是报同样的错误,


    最后发现是qpidd编译的时候没有找到qpid-proton,导致amqp1.0协议不支持(莫非rabbitmq也不支持1.0?只能后面再研究了)


    具体错误为:

    cmake ..

    -- Could NOT find Proton: found neither ProtonConfig.cmake nor proton-config.cmake (Required is at least version "0.5")

    -- Qpid proton not found, amqp 1.0 support not enabled   


    参考大神们的解释:


   http://mail-archives.apache.org/mod_mbox/qpid-users/201305.mbox/%[email protected]%3E


http://mail-archives.apache.org/mod_mbox/qpid-users/201305.mbox/%[email protected]%3E

The module for AMQP 1.0 support for the broker (i.e. qpidd) is amqp.so 
(amqpc.so is the module for adding AMQP 1.0 support to the c++ 
implementation of the qpid::messaging API).

I.e. you want: qpidd --load-module /path/to/amqp.so

If you are using the cmake based build, the modules should be under src 
in the build tree. If they are not, that suggests that the proton 
dependency was not found. You should see something in the cmake output 
about that and yourCMakeCache.txt should contain something like:

   //Build with support for AMQP 1.0
   BUILD_AMQP:BOOL=ON

If you are using the autoconf based build then you need to specify 
--with-proton to enable compilation of the 1.0 components (they will 
then be found in src/.libs in the build tree).


http://markmail.org/message/fkhknzzejbvzgzha
Subject:	Re: messenger to qpidd barfs with: ERROR[-2] SASL header mismatch: 'AMQP\x01\x01\x00\x0a'	permalink
From:	Robbie Gemmell ([email protected])
Date:	Jan 12, 2014 8:57:54 am
List:	org.apache.incubator.qpid-users
You look to be seeing the AMQP 0-10 handshake returned from the qpidd,
which would appear to be the broker is saying 'I dont support 1.0, try
using 0-10'.

Just because something was built doesnt mean it is actually in use. The
info at http://svn.apache.org/repos/asf/qpid/trunk/qpid/cpp/AMQP_1.0 could
be out of date, but it says:
"To enable 1.0 support in qpidd, the amqp module must be loaded. This
allows the broker to recognise the 1.0 protocol header alongside the 0-10
one. If installed, the module directory should be configured such that this
happens automatically. If not, use the --load-module option and point to
the amqp.so module."

1.0 support is enabled by default on the Java broker; not configuring any
specific supported protocols mean that they are all supported (0-8 / 0-9 /
0-9-1 / 0-10 / 1.0). The docs mostly talk about the UI because it the
primary means of configuring the broker, though obviosuly nothing is
stopping you hand editing the config if you like. Connection refused sounds
like it might be something other than just the protocol version not being
enabled though, if it wasnt the Java broker should really behave much like
qpidd did and respond with a supported protocol version.

As Rob has juat beaten me to syaing, you will need to authenticate against
the Java broker (or perhaps change the broker configuration to support
anonymous by creating an anonymous auth providerand setting the port to use
it, noting the requirement to restart the broker:
http://qpid.apache.org/releases/qpid-0.24/java-broker/book/Java-Broker-Security.html#Java-Broker-Security-Authentication-Providers
).

http://markmail.org/message/fkhknzzejbvzgzha
Subject:	Re: messenger to qpidd barfs with: ERROR[-2] SASL header mismatch: 'AMQP\x01\x01\x00\x0a'	permalink
From:	Robbie Gemmell ([email protected])
Date:	Jan 12, 2014 8:57:54 am
List:	org.apache.incubator.qpid-users
You look to be seeing the AMQP 0-10 handshake returned from the qpidd,
which would appear to be the broker is saying 'I dont support 1.0, try
using 0-10'.


Just because something was built doesnt mean it is actually in use. The
info at http://svn.apache.org/repos/asf/qpid/trunk/qpid/cpp/AMQP_1.0 could
be out of date, but it says:
"To enable 1.0 support in qpidd, the amqp module must be loaded. This
allows the broker to recognise the 1.0 protocol header alongside the 0-10
one. If installed, the module directory should be configured such that this
happens automatically. If not, use the --load-module option and point to
the amqp.so module."


1.0 support is enabled by default on the Java broker; not configuring any
specific supported protocols mean that they are all supported (0-8 / 0-9 /
0-9-1 / 0-10 / 1.0). The docs mostly talk about the UI because it the
primary means of configuring the broker, though obviosuly nothing is
stopping you hand editing the config if you like. Connection refused sounds
like it might be something other than just the protocol version not being
enabled though, if it wasnt the Java broker should really behave much like
qpidd did and respond with a supported protocol version.


As Rob has juat beaten me to syaing, you will need to authenticate against
the Java broker (or perhaps change the broker configuration to support
anonymous by creating an anonymous auth providerand setting the port to use
it, noting the requirement to restart the broker:
http://qpid.apache.org/releases/qpid-0.24/java-broker/book/Java-Broker-Security.html#Java-Broker-Security-Authentication-Providers
).


  

PS:

https://cwiki.apache.org/confluence/display/qpid/faq#FAQ-IsQpidAMQPCompliant?


你可能感兴趣的:(qpid 记录)