数据队列大小限制 - 从 iSeries 到 Java 的通信
我的数据队列对象有问题。我通过 Java 中的数据队列对象向 iSeries 程序(又名 AS400)发送消息。我可以写入 iSeries 并读取响应,但问题是数据队列的大小是由我之前发送的消息的大小定义的,因此,当我收到答案时,它已被截断为请求消息和我丢失的信息。我该如何解决这个问题?谁能帮助我吗?我正在使用 JTOpen 库。
谢谢
I'm having a problem with the Data Queue object. I'm sending messages to an iSeries program (aka AS400) through a Data Queue object in Java. I can write to the iSeries and read the response but the problem is that the size of the Data Queue is defined by the size of the message that I sent previously, so, when I receive the answer, this has been truncated to the size of the request message and I loose information. How can I resolve this? Can anyone help me? I'm using JTOpen library.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不管它是如何创建的,数据队列都有一个“最大条目长度”。这是在 CL 的
CRTDTAQ
命令上指定的,或者在使用 JTOpen 设置 DataQueue 对象时在create
方法调用中指定的。如果您计划通过数据队列发送不同长度的消息,则需要创建“最大条目长度”大于或等于实际最大条目长度的数据队列。否则,您可能会冒着将某些东西放在一端并在从另一端出来时被截断的风险。
这里的 Javadoc 展示了如何
从 JTOpen 创建数据队列。
Regardless of how it's being created, a data queue has a "maximum entry length". This is specified on the
CRTDTAQ
command from CL or in thecreate
method call if setting up the DataQueue object using JTOpen.If you're planning to send messages of different lengths through a data queue, you need to create the data queue with a "maximum entry length" greater than or equal to your actual maximum entry length. Otherwise you risk putting something in one end and having it be truncated when it comes out the other side.
Here's the Javadoc that shows how you can
create
a data queue from JTOpen.您愿意考虑替代解决方案吗?我们在类似情况下使用的方法是通过没有大小限制的用户空间(AS/400 上的对象类型 USRSPC)传递请求/响应消息的内容。好吧,如果我没记错的话,大约是 16GB...用户空间的固定大小名称依次通过 AS/400 服务器和 Java 客户端之间的数据队列 (DTAQ) 传递。
Would you be open to consider an alternative solution? The approach we used in a similar situation was to pass the content of request/response messages through user spaces (object type USRSPC on AS/400) which don't have size limitations. Well, its ~16GB if I remember correctly... Fixed size names of the user spaces, in turn, were passed through a data queue (DTAQ) between AS/400 server and Java clients.