Skip to content

Commit 0f62a3a

Browse files
committed
Update docs
1 parent fada5db commit 0f62a3a

File tree

3 files changed

+49
-34
lines changed

3 files changed

+49
-34
lines changed

API.md

+46-33
Original file line numberDiff line numberDiff line change
@@ -60,34 +60,47 @@ The following table summarizes the methods available to an AMQP client. For deta
6060

6161
The following table summarizes the methods available to an AMQP channel obtained via the `channel()` method of a `client` instance. For detailed documentation on each method and its arguments please consult the class [documentation](https://github.com/achilleasa/dart_amqp/blob/master/lib/src/client/channel.dart).
6262

63-
| Method | Description
64-
|--------------------|------------------
65-
| close() | Close the channel and abort any pending operations.
66-
| queue() | Define a named queue.
67-
| privateQueue() | Define a private queue with a random name that will be deleted when the channel closes.
68-
| exchange() | Define an exchange that can be used to route messages to multiple recipients.
69-
| qos() | Manage the QoS settings for the channel (prefetech size & count).
70-
| ack() | Acknowledge a message by its id.
71-
| select() | Begin a transaction.
72-
| commit() | Commit a transaction.
73-
| rollback() | Rollback a transaction.
74-
| flow() | Control message flow.
75-
| recover() | Recover unacknowledged messages.
76-
| basicReturnListener()| Get a StreamSubscription for handling undelivered messages.
63+
| Method | Description
64+
|----------------------------|
65+
| close() | Close the channel and abort any pending operations.
66+
| queue() | Define a named queue.
67+
| privateQueue() | Define a private queue with a random name that will be deleted when the channel closes.
68+
| exchange() | Define an exchange that can be used to route messages to multiple recipients.
69+
| qos() | Manage the QoS settings for the channel (prefetech size & count).
70+
| ack() | Acknowledge a message by its id.
71+
| select() | Begin a transaction.
72+
| commit() | Commit a transaction.
73+
| rollback() | Rollback a transaction.
74+
| flow() | Control message flow.
75+
| recover() | Recover unacknowledged messages.
76+
| basicReturnListener() | Get a StreamSubscription for handling undelivered messages.
77+
| confirmPublishedMessages() | Request that the broker ACKs/NACKs the handling of published messages.
78+
| publishNotifier() | Register a listener for publish notifications emitted by the broker.
79+
80+
The `confirmPublishedMessages` and `publishNotifier` methods leverage the _publisher confirms_
81+
[extension](https://www.rabbitmq.com/confirms.html#publisher-confirms).
82+
83+
Notifications obtained using this mechanism only guarantee that the broker has
84+
either processed (persisted) a published message successfully or it has dropped
85+
it (e.g. out of disk space). Applications should never assume that receiving an
86+
ACK from the broker for a published message means that a consumer has
87+
successfully processed the message. As demonstrated by [examples/confirm](https://github.com/achilleasa/dart_amqp/blob/master/examples/confirm),
88+
the broker will ACK messages published to a queue even if there are no consumers listening
89+
on the other end.
7790

7891
## Exchanges
7992

8093
The following table summarizes the methods available to an AMQP exchange declared via the the `exchange()` method of a `channel` instance. For detailed documentation on each method and its arguments please consult the class [documentation](https://github.com/achilleasa/dart_amqp/blob/master/lib/src/client/exchange.dart).
8194

82-
| Method | Description
83-
|--------------------|------------------
84-
| name() | A getter for the exchange name.
85-
| type() | A getter for the exchange [type](https://github.com/achilleasa/dart_amqp/blob/master/lib/src/enums/exchange_type.dart).
86-
| channel() | A getter for the [channel](#channels) where this exchange was declared.
87-
| delete() | Delete the exchange.
88-
| publish() | Publish message using a routing key
95+
| Method | Description
96+
|----------------------------|
97+
| name() | A getter for the exchange name.
98+
| type() | A getter for the exchange [type](https://github.com/achilleasa/dart_amqp/blob/master/lib/src/enums/exchange_type.dart).
99+
| channel() | A getter for the [channel](#channels) where this exchange was declared.
100+
| delete() | Delete the exchange.
101+
| publish() | Publish message using a routing key
89102
| bindPrivateQueueConsumer() | Convenience method that allocates a private [queue](#queues), binds it to the exchange via a routing key and returns a [consumer](#consumers) for processing messages.
90-
| bindQueueConsumer() | Convenience method that allocates a named [queue](#queues), binds it to the exchange via a routing key and returns a [consumer](#consumers) for processing messages.
103+
| bindQueueConsumer() | Convenience method that allocates a named [queue](#queues), binds it to the exchange via a routing key and returns a [consumer](#consumers) for processing messages.
91104

92105
## Queues
93106

@@ -122,17 +135,17 @@ Queue consumers are essentially StreamControllers that emit a `Stream<AmqpMessag
122135
payload of the incoming message as well as the incoming message properties
123136
and provides helper methods for replying, ack-ing and rejecting messages. The following table summarizes the methods provided by `AmqpMessage`. For detailed documentation on each method and its arguments please consult the class [documentation](https://github.com/achilleasa/dart_amqp/blob/master/lib/src/client/amqp_message.dart).
124137

125-
| Method | Description
126-
|--------------------|------------------
127-
| payload() | A getter for retrieving the raw message paylaod as an Uint8List.
128-
| payloadAsString() | A getter for retrieving the message payload as an UTF8 String.
129-
| payloadAsJson() | A getter for retrieving the message payload as a parsed JSON document.
130-
| exchangeName() | A getter for the [exchange](#exchanges) where the message was published.
131-
| routingKey() | A getter for the routing key used for publishing this message.
132-
| properties() | A getter for retrieving message [properties](https://github.com/achilleasa/dart_amqp/blob/master/lib/src/protocol/messages/message_properties.dart).
133-
| ack() | Acknowledge this message.
134-
| reply() | Reply to the message sender with a new message.
135-
| reject() | Reject this message.
138+
| Method | Description
139+
|-------------------|
140+
| payload() | A getter for retrieving the raw message paylaod as an Uint8List.
141+
| payloadAsString() | A getter for retrieving the message payload as an UTF8 String.
142+
| payloadAsJson() | A getter for retrieving the message payload as a parsed JSON document.
143+
| exchangeName() | A getter for the [exchange](#exchanges) where the message was published.
144+
| routingKey() | A getter for the routing key used for publishing this message.
145+
| properties() | A getter for retrieving message [properties](https://github.com/achilleasa/dart_amqp/blob/master/lib/src/protocol/messages/message_properties.dart).
146+
| ack() | Acknowledge this message.
147+
| reply() | Reply to the message sender with a new message.
148+
| reject() | Reject this message.
136149

137150
## Error handling
138151

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Main features:
1010
- supports PLAIN and AMQPLAIN authentication providers while other authentication schemes can be plugged in by implementing the appropriate interface.
1111
- implements the entire 0.9.1 protocol specification (except basic get and recover-async)
1212
- supports both plain-text and TLS connections
13+
- supports publish confirmations
1314

1415
Things not working yet:
1516
- the driver does not currently support recovering client topologies when re-establishing connections. This feature may be implemented in a future version.

example/example.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,5 @@ functionality. If you need RPC support for your application you may want to cons
5959

6060
# Additional examples
6161

62-
The [example](https://github.com/achilleasa/dart_amqp/tree/master/example) folder contains implementations of the six RabbitMQ getting started [tutorials](https://www.rabbitmq.com/getstarted.html).
62+
The [example](https://github.com/achilleasa/dart_amqp/tree/master/example) folder contains implementations of the six RabbitMQ getting started [tutorials](https://www.rabbitmq.com/getstarted.html)
63+
plus an [extra](https://github.com/achilleasa/dart_amqp/tree/master/example/confirm) example of working with publish confirmations.

0 commit comments

Comments
 (0)