gpt4 book ai didi

java - JMS CreateQueue 问题

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:59:05 25 4
gpt4 key购买 nike

我有一个关于 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com