使用 java api 从消息代理 bar 文件中检索属性值
我正在尝试从消息代理创建的 bar 文件中读取属性值。
我想通过java来做到这一点。 API 位于:http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fbe43410_.htm
但是,我只能弄清楚如何使用部署描述符获取属性的名称而不是它们的值。我可以看到如何覆盖属性所具有的值,但再一次,不知道如何检索该值。换句话说,我只能看到如何写入该属性,而不能从中读取。我想两者都做!叫我贪婪吧;)
如果我使用基于命令行的实用程序:http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft。 doc%2Faf03900_.htm
我可以毫无问题地获取属性值。
但如果可能的话,我想通过java获取它们。
预先感谢您对此的任何帮助!
I'm trying to read the property values from a bar file created by message broker.
I want to do this via java. The api is here: http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fbe43410_.htm
However, I can only figure out how to get the names of the properties NOT THEIR VALUES by using the deployment descriptor. I can see how to override the value that a property has, but once again, not how to retrieve the value. Another words I can see only how to write to the property not read from it. I want to do both! Call me greedy ;)
If I use the command line based utility: http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Faf03900_.htm
I can get the property values no problem.
But I want to get them via java if at all possible.
Thanks in advance for any help on this!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题是我误解了部署描述符的工作原理。我认为当 java API 引用覆盖的属性时,它意味着在我的 java 代码中被覆盖的属性。但它实际上意味着 bar 文件中具有值的所有属性。
话虽这么说,获取价值观并不是一件容易的事。您必须获取所有标识符,然后将它们传递给 getOverride();
或使用以下内容仅列出具有值的属性
The problem was I was misunderstanding how the deployment descriptor worked. I thought that when the java API referred to overridden properties it meant ones that were over ridden in my java code. But it actually meant all the properties that had a value in the bar file.
That being said getting the values is not strait forward. You have to get all the identifiers and then pass them to getOverride();
or use the following to only list properties that have values
由于某些原因,如果设置没有被覆盖或没有更改,则不会将其写入文件。(原因是没有必要保留属性的默认值:)),因此获取属性的方法是了解它们的默认值。但如果您能够连接到代理并使用
已部署的 .bar 中的方法读取属性,我建议您使用 com.ibm.mq.jar 库。
For some reason settings are not written to file, if they are not overriden or not changed.(the reason is the lack of necessity to keep the property's default value:) ) so the way to get the properties is to know their default values. But I would recommend you to use
com.ibm.mq.jar
library if you're able to connect to broker to read properties using methodfrom already deployed .bar.