简体   繁体   English

Apache.NMS.AMQP 2.0.0 库在发布时抛出 org.apache.qpid.proton.amqp.UnsignedByte cannot be cast to java.lang.byte 错误

[英]Apache.NMS.AMQP 2.0.0 library when publishing is throwing org.apache.qpid.proton.amqp.UnsignedByte cannot be cast to java.lang.byte error

I am using Apache.NMS.AMQP library in our .netcore 5 project.我在我们的 .netcore 5 项目中使用 Apache.NMS.AMQP 库。 We connect to Apache ActiveMQ Artemis as a middle layer for the event driven architecture using AMQP protocol.我们使用 AMQP 协议连接到 Apache ActiveMQ Artemis 作为事件驱动架构的中间层。

There is no issue in consuming messages from the same amqp protocol;从同一个 amqp 协议中消费消息没有问题; but when publishing to a topic, we are getting some errors.但是当发布到一个主题时,我们会遇到一些错误。

broker URI:经纪人 URI:

failover:(amqp://localhost:5672)?transport.startupMaxReconnectAttempts=1&transport.randomize=false

Code:代码:

var _factory = new Apache.NMS.AMQP.ConnectionFactory(_connectURI);

IConnection connection = _factory.CreateConnection(username,password);
ISession session = connection.CreateSession(AcknowledgementMode.AutoAcknowledge);

ITextMessage msg = session.CreateTextMessage(stringMessage);
var topicDestination = SessionUtil.GetTopic(session, topic);
connection.Start();`

IMessageProducer publisher = session.CreateProducer(topicDestination);
publisher.DeliveryMode = MsgDeliveryMode.Persistent;
publisher.Send(msg);

Error that I'm getting:我得到的错误:

Message ID: xxxx:2:1:1-1 rejected, Description = org.apache.qpid.proton.amqp.UnsignedByte cannot be cast to java.lang.byte消息 ID:xxxx:2:1:1-1 被拒绝,描述 = org.apache.qpid.proton.amqp.UnsignedByte 无法转换为 java.lang.byte

I tried several combinations of sending the same from different methods, added Apache.NMS library on top of it as well.我尝试了几种从不同方法发送相同内容的组合,还在其上添加了 Apache.NMS 库。 But still no luck.但仍然没有运气。

Anyone have come across this issue?有人遇到过这个问题吗?

I have used amq broker 7.10 and the issue is sorted in the broker.我使用了 amq broker 7.10,问题在 broker 中得到了解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM