开发者

How do I create a queue browser (preview not consume) in C# for an ActiveMQ queue?

I'm using the NMS API for reading/writing ActiveMQ in C#, and I cannot find a way to preview the messages on a queue. I could read and rollback - b开发者_Python百科ut that'll make them DLQ eventually.

In my previous life, TIBCO had a QueueBrowser object that could be used, and I think JMS had IQueueBrowser as well. I cannot find an ActiveMQ .NET equivalent.


Unfortunately, NMS does not have support (at least not yet) for the QueueBrowser API available in JMS from Java. Take a look at Issue AMQNET-97 in the ActiveMQ.NET issue tracker database-- the team is looking for contributors to implement this feature.

BTW, you're not the only one asking for this-- here's another thread on the same topic.

At first I was hoping that Spring.NET's JMS support (for TIBCO) would also include ActiveMQ support QueueBrowser. Unfortunately, this isn't the case-- according to the Spring.NET documentation, only TIBCO is supported via Spring.NET's JMS API:

Note that JMS support is currently provided only for TIBCO's JMS implementation named TIBCO Enterprise Message Service (EMS). There is no fundamental reason why other vendors are not supported. It has just been a practical reason at this time since there isn’t a de facto JMS API in .NET that each vendor is required to implement. As such, each vendor ends up creating their own .NET inspired copy of the Java JMS API. The open source project .Net Message Service API (NMS) goal is to provide such a common API and it will very likely be used for future JMS work in Spring.NET.

So, in conclusion, unless you're willing to code in Java (or call into java libraries using one of the .NET-to-Java interop mechanisms), I don't think it will be easy for you to to get at QueueBrowser in the short term, although long-term this feature will probably make it into NMS at some point.


Actually, ActiveMQ supports JMX so you might be able to build one using a .NET JMX library (google netMX for this)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜