Skip to content

Commit 578589a

Browse files
committed
update documentation [skip ci]
Signed-off-by: Gabriele Santomaggio <[email protected]>
1 parent 6bb73ea commit 578589a

File tree

1 file changed

+35
-28
lines changed

1 file changed

+35
-28
lines changed

docs/asciidoc/api.adoc

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ include::{test-examples}/StreamSystemUsage.cs[tag=create-tls-external-auth]
7777
<1> Enable TLS and configure the certificates
7878
<2> Set the external authentication mechanism
7979

80-
Note: you need the `rabbitmq_auth_mechanism_ssl` plugin enabled on the server side to use external authentication.
80+
Note: you need the `rabbitmq_auth_mechanism_ssl` plugin enabled on the server side to use external authentication.
8181
`AuthMechanism.External` can be used from RabbitMQ server 3.11.19 and RabbitMQ 3.12.1 onwards.
8282

8383
.Creating a TLS environment that trusts all server certificates for development
@@ -88,9 +88,6 @@ include::{test-examples}/StreamSystemUsage.cs[tag=create-tls-trust]
8888

8989
<1> Trust all server certificates
9090

91-
92-
93-
9491
===== Configuring the Stream System
9592

9693
The following table sums up the main settings to create an `StreamSystem` using the `StreamSystemConfig`:
@@ -322,7 +319,7 @@ This value is valid only for the `Send(Message)` method.
322319

323320
Once a `Producer` has been created, it is possible to send a message with:
324321

325-
* `Producer#send(Message)`,
322+
* `Producer#send(Message)`,
326323
* `Producer#send(List<Message>)`
327324
* `Producer#send(List<Message> messages, CompressionType compressionType)`.
328325

@@ -682,10 +679,8 @@ include::{test-examples}/ConsumerUsage.cs[tag=consumer-creation]
682679

683680
The broker start sending messages as soon as the `Consumer` instance is created.
684681

685-
686682
Staring from the 1.3.0 version, the `Consumer#MessageHandler` API runs in a separated `Task` and it is possible to use `async`/`await` in the handler.
687683

688-
689684
The following table sums up the main settings to create a `Consumer` with `ConsumerConfig`:
690685

691686
[%header,cols=3*]
@@ -750,23 +745,28 @@ See the <<specifying-an-offset,offset section>> to find out more about the diffe
750745

751746
[[crc-on-delivery]]
752747
===== Check the CRC on Delivery
753-
RabbitMQ Stream provides a CRC32 checksum on each message to ensure the chunk is not corrupted.
754-
The client library can check the CRC32 on the message and throw an exception if the message is corrupted. By default the CRC32 is not checked, to enable it you need to set the `ICrc32` in the `ConsumerConfig`:
755748

756-
.Checking the CRC32 on the message
749+
RabbitMQ Stream provides a CRC32 checksum on each chunk.
750+
The client library can check the checksum before parse the chunk and throw an `CrcException` exception if the validation fails.
751+
By default the CRC32 checksum is not enabled, to enable it you need to set the `ICrc32` interface in the `ConsumerConfig`:
752+
753+
.Checking the CRC32 checksum on the chunk
757754
[source,c#,indent=0]
758755
--------
759756
include::{test-examples}/ConsumerUsage.cs[tag=consumer-creation-crc]
760757
--------
761-
1- An implementation of the `ICrc32` interface. You are free to use any implementation you want.
762-
We suggest to use `System.IO.Hashing`. `System.IO.Hashing` is not shipped with the client library.
763-
2- Set the `ICrc32` in the `ConsumerConfig`
764758

765-
In case the CrC32 is not valid the `Consumer` will throw an `CrcException` exception.
766-
It is recommended to use it even if it _could_ reduce the performance of the consumer. It depends on the use case.
759+
<1> An implementation of the `ICrc32` interface.
760+
You are free to use any implementation you want.
761+
The client is tested with `System.IO.Hashing`.
762+
`System.IO.Hashing` is not shipped with the client library.
763+
<2> Set the `ICrc32` implementation in the `ConsumerConfig`
767764

768-
[[consumer-reconnect-strategy]]
765+
It is recommended to use it.
766+
It _could_ reduce the performance of the consumer.
767+
It depends on the use case.
769768

769+
[[consumer-reconnect-strategy]]
770770
[[specifying-an-offset]]
771771
===== Specifying an Offset
772772

@@ -950,6 +950,7 @@ Use the `ConsumerBuilder#singleActiveConsumer()` method to enable the feature:
950950
--------
951951
include::{test-examples}/ConsumerUsage.cs[tag=enabling-single-active-consumer]
952952
--------
953+
953954
<1> Set the `Reference` name (mandatory to enable single active consumer)
954955
<2> Enable single active consumer
955956

@@ -981,12 +982,10 @@ include::{test-examples}/ConsumerUsage.cs[tag=sac-consumer-update-listener]
981982
<2> Enable single active consumer
982983
<3> Handle `ConsumerUpdateListener` callback
983984

984-
985985
[[low-high-level-classes]]
986986
==== Low Level and High Level classes
987987

988-
.NET stream client provides two types of classes:
989-
988+
.NET stream client provides two types of classes:
990989
* Low-level classes
991990
* High-level classes
992991

@@ -997,7 +996,9 @@ include::{test-examples}/ConsumerUsage.cs[tag=sac-consumer-update-listener]
997996
** `RabbitMQ.Stream.Client.RawSuperStreamProducer` - Low-level super-stream producer class
998997
** `RabbitMQ.Stream.Client.RawSuperStreamConsumer` - Low-level super-stream consumer class
999998

1000-
The Classes are used to interact with the stream server in a low level way. They are used to create streams, publish messages, consume messages, etc. They give you all the callbacks to manually handle events like:
999+
The Classes are used to interact with the stream server in a low level way.
1000+
They are used to create streams, publish messages, consume messages, etc.
1001+
They give you all the callbacks to manually handle events like:
10011002

10021003
* `Disconnection`
10031004
* `Metadata update`
@@ -1007,10 +1008,13 @@ The Classes are used to interact with the stream server in a low level way. They
10071008
--------
10081009
include::{test-examples}/RawClasses.cs[tag=raw-producer-creation]
10091010
--------
1011+
10101012
<1> Create a `RawProducer` instance
10111013
<2> Event in case of disconnection
1012-
<3> Event in case of MetadataHandler update. This event is triggered by the server when a stream changes topology like deleted or added/removed mirrors
1013-
<4> ConfirmHandler event. This event is triggered when a `PublishingId` message is confirmed by the server with or without an error.
1014+
<3> Event in case of MetadataHandler update.
1015+
This event is triggered by the server when a stream changes topology like deleted or added/removed mirrors
1016+
<4> ConfirmHandler event.
1017+
This event is triggered when a `PublishingId` message is confirmed by the server with or without an error.
10141018

10151019
Like the `RawProducer` class, the `Raw*` classes have the same events to handle the disconnection and metadata update.
10161020

@@ -1019,21 +1023,24 @@ It is up to the user to handle the disconnection and metadata update events.
10191023
[WARNING]
10201024
.Be careful when using the `Raw*` classes.
10211025
====
1022-
They are low-level classes and you need to handle the disconnection and metadata update events. If you don't handle them, you will end up with a disconnected client and you will not be able to reconnect to the server.
1026+
They are low-level classes and you need to handle the disconnection and metadata update events.
1027+
If you don't handle them, you will end up with a disconnected client and you will not be able to reconnect to the server.
10231028
1024-
"RawProducer:send" is not thread-safe. You need to synchronize access to it.
1025-
"RawProducer" does not handle the timeout/error confirmation messages. You need to handle it yourself.
1029+
"RawProducer:send" is not thread-safe.
1030+
You need to synchronize access to it.
1031+
"RawProducer" does not handle the timeout/error confirmation messages.
1032+
You need to handle it yourself.
10261033
====
10271034

10281035
===== High-level classes
10291036

1030-
** <<creating-a-producer, `Producer`>> - High-level producer class
1037+
** <<creating-a-producer, `Producer`>> - High-level producer class
10311038
** <<creating-a-consumer, `Consumer`>> - High-level consumer class
10321039

1033-
10341040
`Producer` and `Consumer` classes handle auto-reconnection, metadata updates, super-stream and some low-level client behaviour.
10351041

1036-
The `Producer` traces the sent and received messages to give back to the user the original message sent to the server and also handle the message timeout. See <<confirmation-status>> for more details.
1042+
The `Producer` traces the sent and received messages to give back to the user the original message sent to the server and also handle the message timeout.
1043+
See <<confirmation-status>> for more details.
10371044

10381045
It would be best to use `Producer` and `Consumer` classes unless you need to handle the low-level details.
10391046

0 commit comments

Comments
 (0)