java - JMS CreateQueue 问题

标签 java jms ibm-mq

我有一个关于 JMS createQueue 方法的一般性问题。在 WebSphere MQ 中,此方法是否用作 JNDI 查找的替代方法?我在想我可以动态地创建一个队列。这可能吗?谢谢。

最佳答案

假设您的意思是 QueueSession.createQueue,这是一个非常具有误导性的方法,并且不会按照您的想法行事:

Creates a queue identity given a Queue name.

This facility is provided for the rare cases where clients need to dynamically manipulate queue identity. It allows the creation of a queue identity with a provider-specific name. Clients that depend on this ability are not portable.

Note that this method is not for creating the physical queue. The physical creation of queues is an administrative task and is not to be initiated by the JMS API. The one exception is the creation of temporary queues, which is accomplished with the createTemporaryQueue method.

JMS API 不提供动态创建队列的方法(除非您指的是临时队列,这是请求-响应消息传递使用的一种非常不同的野兽)。如果您想在运行时创建队列,那将是 WebSphere 专有的。

关于java - JMS CreateQueue 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1455759/

相关文章:

java - 使用 newSingleThreadScheduledExecutor 调度多个任务

java - 解码数组不会给我任何值

jms - 如何根据消息头属性只读取特定的队列消息

c# - .Net 和 IBM MQ 托管连接 SSL 使用 pfx ca cert

java - IBM MQ 消息监听器

java - 如何使用 Jaxb 加载完整包

java - 如何强制泛型类型参数成为接口(interface)?

java - JMS奇怪的问题

java - 发送 JMS 消息的单元测试代码

ibm-mq - 当我通过基于 Java 的客户端程序发送消息时,为什么我的 WebSphere MQ(在 Windows 上)API Exit 没有记录任何内容?