使用RabbitMQ C#和AMQ/QPID&;WSO2消息代理扇出交换

使用RabbitMQ C#和AMQ/QPID&;WSO2消息代理扇出交换,rabbitmq,wso2,amqp,wso2carbon,qpid,Rabbitmq,Wso2,Amqp,Wso2carbon,Qpid,我正在使用RabbitMQ 2.8.7 DotNet客户端和WSO2 MB 3.2.1。 我的部署环境是Win7 R1 64位或Win Server 08 R2 64位。 我遇到了与Exchange的多个连接问题,即流式传输到多个使用者的数据会在间歇时间丢失。我们已尝试将WSO2 MB更新为3.2.3并将exchange更改为扇出以解决此连接丢失问题,但遇到了问题 “似乎”这个链接有点相关: 我首先想知道这是否是正确的方法 其次,我想了解我们在运行时使用扇出时收到的当前错误,因为我们无法访问数

我正在使用RabbitMQ 2.8.7 DotNet客户端和WSO2 MB 3.2.1。 我的部署环境是Win7 R1 64位或Win Server 08 R2 64位。 我遇到了与Exchange的多个连接问题,即流式传输到多个使用者的数据会在间歇时间丢失。我们已尝试将WSO2 MB更新为3.2.3并将exchange更改为扇出以解决此连接丢失问题,但遇到了问题

“似乎”这个链接有点相关:

我首先想知道这是否是正确的方法

其次,我想了解我们在运行时使用扇出时收到的当前错误,因为我们无法访问数据。下面是收到的错误、WSO2 MB日志输出&来自生产者的代码片段

请告知是否需要更多信息来确定

收到错误

 "Unhandled Exception:
RabbitMQ.Client.Exceptions.OperationInterruptedException: The AMQP operation
was interrupted: AMQP close-reason, initiated by Peer, code=504, text="org.apache.qpid.AMQSecurityException: Permission denied: binding
[error code 403: access refused]", classId=50, methodId=20, cause=
   at RabbitMQ.Client.Impl.SimpleBlockingRpcContinuation.GetReply()
   at RabbitMQ.Client.Impl.ModelBase.ModelRpc(MethodBase method, ContentHeaderBase header, Byte[] body)
   at RabbitMQ.Client.Framing.Impl.v0_9_1.Model._Private_QueueBind(String queue,
 String exchange, String routingKey, Boolean nowait, IDictionary arguments)
   at RabbitMQ.Client.Impl.ModelBase.QueueBind(String queue, String exchange, String routingKey, IDictionary arguments)
   at RabbitMQ.Client.Impl.ModelBase.QueueBind(String queue, String exchange, String routingKey)
   at Send.Main()
日志@出错时间

INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,042] DEBUG {org.apache.qpid.server.protocol.AMQProtocolEngine} -  Frame Received: Frame channelId: 0, bodyFrame: [ConnectionStartOkBodyImpl: clientProperties={platform=[LONG_STRING: .NET], product=[LONG_STRING: RabbitMQ], capabilities=[FIELD_TABLE: {publisher_confirms=[BOOLEAN: true], exchange_exchange_bindings=[BOOLEAN: true], consumer_cancel_notify=[BOOLEAN: true], basic.nack=[BOOLEAN: true]}], copyright=[LONG_STRING: Copyright (C) 2007-2012 VMware, Inc.], information=[LONG_STRING: Licensed under the MPL.  See http://www.rabbitmq.com/], (http://www.rabbitmq.com/%5D,) version=[LONG_STRING: 0.0.0.0]}, mechanism=PLAIN, response=[0, 115, 118, 99, 46, 114, 105, 46, 97, 116, 99, 0, 112, 97, 115, 115, 119, 111, 114, 100], locale=en_US]
INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,042]  INFO {org.apache.qpid.server.handler.ConnectionStartOkMethodHandler} -  SASL Mechanism selected: PLAIN
INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,042]  INFO {org.apache.qpid.server.handler.ConnectionStartOkMethodHandler} -  Locale selected: en_US
INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,681]  INFO {org.apache.qpid.server.handler.ConnectionStartOkMethodHandler} -  Connected as: svc.abc.def
INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,681]  INFO {org.apache.qpid.server.handler.ConnectionStartOkMethodHandler} -  Framesize set to 65535
INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,681] DEBUG {org.apache.qpid.server.protocol.AMQProtocolEngine} -  Frame Received: Frame channelId: 0, bodyFrame: [ConnectionTuneOkBodyImpl: channelMax=256, frameMax=65535, heartbeat=0]
INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,681] DEBUG {org.apache.qpid.server.protocol.AMQProtocolEngine} -  Frame Received: Frame channelId: 0, bodyFrame: [ConnectionOpenBodyImpl: virtualHost=carbon, capabilities=null, insist=false]
INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,697] DEBUG {org.apache.qpid.server.protocol.AMQProtocolEngine} -  Frame Received: Frame channelId: 1, bodyFrame: [ChannelOpenBodyImpl: outOfBand=null]
INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,697]  INFO {org.apache.qpid.server.handler.ChannelOpenHandler} -  Connecting to: carbon
INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,697] DEBUG {org.apache.qpid.server.protocol.AMQProtocolEngine} -  Frame Received: Frame channelId: 1, bodyFrame: [QueueDeclareBodyImpl: ticket=0, queue=fanout, passive=false, durable=false, exclusive=false, autoDelete=false, nowait=false, arguments=null]
INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,759]  INFO {org.apache.qpid.server.handler.QueueDeclareHandler} -  Queue fanout bound to default exchange(<<default>>)
INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,759]  INFO {org.apache.qpid.server.handler.QueueDeclareHandler} -  Queue fanout declared successfully
INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,759] DEBUG {org.apache.qpid.server.protocol.AMQProtocolEngine} -  Frame Received: Frame channelId: 1, bodyFrame: [QueueBindBodyImpl: ticket=0, queue=fanout, exchange=fanout, routingKey=null, nowait=false, arguments=null]
INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,759]  INFO {org.apache.qpid.server.protocol.AMQProtocolEngine} -  Closing channel due to: org.apache.qpid.AMQSecurityException: Permission denied: binding  [error code 403: access refused]
INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,759]  INFO {org.apache.qpid.server.AMQChannel} -  No consumers to unsubscribe on channel [/192.168.1.14:56087(svc.abc.def):1]
INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,775] DEBUG {org.apache.qpid.server.protocol.AMQProtocolEngine} -  Frame Received: Frame channelId: 1, bodyFrame: [ChannelCloseOkBodyImpl: ]
INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,775]  INFO {org.apache.qpid.server.protocol.AMQProtocolEngine} -  Channel[1] awaiting closure - processing close-ok
INFO   | jvm 1    | 2013/03/01 11:29:27 | [2013-03-01 11:29:27,775]  INFO {org.apache.qpid.server.handler.ChannelCloseOkHandler} -  Received channel-close-ok for channel-id 1
INFO   | jvm 1    | 2013/03/01 11:29:29 | [2013-03-01 11:29:29,070] DEBUG {org.apache.qpid.server.protocol.AMQProtocolEngine} -  Frame Received: Frame channelId: 0, bodyFrame: [ConnectionCloseBodyImpl: replyCode=200, replyText=Connection close forced, classId=0, methodId=0]
INFO   | jvm 1    | 2013/03/01 11:29:29 | [2013-03-01 11:29:29,070]  INFO {org.apache.qpid.server.handler.ConnectionCloseMethodHandler} -  ConnectionClose received with reply code/reply text 200/Connection close forced for /192.168.1.14:56087(svc.abc.def)

在WSO2 MB中,不会为给定的任何名称动态创建交换。因此,要使用“扇出”交换进行此工作,需要在qpid-virtualhosts.xml文件中预先声明它。否则使用WSO2 MB的默认交换

您似乎没有正确声明队列需要绑定的exchange名称。如果它用于队列,则默认的exchange名称声明如下:

 ch.ExchangeDeclare("amq.direct", "direct");
如果是主题,`

 ch.ExchangeDeclare("amq.topic", "topic");
请参阅博客文章,了解如何将.Net/C#Consumer/Publisher客户端示例与WSO2 Message Broker结合使用`

 ch.ExchangeDeclare("amq.topic", "topic");