Skip to content

Commit ef798d3

Browse files
authored
First version for API documentation (#57)
* First version for API documentation * Refactor ci files name --------- Signed-off-by: Gabriele Santomaggio <[email protected]>
1 parent 1d065ab commit ef798d3

File tree

12 files changed

+201
-46
lines changed

12 files changed

+201
-46
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: rabbitmq-amqp-dotnet-client
1+
name: Trigger build and test
22

33
on:
44
push:
@@ -8,4 +8,4 @@ on:
88

99
jobs:
1010
call-build-test:
11-
uses: ./.github/workflows/build-test.yaml
11+
uses: ./.github/workflows/wf_build-and-test.yaml
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Trigger github pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
call-gh-pages:
9+
uses: ./.github/workflows/wf_gh-pages.yaml
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: publish rabbitmq-dotnet-client
1+
name: Trigger publish the client to nuget
22

33
on:
44
release:
@@ -8,8 +8,8 @@ on:
88

99
jobs:
1010
call-build-test:
11-
uses: ./.github/workflows/build-test.yaml
11+
uses: ./.github/workflows/wf_build-and-test.yaml
1212
call-publish-nuget:
13-
uses: ./.github/workflows/publish-nuget.yaml
13+
uses: ./.github/workflows/wf_publish-nuget.yaml
1414
needs: call-build-test
1515
secrets: inherit

.github/workflows/build-test.yaml renamed to .github/workflows/wf_build-and-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test against supported .NET
1+
name: Workflow test against supported .NET
22

33
on:
44
- workflow_call
@@ -34,7 +34,7 @@ jobs:
3434
id: install-start-rabbitmq
3535
run: ${{ github.workspace }}\.ci\windows\gha-setup.ps1
3636
- name: Test
37-
timeout-minutes: 15
37+
timeout-minutes: 20
3838
run: dotnet test ${{ github.workspace }}\Build.csproj --no-restore --no-build --logger 'console;verbosity=detailed'
3939
- name: Check for errors in RabbitMQ logs
4040
run: ${{ github.workspace }}\.ci\windows\gha-log-check.ps1

.github/workflows/wf_gh-pages.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Workflow github pages
2+
3+
# Your GitHub workflow file under .github/workflows/
4+
# Trigger the action on push to main
5+
on:
6+
- workflow_call
7+
8+
9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10+
permissions:
11+
actions: read
12+
pages: write
13+
id-token: write
14+
15+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
16+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
21+
jobs:
22+
publish-docs:
23+
environment:
24+
name: github-pages
25+
url: ${{ steps.deployment.outputs.page_url }}
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
- name: Dotnet Setup
31+
uses: actions/setup-dotnet@v3
32+
with:
33+
dotnet-version: 8.x
34+
35+
- run: dotnet tool update -g docfx
36+
- run: docfx docfx.json
37+
38+
- name: Upload artifact
39+
uses: actions/upload-pages-artifact@v3
40+
with:
41+
# Upload entire repository
42+
path: '_site'
43+
- name: Deploy to GitHub Pages
44+
id: deployment
45+
uses: actions/deploy-pages@v4

.github/workflows/publish-nuget.yaml renamed to .github/workflows/wf_publish-nuget.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: publish-nuget
1+
name: Workflow publish the client to nuget
22

33
on:
44
workflow_call:

README.md

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# RabbitMQ AMQP 1.0 .NET Client
22

3-
This library is in early stages of development. It is meant to be used with RabbitMQ 4.0.
3+
This library is meant to be used with RabbitMQ 4.0.
4+
Still work in progress suitable for testing in pre-production environments
45

56
## How to Run
67

@@ -16,26 +17,6 @@ You can find an example in: `docs/Examples/GettingStarted`
1617

1718
The client is distributed via [NuGet](https://www.nuget.org/packages/RabbitMQ.AMQP.Client/).
1819

19-
## TODO
20-
21-
- [x] Declare queues
22-
- [x] Declare exchanges
23-
- [x] Declare bindings
24-
- [x] Simple Publish messages
25-
- [x] Implement backpressure (it is implemented with MaxInflightMessages `MaxInFlight(2000).`)
26-
- [x] Simple Consume messages
27-
- [x] Recovery connection on connection lost
28-
- [x] Recovery management on connection lost
29-
- [x] Recovery queues on connection lost
30-
- [x] Recovery publishers on connection lost
31-
- [x] Recovery consumers on connection lost
32-
- [x] Implement Environment to manage the connections
33-
- [x] Complete the consumer part with `pause` and `unpause`
34-
- [x] Complete the binding/unbinding with the special characters
35-
- [x] Complete the queues/exchanges name with the special characters
36-
- [ ] Implement metrics ( See `System.Diagnostics.DiagnosticSource` [Link](https://learn.microsoft.com/en-us/dotnet/core/diagnostics/metrics-instrumentation) )
37-
- [x] Recovery exchanges on connection lost
38-
- [x] Recovery bindings on connection lost
39-
- [ ] Docker image to test in LRE [not mandatory]
40-
- [ ] Check the TODO in the code
20+
## Documentation
4121

22+
- [API](https://rabbitmq.github.io/rabbitmq-amqp-dotnet-client/api/RabbitMQ.AMQP.Client.html)

RabbitMQ.AMQP.Client/IEnvironment.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public interface IEnvironment
2525
/// <returns>IConnection</returns>
2626
public Task<IConnection> CreateConnectionAsync();
2727

28+
/// <summary>
29+
/// Get all connections.
30+
/// </summary>
2831
public ReadOnlyCollection<IConnection> GetConnections();
2932

3033
/// <summary>

RabbitMQ.AMQP.Client/IManagement.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ public PreconditionFailedException(string message) : base(message)
2222
}
2323
}
2424

25+
/// <summary>
26+
/// IManagement interface and is responsible for managing the AMQP resources.
27+
/// RabbitMQ uses AMQP end point: "/management" to manage the resources like queues, exchanges, and bindings.
28+
/// The management endpoint works like an HTTP RPC endpoint where the client sends a request to the server.
29+
/// </summary>
2530
public interface IManagement : ILifeCycle
2631
{
2732
IQueueSpecification Queue();

RabbitMQ.AMQP.Client/Impl/AmqpConnection.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace RabbitMQ.AMQP.Client.Impl
1818
{
1919
/// <summary>
2020
/// AmqpConnection is the concrete implementation of <see cref="IConnection"/>
21-
/// It is a wrapper around the AMQP.Net Lite <see cref="Connection"/> class
21+
/// It is a wrapper around the Microsoft AMQP.Net Lite <see cref="Connection"/> class
2222
/// </summary>
2323
public class AmqpConnection : AbstractLifeCycle, IConnection
2424
{
@@ -50,11 +50,23 @@ public class AmqpConnection : AbstractLifeCycle, IConnection
5050
private readonly TaskCompletionSource<bool> _connectionClosedTcs =
5151
new(TaskCreationOptions.RunContinuationsAsynchronously);
5252

53+
54+
/// <summary>
55+
/// Read-only collection of publishers.
56+
/// See <see cref="IPublisher"/>
57+
/// </summary>
58+
/// <returns> All the active Publishers </returns>
5359
public ReadOnlyCollection<IPublisher> GetPublishers()
5460
{
5561
return Publishers.Values.ToList().AsReadOnly();
5662
}
5763

64+
65+
/// <summary>
66+
/// Read-only collection of consumers.
67+
/// See <see cref="IConsumer"/>
68+
/// </summary>
69+
/// <returns> All the active Consumers </returns>
5870
public ReadOnlyCollection<IConsumer> GetConsumers()
5971
{
6072
return Consumers.Values.ToList().AsReadOnly();
@@ -77,6 +89,7 @@ await connection.OpenAsync()
7789
return connection;
7890
}
7991

92+
8093
public IManagement Management()
8194
{
8295
return _management;

0 commit comments

Comments
 (0)