Versions Compared

Key

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

...

If the Detach has close=true*the queue associated with the link is

  • If the queue has no consumers, the queue is deleted and the Link is Detached
  • else the Link is detached with error(resource-locked)

Pseudo Code

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

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 = name space derived from container-id
                queue_name = get_queue_name(
                                name_space,
                                subscription_name,
                                Source 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
        else
                // name_space and subscription_name are derived as above just from Link capabilities instead of Source capabilities
                queue_name = get_queue_name(
                                        name_space,
                                        subscription_name,
                                        TRUE_DURABILITY)
                if queue exists
                        ifAttach queueLink haswith consumers
correct Source set
                else
              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