Java 和 MSMQ
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/506022/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Java and MSMQ
提问by Andy White
I was curious if anyone had any suggestions on a Java library that provides access to MSMQ? I've downloaded the trial of the J-Integra Java-COM library and have built and run their MSMQ example app, but I was curious if there were any good (free :)) alternatives. I've run across a few JNI implementations like jMSMQ and a few others, but I'd rather avoid JNI if possible.
我很好奇是否有人对提供对 MSMQ 的访问的 Java 库有任何建议?我已经下载了 J-Integra Java-COM 库的试用版,并构建并运行了他们的 MSMQ 示例应用程序,但我很好奇是否有任何好的(免费 :))替代方案。我遇到过一些 JNI 实现,比如 jMSMQ 和其他一些,但如果可能的话,我宁愿避免使用 JNI。
We've also investigated some .NET<->JMS interop solutions like JNBridge (with ActiveMQ). I think our company has decided to centralize our queueing in MSMQ however, so that would be our ideal solution.
我们还研究了一些 .NET<->JMS 互操作解决方案,例如 JNBridge(使用 ActiveMQ)。我认为我们公司已经决定将我们的队列集中在 MSMQ 中,所以这将是我们理想的解决方案。
We are hoping to use WCF (netMsmq or msmqIntegration) on the .NET side. I'm a little concerned about how the java side will deal with the WCF messages (binary encoding), but there should be options there (customBinding with text encoding and MSMQ transport?), so I'm not too worried about that. Mostly worried about getting access to MSMQ in Java.
我们希望在 .NET 端使用 WCF(netMsmq 或 msmqIntegration)。我有点担心 java 端将如何处理 WCF 消息(二进制编码),但那里应该有选项(customBinding 与文本编码和 MSMQ 传输?),所以我不太担心。主要担心在 Java 中访问 MSMQ。
Our other option is to just put a thin web-service layer at the input end of each queue, and achieve interop that way. Performance is a little bit of a concern there, however.
我们的另一个选择是在每个队列的输入端放置一个薄的 Web 服务层,并以这种方式实现互操作。然而,那里的性能有点令人担忧。
Any suggestions? Thanks a lot for anyone's time.
有什么建议?非常感谢任何人的时间。
采纳答案by Jan Kronquist
As far as I understand J-Integra is the only pure Java implementation of MSMQ, ie this is the only alternative if you are not running on Windows. (Please let me know if there are other alternatives!)
据我所知,J-Integra 是 MSMQ 的唯一纯 Java 实现,也就是说,如果您不在 Windows 上运行,这是唯一的选择。(如果有其他选择,请告诉我!)
Apache Camel and other uses JNI to access the Windows API (DLL files) which obviously means that is only works on Windows.
Apache Camel 和其他使用 JNI 来访问 Windows API(DLL 文件),这显然意味着它只适用于 Windows。
I am currently trying out the code provided here http://www.codeplex.com/MsmqJavawhich seems simple to use, but I'm not really sure how transactions work.
我目前正在尝试这里提供的代码http://www.codeplex.com/MsmqJava,它看起来很容易使用,但我不确定事务是如何工作的。
回答by Cheeso
回答by Pavel Savara
回答by prashant thakre
You can also try the http://javamsmq.codeplex.com/which is also provide a complete solution of MSMQ JAVA interoperability.As well this having Unicode ASCII all functionality.In other dll based open source having memory leakage problem like crashing of application.But this open source don't having any memory leakage problem.
您还可以尝试http://javamsmq.codeplex.com/,它也提供了 MSMQ JAVA 互操作性的完整解决方案。此外,它还具有 Unicode ASCII 所有功能。在其他基于 dll 的开源中存在内存泄漏问题,例如应用程序崩溃.但是这个开源没有任何内存泄漏问题。
回答by laz
Update: This answer no longer applies per comment:
更新:此答案不再适用于每条评论:
Camel msmq component is discontinued : fusesource.com/forums/thread.jspa?messageID=6040
Camel msmq 组件已停产: fusesource.com/forums/thread.jspa?messageID=6040
You might take a look at how Apache Camel does it: Apache Camel: msmq
你可以看看 Apache Camel 是如何做到的:Apache Camel: msmq

