Hi Igor,
The Qpid broker allows to create exclusive queues with one of below
exclusivity policies:
LINK; only one receiving link can consumer from the queue
SESSION; only consumers from one session can consume
CONNECTION; only consumers from one connection can consume
CONTAINER; only consumers from one container can consume
PRINCIPAL; only consumers with the specific username can consume
SHARED_SUBSCRIPTION; used by JMS 2.0 shared subscribers
NONE; non exclusive queue, the default policy.
The exclusive queues mainly created from JMS clients. The explicit creation
of exclusive queue from Web UI has not been actually requested before.
That's why UI does not have an option to create an exclusive queue.
You can still create exclusive queue using REST API. As you already
noticed, there is queue attributes "exclusive" which is used for specifying
queue exclusivity.
The policy you need is LINK. Thus, you need to set value of "exclusive"
attribute to "LINK" in queue creation request, for example,
curl --user guest:guest -X PUT -d '{"durable":true,"exclusive":"LINK"}'
https://localhost:8443/api/v7.1/queue/default/default/exclusive-queue
The above will create durable and exclusive queue on virtual host
"default". (Durable is true by default, you can skip specifying durable.)
An attempt to attach second consumer to the queue above will result in
exception like the one below
[1365383557:1] ->
Attach{name='qpid-jms:receiver:ID:21f3ce64-381e-4bc9-9610-91fc21ceb63e:1:1:2:exclusive-queue',
handle=2, role=RECEIVER, sndSettleMode=UNSETTLED, rcvSettleMode=FIRST,
source=Source{address='exclusive-queue', durable=NONE,
expiryPolicy=LINK_DETACH, timeout=0, dynamic=false,
dynamicNodeProperties=null, distributionMode=null, filter=null,
defaultOutcome=Modified{deliveryFailed=true, undeliverableHere=null,
messageAnnotations=null}, outcomes=[amqp:accepted:list, amqp:rejected:list,
amqp:released:list, amqp:modified:list], capabilities=[queue]},
target=Target{address='null', durable=NONE, expiryPolicy=SESSION_END,
timeout=0, dynamic=false, dynamicNodeProperties=null, capabilities=null},
unsettled=null, incompleteUnsettled=false, initialDeliveryCount=null,
maxMessageSize=null, offeredCapabilities=null, desiredCapabilities=null,
properties=null}
[1365383557:1] <-
Attach{name='qpid-jms:receiver:ID:21f3ce64-381e-4bc9-9610-91fc21ceb63e:1:1:2:exclusive-queue',
handle=2, role=SENDER, sndSettleMode=MIXED, rcvSettleMode=FIRST,
source=null, target=null, unsettled=null, incompleteUnsettled=false,
initialDeliveryCount=null, maxMessageSize=null, offeredCapabilities=null,
desiredCapabilities=null, properties=null}
[1365383557:1] <- Detach{handle=2, closed=true,
error=Error{condition=amqp:resource-locked, description='Cannot add an
exclusive consumer to the destination as there is an incompatible
exclusivity policy', info=null}}
2019-01-26 10:18:58,544 [localhost:5672]] - WARN
AmqpResourceBuilder - Open of resource:(JmsConsumerInfo: {
ID:21f3ce64-381e-4bc9-9610-91fc21ceb63e:1:1:2, destination =
exclusive-queue }) failed: Cannot add an exclusive consumer to the
destination as there is an incompatible exclusivity policy [condition =
amqp:resource-locked]
[1365383557:1] -> Detach{handle=2, closed=true, error=null}
Caught exception, exiting.
javax.jms.JMSException: Cannot add an exclusive consumer to the destination
as there is an incompatible exclusivity policy [condition =
amqp:resource-locked]
As for specifying groups and users on BDB HA virtual host, the Qpid broker
does not allow you that. Potentially you can work around this limitation by
using LDAP authentication provider with groups stored on LDAP side.
Kind Regards,
Alex
On Fri, 25 Jan 2019 at 15:16, Igor Natanzon <[email protected]> wrote:
Java Broker 7.1, JMS Client 0.40, running on Linux
1. I am trying to find how to create a queue as an exclusive /
no-auto-delete. Is that feature available with latest versions of Java
broker? The queue description in the management console has a tag for
Exclusive but I found no way of actually setting it. My goal is setting up
an exclusive consumer on a particular queue (where message consumption
ordering is critical), to prevent accidental startup of another consumer
(its really more of an exclusive consumer tag, similar to max-consumers = 1
setting in Artemis). With custom applications I can achieve similar
functionality using JMSXGroupID, but with vendor applications that cannot
set the header value, I need a more application-agnostic approach.
2. I am configuring Qpid with a 3-node replicated cluster, which seems to
work really well, and queue / exchange configuration changes are nicely
propagated to other nodes in the cluster. However, user / group / acl
setups are local to a specific node. Is there a way to export all that
configuration from one node and import to another? I know I can do it with
ACL roles, but not with users and groups. I want to avoid tedious setup if
I want to add another node to the cluster.
Thanks!