我正在开发一个 Azure Service Fabric 项目,该项目使用 Apache.NMS .NET 库从 ActiveMQ 读取消息,并创建持久的消费者以从 ActiveMQ 中读取特定消息。
我能够阅读该消息并且一切正常,但我收到如下警告。
'System.RAP' reported Warning for property 'IStatelessServiceInstance.OpenDuration'. The api IStatelessServiceInstance.Open on node _Node_0 is stuck.
此警告会导致服务出错,因此我需要删除该警告。
任何人为什么它给我警告。
这是我如何阅读消息的快照。
try
{
ITopic dest = AMQSession.GetTopic(TopicName);
using (IMessageConsumer consumer = AMQSession.CreateDurableConsumer(dest, SubscriptionName, MessageSelector, false))
{
IMessage message;
while ((message = consumer.Receive()) != null)
{
ITextMessage txtMsg = message as ITextMessage;
}
}
}
catch (Exception ex)
{
Close();
}
finally
{
Close();
}