Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

No Format
if Link does not exists
        if Source is set
                if Source has SHARED capability
                        subscription_name = Link name up to (excluding) “|”
                        exclusivity_policy = “SHARED”
                else
                        subscription_name = Link name
                        exclusivity_policy = “LINK”
                if Source has GLOBAL capability
                        name_space = global name space
                else
                        name_space = container-id name space
                name = get_queue_name(
                                name_space,
                                subscription_name,
                                Source Durability)
                if queue with name exists
                        if has same exclusivity_policy
                                if different binding key or filter
                                        if no consumer
                                                rebind queue
                                        else
                                                error(resource-locked)
                        else
                                error(resource-locked)
                else
                        create_queue(
                                queue_name
                                exclusivity_policy,
                                Source Durability,
                                Source Expiry Policy)
                        bind queue
                send Attach
        else
                queue_name = get_queue_name(
                                        name_space,
                                        subscription_name,
                                        TRUE_DURABILITY)
                if queue exists
                        if queue has consumers
                                error(resource-locked) // This breaks the AMQP spec
                        else
                                delete queue
                                Attach Link with null Source
                else
                        error(not-found) // This breaks the AMQP spec                           
else
        queue_name = get_queue_name(
                                name_space,
                                subscription_name,
                                TRUE_DURABILITY)
        if queue exists
                if has same exclusivity_policy
                        if different binding key or filter
                                if no consumer
                                        rebind queue
                                else
                                        error(resource-locked)
                else
                        error(resource-locked)
        else
                create_queue(
                        queue_name
                        exclusivity_policy,
                        Source Durability,
                        Source Expiry Policy)
                bind queue
        send Attach

 

If link exists and the queue exists see the instructions for the existing queue for SHARED=YES.

If link exists and the queue does not exist, recreate a queue as described in corresponding instructions above.

 

 

The above described behaviour results in the following pseudo code. Where the below differs from the above the above is considered normative:

 

if Link does not exists

if Source is set

if Source has SHARED capability

subscription_name = Link name up to (excluding) “|”

exclusivity_policy = “SHARED”

else

subscription_name = Link name

exclusivity_policy = “LINK”

if Source has GLOBAL capability

name_space = global name space

else

name_space = container-id name space

name = get_queue_name(

name_space,

subscription_name,

Source Durability)

if queue with name exists

if has same exclusivity_policy

if different binding key or filter

if no consumer

rebind queue

else

error(resource-locked)

else

error(resource-locked)

else

create_queue(

queue_name

exclusivity_policy,

Source Durability,

Source Expiry Policy)

bind queue

send Attach

else

queue_name = get_queue_name(

name_space,

subscription_name,

TRUE_DURABILITY)

if queue exists

if queue has consumers

error(resource-locked) // This breaks the AMQP spec

else

delete queue

Attach Link with null Source

else

error(not-found) // This breaks the AMQP spec

else

queue_name = get_queue_name(

name_space,

subscription_name,

TRUE_DURABILITY)

if queue exists

if has same exclusivity_policy

if different binding key or filter

if no consumer

rebind queue

else

error(resource-locked)

else

error(resource-locked)

else

 create_queue(

queue_name

exclusivity_policy,

Source Durability,

Source Expiry Policy)

bind queue

send Attach

 

TODO: Attach with null Source from an AMQP perspective should not error with resource-locked or not-found. The JMS mapping seems to require this.