Naushad Warsi
Naushad Warsi

Reputation: 89

What is the deal with LinkName?

I am new to AMQP trying to understand the concept so my question might be very naive.

I am sending message to ActiveMQ Broker and while sending the message, I have to mention LinkName but that doesn't matter what I am putting at consumer side and producer side I am receiving the data anyway.

I am confused what is the deal with LinkName?

Upvotes: 2

Views: 458

Answers (1)

Justin Bertram
Justin Bertram

Reputation: 35028

I can't really state it any better than section 2.6.1 of the AMQP 1.0 specification:

2.6.1 Naming A Link

Links are named so that they can be recovered when communication is interrupted. Link names MUST uniquely identify the link amongst all links of the same direction between the two participating containers. Link names are only used when attaching a link, so they can be arbitrarily long without a significant penalty.

A link’s name uniquely identifies the link from the container of the source to the container of the target node, i.e., if the container of the source node is A, and the container of the target node is B, the link can be globally identified by the (ordered) tuple (A,B,<name>). Consequently, a link can only be active in one connection at a time. If an attempt is made to attach the link subsequently when it is not suspended, then the link can be ’stolen’, i.e., the second attach succeeds and the first attach MUST then be closed with a link error of stolen. This behavior ensures that in the event of a connection failure occurring and being noticed by one party, that re-establishment has the desired effect.

Upvotes: 3

Related Questions