@@ -487,32 +487,7 @@ two AMQP clients involved: the publisher, and the consumer.
487
487
488
488
Responsibility can be partially transferred to the broker by using
489
489
durable queues, durable exchanges, persistent-mode delivered messages
490
- (with [code DeliveryMode] set equal to 2), and [code Tx]-class
491
- transactions or Publisher Confirms.
492
-
493
- To transfer responsibility for delivery of a message to a broker using
494
- [code Tx]
495
-
496
- - ensure (ahead of time) that the target queue exists and is durable,
497
-
498
- - select [code Tx] mode using [code IModel.TxSelect],
499
-
500
- - publish the message with the "mandatory" flag set and [code
501
- DeliveryMode] set equal to 2, and
502
-
503
- - commit the [code Tx] transaction using [code IModel.TxCommit].
504
-
505
- Once a broker replies with [code CommitOk] (i.e. the [code TxCommit()]
506
- call returns to the caller), it has taken responsibility for keeping
507
- the message on disk and on the target queue until some other
508
- application retrieves and acknowledges the message.
509
-
510
- A commit is not required after every message: batching of publications
511
- may be done, depending on the precise delivery guarantees the
512
- publishing application requires.
513
-
514
- To transfer responsibility for delivery of a message to a broker using
515
- Publisher Confirms
490
+ (with [code DeliveryMode] set equal to 2), and Publisher Confirms:
516
491
517
492
- ensure (ahead of time) that the target queue is durable,
518
493
@@ -579,19 +554,11 @@ To implement at-least-once delivery:
579
554
580
555
To reduce the need for resends of a message when publishing using an
581
556
at-least-once QoS level, it can sometimes be appropriate to use [code
582
- Tx]-class transactions, as described above in the section on
583
- responsibility transfer. Of course, if the [code CommitOk] message
584
- from the server is lost, then a resend will have to be done, since the
585
- sending client doesn't know whether the server actually saw the
586
- message or not unless the [code CommitOk] arrives.
587
-
588
- Once of the important failure-modes when using at-least-once mode in
589
- conjunction with [code Tx]-class transactions is the loss of atomicity
590
- that can arise when a completed transaction is published to the
591
- broker, but the whole transaction is only partially received on the
592
- consuming side before some kind of failure occurs. In these
593
- situations, there will be partial duplication of a transaction: some
594
- of the messages in the transaction will be delivered more than once.
557
+ Confirm]-class, as described above in the section on responsibility
558
+ transfer. Of course, if a confirmation from the broker is lost, then a
559
+ resend will have to be done, since the sending client doesn't know
560
+ whether the server actually saw the message or not unless the
561
+ [Basic.Nack] arrives.
595
562
596
563
Alternatively, rather than implement the round-trip logic manually, a
597
564
client may use Publisher Confirms. By enabling Confirm mode on a
@@ -760,7 +727,3 @@ step. For example:
760
727
server. In cases where there is no reply to a request, the
761
728
acknowledgement is still useful to ensure that requests are not
762
729
lost.
763
-
764
- - Finally, if [code Tx]-class transactions are in use, the work cycle
765
- can be closed off by invoking [code IModel.TxCommit], and the next
766
- request can be tackled.
0 commit comments