如何通过 JMS 向 WebSphere MQ 发送大消息?
IBM WebSphere MQ JMS 接口的内置限制为 2 MB。
http://www-01.ibm.com/support/docview.wss ?uid=swg21221260
有没有办法绕过这个限制?
There is a built in limitation of 2 MB for the IBM WebSphere MQ JMS interface.
http://www-01.ibm.com/support/docview.wss?uid=swg21221260
Is there a way to bypass that limitation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该限制早在多年前就适用于随 WAS 分发的 WMQ 版本 V5.1.1。如果这是问题,升级到当前版本的 WMQ 将解决它。 WMQ当前版本是V7.0.1。 V6.0.2 仍然有效,但将于 2012 年 9 月停止服务。 V7 可以发送和接收高达 100MB 的消息,但 WMQ 本身默认为 4MB。如果需要大于 4MB 的消息,则有必要调整 QMgr、队列和通道的参数,但 JMS 在现代版本中不受限制。
WMQ Java/JMS 手册没有具体提及最大大小,因为它与本机 WMQ 最大长度 100MB 相同。但是,WMQ V6 性能报告 提供了 JMS 消息的基准至 64MB。
无论是什么阻止您放入 3MB 消息,都不是 WMQ 的 JMS 实现在消息大小方面的限制。如果您检查了所有通道和队列以及 QMgr 上的 MAXMSGL,那么它不太明显,但它是配置。
The limitation applied to WMQ versions distributed with WAS back at V5.1.1 many years ago. If this is the problem, upgrading to current version of WMQ will resolve it. The current version of WMQ is V7.0.1. V6.0.2 is also still current but will be out of service in September of 2012. V6 & V7 can send and receive messages up to 100MB but WMQ itself defaults to 4MB out of the box. It is necessary to tune parameters of the QMgr, queues and channels if messages larger than 4MB are required but JMS is not a limitation at modern versions.
The WMQ Java/JMS manuals do not specifically mention a maximum size because it is the same as the native WMQ max length of 100MB. However, the WMQ V6 Performance Report provides benchmarks for JMS messages up to 64MB.
Whatever is preventing you from putting a 3MB message isn't a limitation of WMQ's JMS implementation as regards message size. If you have checked MAXMSGL on all of the channels and queues and the QMgr then it's something less obvious but it is configuration.
这听起来可能很困难,但它是一个解决方案:
例如,
在接收方,您可以实现一个选择器,以便在收到第一条消息后立即获取组中的所有消息。检索组中的所有消息(希望您能获取所有消息),对它们进行正确排序,重新创建大字节数组,对其进行解组,然后就完成了。
真的微不足道......
这是一个 更好的示例 。
This might sound arduous, but it is a solution:
e.g.
On the receiver side, you implement a selector to get all the messages in the group as soon as you receive the first message. Retrieve all the messages in the group (hopefully you get them all), sort them correctly, re-create the big byte array, unmarshall it, and you're done.
Trivial really.....
Here's a better example.