Skip to content

Commit 1ec383f

Browse files
authored
Enhance AMQP protocol guide with HTML formatting
Updated message format to include HTML pre tags to correctly handle the <br/> tags included in the samples (fix formatting of the samples)
1 parent b474df1 commit 1ec383f

1 file changed

Lines changed: 42 additions & 42 deletions

File tree

articles/service-bus-messaging/service-bus-amqp-protocol-guide.md

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -142,61 +142,61 @@ The arrows in the following table show the performative flow direction.
142142

143143
| Client | Service Bus |
144144
| --- | --- |
145-
| `--> attach(<br/>name={link name},<br/>handle={numeric handle},<br/>role=**receiver**,<br/>source={entity name},<br/>target={client link ID}<br/>)` |Client attaches to entity as receiver |
146-
| Service Bus replies attaching its end of the link |`<-- attach(<br/>name={link name},<br/>handle={numeric handle},<br/>role=**sender**,<br/>source={entity name},<br/>target={client link ID}<br/>)` |
145+
| <pre>--> attach(<br/>name={link name},<br/>handle={numeric handle},<br/>role=**receiver**,<br/>source={entity name},<br/>target={client link ID}<br/>)</pre> |Client attaches to entity as receiver |
146+
| Service Bus replies attaching its end of the link |<pre><-- attach(<br/>name={link name},<br/>handle={numeric handle},<br/>role=**sender**,<br/>source={entity name},<br/>target={client link ID}<br/>)</pre> |
147147

148148
#### Create message sender
149149

150150
| Client | Service Bus |
151151
| --- | --- |
152-
| `--> attach(<br/>name={link name},<br/>handle={numeric handle},<br/>role=**sender**,<br/>source={client link ID},<br/>target={entity name}<br/>)` |No action |
153-
| No action |`<-- attach(<br/>name={link name},<br/>handle={numeric handle},<br/>role=**receiver**,<br/>source={client link ID},<br/>target={entity name}<br/>)` |
152+
| <pre>--> attach(<br/>name={link name},<br/>handle={numeric handle},<br/>role=**sender**,<br/>source={client link ID},<br/>target={entity name}<br/>)</pre> |No action |
153+
| No action |<pre><-- attach(<br/>name={link name},<br/>handle={numeric handle},<br/>role=**receiver**,<br/>source={client link ID},<br/>target={entity name}<br/>)</pre> |
154154

155155
#### Create message sender (error)
156156

157157
| Client | Service Bus |
158158
| --- | --- |
159-
| `--> attach(<br/>name={link name},<br/>handle={numeric handle},<br/>role=**sender**,<br/>source={client link ID},<br/>target={entity name}<br/>)` |No action |
160-
| No action |`<-- attach(<br/>name={link name},<br/>handle={numeric handle},<br/>role=**receiver**,<br/>source=null,<br/>target=null<br/>)<br/><br/><-- detach(<br/>handle={numeric handle},<br/>closed=**true**,<br/>error={error info}<br/>)` |
159+
| <pre>--> attach(<br/>name={link name},<br/>handle={numeric handle},<br/>role=**sender**,<br/>source={client link ID},<br/>target={entity name}<br/>)</pre> |No action |
160+
| No action |<pre><-- attach(<br/>name={link name},<br/>handle={numeric handle},<br/>role=**receiver**,<br/>source=null,<br/>target=null<br/>)<br/><br/><-- detach(<br/>handle={numeric handle},<br/>closed=**true**,<br/>error={error info}<br/>)</pre> |
161161

162162
#### Close message receiver/sender
163163

164164
| Client | Service Bus |
165165
| --- | --- |
166-
| `--> detach(<br/>handle={numeric handle},<br/>closed=**true**<br/>)` |No action |
167-
| No action |`<-- detach(<br/>handle={numeric handle},<br/>closed=**true**<br/>)` |
166+
| <pre>--> detach(<br/>handle={numeric handle},<br/>closed=**true**<br/>)</pre> |No action |
167+
| No action |<pre><-- detach(<br/>handle={numeric handle},<br/>closed=**true**<br/>)</pre> |
168168

169169
#### Send (success)
170170

171171
| Client | Service Bus |
172172
| --- | --- |
173-
| `--> transfer(<br/>delivery-id={numeric handle},<br/>delivery-tag={binary handle},<br/>settled=**false**,,more=**false**,<br/>state=**null**,<br/>resume=**false**<br/>)` |No action |
174-
| No action |`<-- disposition(<br/>role=receiver,<br/>first={delivery ID},<br/>last={delivery ID},<br/>settled=**true**,<br/>state=**accepted**<br/>)` |
173+
| <pre>--> transfer(<br/>delivery-id={numeric handle},<br/>delivery-tag={binary handle},<br/>settled=**false**,,more=**false**,<br/>state=**null**,<br/>resume=**false**<br/>)</pre> |No action |
174+
| No action |<pre><-- disposition(<br/>role=receiver,<br/>first={delivery ID},<br/>last={delivery ID},<br/>settled=**true**,<br/>state=**accepted**<br/>)</pre> |
175175

176176
#### Send (error)
177177

178178
| Client | Service Bus |
179179
| --- | --- |
180-
| `--> transfer(<br/>delivery-id={numeric handle},<br/>delivery-tag={binary handle},<br/>settled=**false**,,more=**false**,<br/>state=**null**,<br/>resume=**false**<br/>)` |No action |
181-
| No action |`<-- disposition(<br/>role=receiver,<br/>first={delivery ID},<br/>last={delivery ID},<br/>settled=**true**,<br/>state=**rejected**(<br/>error={error info}<br/>)<br/>)` |
180+
| <pre>--> transfer(<br/>delivery-id={numeric handle},<br/>delivery-tag={binary handle},<br/>settled=**false**,,more=**false**,<br/>state=**null**,<br/>resume=**false**<br/>)</pre> |No action |
181+
| No action |<pre><-- disposition(<br/>role=receiver,<br/>first={delivery ID},<br/>last={delivery ID},<br/>settled=**true**,<br/>state=**rejected**(<br/>error={error info}<br/>)<br/>)</pre> |
182182

183183
#### Receive
184184

185185
| Client | Service Bus |
186186
| --- | --- |
187-
| `--> flow(<br/>link-credit=1<br/>)` |No action |
188-
| No action |`< transfer(<br/>delivery-id={numeric handle},<br/>delivery-tag={binary handle},<br/>settled=**false**,<br/>more=**false**,<br/>state=**null**,<br/>resume=**false**<br/>)` |
189-
| `--> disposition(<br/>role=**receiver**,<br/>first={delivery ID},<br/>last={delivery ID},<br/>settled=**true**,<br/>state=**accepted**<br/>)` |No action |
187+
| <pre>--> flow(<br/>link-credit=1<br/>)</pre> |No action |
188+
| No action |<pre>< transfer(<br/>delivery-id={numeric handle},<br/>delivery-tag={binary handle},<br/>settled=**false**,<br/>more=**false**,<br/>state=**null**,<br/>resume=**false**<br/>)</pre> |
189+
| <pre>--> disposition(<br/>role=**receiver**,<br/>first={delivery ID},<br/>last={delivery ID},<br/>settled=**true**,<br/>state=**accepted**<br/>)</pre> |No action |
190190

191191
#### Multi-message receive
192192

193193
| Client | Service Bus |
194194
| --- | --- |
195-
| `--> flow(<br/>link-credit=3<br/>)` |No action |
196-
| No action |`< transfer(<br/>delivery-id={numeric handle},<br/>delivery-tag={binary handle},<br/>settled=**false**,<br/>more=**false**,<br/>state=**null**,<br/>resume=**false**<br/>)` |
197-
| No action |`< transfer(<br/>delivery-id={numeric handle+1},<br/>delivery-tag={binary handle},<br/>settled=**false**,<br/>more=**false**,<br/>state=**null**,<br/>resume=**false**<br/>)` |
198-
| No action |`< transfer(<br/>delivery-id={numeric handle+2},<br/>delivery-tag={binary handle},<br/>settled=**false**,<br/>more=**false**,<br/>state=**null**,<br/>resume=**false**<br/>)` |
199-
| `--> disposition(<br/>role=receiver,<br/>first={delivery ID},<br/>last={delivery ID+2},<br/>settled=**true**,<br/>state=**accepted**<br/>)` |No action |
195+
| <pre>--> flow(<br/>link-credit=3<br/>)</pre> |No action |
196+
| No action |<pre>< transfer(<br/>delivery-id={numeric handle},<br/>delivery-tag={binary handle},<br/>settled=**false**,<br/>more=**false**,<br/>state=**null**,<br/>resume=**false**<br/>)</pre> |
197+
| No action |<pre>< transfer(<br/>delivery-id={numeric handle+1},<br/>delivery-tag={binary handle},<br/>settled=**false**,<br/>more=**false**,<br/>state=**null**,<br/>resume=**false**<br/>)</pre> |
198+
| No action |<pre>< transfer(<br/>delivery-id={numeric handle+2},<br/>delivery-tag={binary handle},<br/>settled=**false**,<br/>more=**false**,<br/>state=**null**,<br/>resume=**false**<br/>)</pre> |
199+
| <pre>--> disposition(<br/>role=receiver,<br/>first={delivery ID},<br/>last={delivery ID+2},<br/>settled=**true**,<br/>state=**accepted**<br/>)</pre> |No action |
200200

201201
### Messages
202202

@@ -264,10 +264,10 @@ To begin transactional work, the controller must obtain a `txn-id` from the coor
264264

265265
| Client (Controller) | Direction | Service Bus (Coordinator) |
266266
| :--- | :---: | :--- |
267-
| `attach(<br/>name={link name},<br/>... ,<br/>role=**sender**,<br/>target=**Coordinator**<br/>)` | ------> | |
268-
| | <------ | `attach(<br/>name={link name},<br/>... ,<br/>target=Coordinator()<br/>)` |
269-
| `transfer(<br/>delivery-id=0, ...)<br/>{ AmqpValue (**Declare()**)}`| ------> | |
270-
| | <------ | `disposition( <br/> first=0, last=0, <br/>state=**Declared**(<br/>**txn-id**={transaction ID}<br/>))`|
267+
| <pre>attach(<br/>name={link name},<br/>... ,<br/>role=**sender**,<br/>target=**Coordinator**<br/>)</pre> | ------> | |
268+
| | <------ | <pre>attach(<br/>name={link name},<br/>... ,<br/>target=Coordinator()<br/>)</pre> |
269+
| <pre>transfer(<br/>delivery-id=0, ...)<br/>{ AmqpValue (**Declare()**)}</pre>| ------> | |
270+
| | <------ | <pre>disposition( <br/> first=0, last=0, <br/>state=**Declared**(<br/>**txn-id**={transaction ID}<br/>))</pre>|
271271

272272
#### Discharging a transaction
273273

@@ -277,33 +277,33 @@ The controller concludes the transactional work by sending a `discharge` message
277277
278278
| Client (Controller) | Direction | Service Bus (Coordinator) |
279279
| :--- | :---: | :--- |
280-
| `transfer(<br/>delivery-id=0, ...)<br/>{ AmqpValue (Declare())}`| ------> | |
281-
| | <------ | `disposition( <br/> first=0, last=0, <br/>state=Declared(<br/>txn-id={transaction ID}<br/>))`|
280+
| <pre>transfer(<br/>delivery-id=0, ...)<br/>{ AmqpValue (Declare())}</pre>| ------> | |
281+
| | <------ | <pre>disposition( <br/> first=0, last=0, <br/>state=Declared(<br/>txn-id={transaction ID}<br/>))</pre>|
282282
| | . . . <br/>Transactional work<br/>on other links<br/> . . . |
283-
| `transfer(<br/>delivery-id=57, ...)<br/>{ AmqpValue (<br/>**Discharge(txn-id=0,<br/>fail=false)**)}`| ------> | |
284-
| | <------ | `disposition( <br/> first=57, last=57, <br/>state=**Accepted()**)`|
283+
| <pre>transfer(<br/>delivery-id=57, ...)<br/>{ AmqpValue (<br/>**Discharge(txn-id=0,<br/>fail=false)**)}</pre>| ------> | |
284+
| | <------ | <pre>disposition( <br/> first=57, last=57, <br/>state=**Accepted()**)</pre>|
285285

286286
#### Sending a message in a transaction
287287

288288
All transactional work is done with the transactional delivery state `transactional-state` that carries the txn-id. When sending messages, the transactional-state is carried by the message's transfer frame.
289289

290290
| Client (Controller) | Direction | Service Bus (Coordinator) |
291291
| :--- | :---: | :--- |
292-
| `transfer(<br/>delivery-id=0, ...)<br/>{ AmqpValue (Declare())}`| ------> | |
293-
| | <------ | `disposition( <br/> first=0, last=0, <br/>state=Declared(<br/>txn-id={transaction ID}<br/>))`|
294-
| `transfer(<br/>handle=1,<br/>delivery-id=1, <br/>**state=<br/>TransactionalState(<br/>txn-id=0)**)<br/>{ payload }`| ------> | |
295-
| | <------ | `disposition( <br/> first=1, last=1, <br/>state=**TransactionalState(<br/>txn-id=0,<br/>outcome=Accepted()**))`|
292+
| <pre>transfer(<br/>delivery-id=0, ...)<br/>{ AmqpValue (Declare())}</pre>| ------> | |
293+
| | <------ | <pre>disposition( <br/> first=0, last=0, <br/>state=Declared(<br/>txn-id={transaction ID}<br/>))</pre>|
294+
| <pre>transfer(<br/>handle=1,<br/>delivery-id=1, <br/>**state=<br/>TransactionalState(<br/>txn-id=0)**)<br/>{ payload }</pre>| ------> | |
295+
| | <------ | <pre>disposition( <br/> first=1, last=1, <br/>state=**TransactionalState(<br/>txn-id=0,<br/>outcome=Accepted()**))</pre>|
296296

297297
#### Disposing a message in a transaction
298298

299299
Message disposition includes operations like `Complete` / `Abandon` / `DeadLetter` / `Defer`. To perform these operations within a transaction, pass the `transactional-state` with the disposition.
300300

301301
| Client (Controller) | Direction | Service Bus (Coordinator) |
302302
| :--- | :---: | :--- |
303-
| `transfer(<br/>delivery-id=0, ...)<br/>{ AmqpValue (Declare())}`| ------> | |
304-
| | <------ | `disposition( <br/> first=0, last=0, <br/>state=Declared(<br/>txn-id={transaction ID}<br/>))`|
305-
| | <------ |`transfer(<br/>handle=2,<br/>delivery-id=11, <br/>state=null)<br/>{ payload }`|
306-
| `disposition( <br/> first=11, last=11, <br/>state=**TransactionalState(<br/>txn-id=0,<br/>outcome=Accepted()**))`| ------> |
303+
| <pre>transfer(<br/>delivery-id=0, ...)<br/>{ AmqpValue (Declare())}</pre>| ------> | |
304+
| | <------ | <pre>disposition( <br/> first=0, last=0, <br/>state=Declared(<br/>txn-id={transaction ID}<br/>))</pre>|
305+
| | <------ |<pre>transfer(<br/>handle=2,<br/>delivery-id=11, <br/>state=null)<br/>{ payload }</pre>|
306+
| <pre>disposition( <br/> first=11, last=11, <br/>state=**TransactionalState(<br/>txn-id=0,<br/>outcome=Accepted()**))</pre>| ------> |
307307

308308

309309
## Advanced Service Bus capabilities
@@ -323,10 +323,10 @@ All those gestures require a request/response interaction between the client and
323323

324324
| Logical Operation | Client | Service Bus |
325325
| --- | --- | --- |
326-
| Create Request Response Path |`--> attach(<br/>name={*link name*},<br/>handle={*numeric handle*},<br/>role=**sender**,<br/>source=**null**,<br/>target=”myentity/$management”<br/>)` |No action |
327-
| Create Request Response Path |No action |`\<-- attach(<br/>name={*link name*},<br/>handle={*numeric handle*},<br/>role=**receiver**,<br/>source=null,<br/>target=”myentity”<br/>)` |
328-
| Create Request Response Path |`--> attach(<br/>name={*link name*},<br/>handle={*numeric handle*},<br/>role=**receiver**,<br/>source=”myentity/$management”,<br/>target=”myclient$id”<br/>)` | |
329-
| Create Request Response Path |No action |`\<-- attach(<br/>name={*link name*},<br/>handle={*numeric handle*},<br/>role=**sender**,<br/>source=”myentity”,<br/>target=”myclient$id”<br/>)` |
326+
| Create Request Response Path |<pre>--> attach(<br/>name={*link name*},<br/>handle={*numeric handle*},<br/>role=**sender**,<br/>source=**null**,<br/>target=”myentity/$management”<br/>)</pre> |No action |
327+
| Create Request Response Path |No action |<pre>\<-- attach(<br/>name={*link name*},<br/>handle={*numeric handle*},<br/>role=**receiver**,<br/>source=null,<br/>target=”myentity”<br/>)</pre> |
328+
| Create Request Response Path |<pre>--> attach(<br/>name={*link name*},<br/>handle={*numeric handle*},<br/>role=**receiver**,<br/>source=”myentity/$management”,<br/>target=”myclient$id”<br/>)</pre> | |
329+
| Create Request Response Path |No action |<pre>\<-- attach(<br/>name={*link name*},<br/>handle={*numeric handle*},<br/>role=**sender**,<br/>source=”myentity”,<br/>target=”myclient$id”<br/>)</pre> |
330330

331331
Having that pair of links in place, the request/response implementation is straightforward: a request is a message sent to an entity inside the messaging infrastructure that understands this pattern. In that request-message, the *reply-to* field in the *properties* section is set to the *target* identifier for the link onto which to deliver the response. The handling entity processes the request, and then delivers the reply over the link whose *target* identifier matches the indicated *reply-to* identifier.
332332

@@ -398,8 +398,8 @@ With this functionality, you create a sender and establish the link to the `via-
398398
399399
| Client | Direction | Service Bus |
400400
| :--- | :---: | :--- |
401-
| `attach(<br/>name={link name},<br/>role=sender,<br/>source={client link ID},<br/>target=**{via-entity}**,<br/>**properties=map [(<br/>com.microsoft:transfer-destination-address=<br/>{destination-entity} )]** )` | ------> | |
402-
| | <------ | `attach(<br/>name={link name},<br/>role=receiver,<br/>source={client link ID},<br/>target={via-entity},<br/>properties=map [(<br/>com.microsoft:transfer-destination-address=<br/>{destination-entity} )] )` |
401+
| <pre>attach(<br/>name={link name},<br/>role=sender,<br/>source={client link ID},<br/>target=**{via-entity}**,<br/>**properties=map [(<br/>com.microsoft:transfer-destination-address=<br/>{destination-entity} )]** )</pre> | ------> | |
402+
| | <------ | <pre>attach(<br/>name={link name},<br/>role=receiver,<br/>source={client link ID},<br/>target={via-entity},<br/>properties=map [(<br/>com.microsoft:transfer-destination-address=<br/>{destination-entity} )] )</pre> |
403403

404404
## Related content
405405
To learn more about AMQP, see [Service Bus AMQP overview](service-bus-amqp-overview.md).

0 commit comments

Comments
 (0)