Skip to content

Commit

Permalink
Bump RabbitMQ.Client from 6.8.1 to 7.0.0 in /src/backend (#346)
Browse files Browse the repository at this point in the history
Bumps
[RabbitMQ.Client](https://github.com/rabbitmq/rabbitmq-dotnet-client)
from 6.8.1 to 7.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/releases">RabbitMQ.Client's
releases</a>.</em></p>
<blockquote>
<h2>v7.0.0</h2>
<p><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/milestone/53?closed=1">GitHub
milestone for <code>RabbitMQ.Client</code> version
<code>7.0.0</code></a></p>
<h2>What's Changed</h2>
<ul>
<li>Fall back to rabbitmqctl (or rabbitmqctl.bat) if
RABBITMQ_RABBITMQCTL_PATH or umbrella path are not available by <a
href="https://github.com/michaelklishin"><code>@​michaelklishin</code></a>
in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/818">rabbitmq/rabbitmq-dotnet-client#818</a></li>
<li>Switch to Verify for API approval test by <a
href="https://github.com/bording"><code>@​bording</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/820">rabbitmq/rabbitmq-dotnet-client#820</a></li>
<li>AutorecoveringConnection uses ContinuationTimeout from
ConnectionFactory by <a
href="https://github.com/AndrzejKrol"><code>@​AndrzejKrol</code></a> in
<a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/823">rabbitmq/rabbitmq-dotnet-client#823</a></li>
<li>Do not throw on invalid ReplyTo address by <a
href="https://github.com/ig-sinicyn"><code>@​ig-sinicyn</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/828">rabbitmq/rabbitmq-dotnet-client#828</a></li>
<li>Introduce PublicationAddress.TryParse and switch
BasicProperties.ReplyToAddress to use it by <a
href="https://github.com/michaelklishin"><code>@​michaelklishin</code></a>
in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/831">rabbitmq/rabbitmq-dotnet-client#831</a></li>
<li>Throw ObjectDisposedException when required by <a
href="https://github.com/lukebakken"><code>@​lukebakken</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/832">rabbitmq/rabbitmq-dotnet-client#832</a></li>
<li>Restore Constants class as public by <a
href="https://github.com/lukebakken"><code>@​lukebakken</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/833">rabbitmq/rabbitmq-dotnet-client#833</a></li>
<li>Move Constants to RabbitMQ.Client by <a
href="https://github.com/lukebakken"><code>@​lukebakken</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/834">rabbitmq/rabbitmq-dotnet-client#834</a></li>
<li>Replacing usage of ManualResetEvent with ManualResetEventSlim by <a
href="https://github.com/stebet"><code>@​stebet</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/837">rabbitmq/rabbitmq-dotnet-client#837</a></li>
<li>Optimizing memory usage even further. by <a
href="https://github.com/stebet"><code>@​stebet</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/824">rabbitmq/rabbitmq-dotnet-client#824</a></li>
<li>Using a linked list for fast efficient tracking of [publisher
confirm] delivery tags by <a
href="https://github.com/stebet"><code>@​stebet</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/836">rabbitmq/rabbitmq-dotnet-client#836</a></li>
<li>Adding System.Threading.Channels for simplified, better performing
code. by <a href="https://github.com/stebet"><code>@​stebet</code></a>
in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/835">rabbitmq/rabbitmq-dotnet-client#835</a></li>
<li>Using interpolated strings for better code readability. by <a
href="https://github.com/stebet"><code>@​stebet</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/840">rabbitmq/rabbitmq-dotnet-client#840</a></li>
<li>getting rid of a Func allocation by <a
href="https://github.com/bollhals"><code>@​bollhals</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/841">rabbitmq/rabbitmq-dotnet-client#841</a></li>
<li>Making sure AsyncEventHandlers are all run. Fixes issue <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/issues/838">#838</a>.
by <a href="https://github.com/stebet"><code>@​stebet</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/839">rabbitmq/rabbitmq-dotnet-client#839</a></li>
<li>simplify WriteShortstr by <a
href="https://github.com/bollhals"><code>@​bollhals</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/845">rabbitmq/rabbitmq-dotnet-client#845</a></li>
<li>Deletion of unreachable code by <a
href="https://github.com/Pliner"><code>@​Pliner</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/847">rabbitmq/rabbitmq-dotnet-client#847</a></li>
<li>Deletion of unused UseBackgroundThreadsForIO by <a
href="https://github.com/Pliner"><code>@​Pliner</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/846">rabbitmq/rabbitmq-dotnet-client#846</a></li>
<li>eliminate allocations from InboundFrame by <a
href="https://github.com/bollhals"><code>@​bollhals</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/848">rabbitmq/rabbitmq-dotnet-client#848</a></li>
<li>Frame optimizations by <a
href="https://github.com/stebet"><code>@​stebet</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/844">rabbitmq/rabbitmq-dotnet-client#844</a></li>
<li>Delete AutoClose from SessionManager by <a
href="https://github.com/Pliner"><code>@​Pliner</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/852">rabbitmq/rabbitmq-dotnet-client#852</a></li>
<li>Fixing rethrown exceptions to properly preserve stackframes. by <a
href="https://github.com/stebet"><code>@​stebet</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/850">rabbitmq/rabbitmq-dotnet-client#850</a></li>
<li>throw ArgumentOutOfRangeException when table key is too long (&gt;
255) by <a
href="https://github.com/bollhals"><code>@​bollhals</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/849">rabbitmq/rabbitmq-dotnet-client#849</a></li>
<li>Adding BinaryPrimitives support for NETSTANDARD targets by <a
href="https://github.com/stebet"><code>@​stebet</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/851">rabbitmq/rabbitmq-dotnet-client#851</a></li>
<li>Minor improvements and optimizations by <a
href="https://github.com/bollhals"><code>@​bollhals</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/842">rabbitmq/rabbitmq-dotnet-client#842</a></li>
<li>simplify missed heartbeat recognition by <a
href="https://github.com/bollhals"><code>@​bollhals</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/854">rabbitmq/rabbitmq-dotnet-client#854</a></li>
<li>remove task yield by <a
href="https://github.com/bollhals"><code>@​bollhals</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/855">rabbitmq/rabbitmq-dotnet-client#855</a></li>
<li>Fix RabbitMQ version parsing by <a
href="https://github.com/lukebakken"><code>@​lukebakken</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/862">rabbitmq/rabbitmq-dotnet-client#862</a></li>
<li>Report a Uri scheme of &quot;amqps&quot; in
AmqpTcpEndpoint.ToString() iff SslOption is enabled in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/864">rabbitmq/rabbitmq-dotnet-client#864</a></li>
<li>Re-merge pull request <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/issues/855">#855</a>
from bollhals/remove.task.yield by <a
href="https://github.com/lukebakken"><code>@​lukebakken</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/863">rabbitmq/rabbitmq-dotnet-client#863</a></li>
<li>Prep for 6.1.1 by <a
href="https://github.com/lukebakken"><code>@​lukebakken</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/870">rabbitmq/rabbitmq-dotnet-client#870</a></li>
<li>Fix AppVeyor build by <a
href="https://github.com/lukebakken"><code>@​lukebakken</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/871">rabbitmq/rabbitmq-dotnet-client#871</a></li>
<li>Move BinaryTableValue to public section by <a
href="https://github.com/BenBorn"><code>@​BenBorn</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/880">rabbitmq/rabbitmq-dotnet-client#880</a></li>
<li>Ability to do concurrent dispatches both on the async as well as the
sync consumer by <a
href="https://github.com/danielmarbach"><code>@​danielmarbach</code></a>
in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/866">rabbitmq/rabbitmq-dotnet-client#866</a></li>
<li>Refactor: extracted RabbitMQ node management functions from
IntegrationFixture by <a
href="https://github.com/pergh"><code>@​pergh</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/884">rabbitmq/rabbitmq-dotnet-client#884</a></li>
<li>Switch WorkPool of ConsumerWorkService to channels by <a
href="https://github.com/danielmarbach"><code>@​danielmarbach</code></a>
in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/882">rabbitmq/rabbitmq-dotnet-client#882</a></li>
<li>use cached empty BasicProperties when null by <a
href="https://github.com/bollhals"><code>@​bollhals</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/887">rabbitmq/rabbitmq-dotnet-client#887</a></li>
<li>add size hint variable for PublishBatch creation by <a
href="https://github.com/bollhals"><code>@​bollhals</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/888">rabbitmq/rabbitmq-dotnet-client#888</a></li>
<li>fix issue 868 by <a
href="https://github.com/bollhals"><code>@​bollhals</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/878">rabbitmq/rabbitmq-dotnet-client#878</a></li>
<li>Implement BasicPublishBatch with ReadOnlyMemory by <a
href="https://github.com/danielmarbach"><code>@​danielmarbach</code></a>
in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/865">rabbitmq/rabbitmq-dotnet-client#865</a></li>
<li>7.x: remove deprecated message publishing method overloads by <a
href="https://github.com/danielmarbach"><code>@​danielmarbach</code></a>
in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/895">rabbitmq/rabbitmq-dotnet-client#895</a></li>
<li>precompute sizes and and simplify BasicProperties presence by <a
href="https://github.com/bollhals"><code>@​bollhals</code></a> in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/890">rabbitmq/rabbitmq-dotnet-client#890</a></li>
<li>Edit docs by <a
href="https://github.com/JeremyMahieu"><code>@​JeremyMahieu</code></a>
in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/896">rabbitmq/rabbitmq-dotnet-client#896</a></li>
<li>Do DNS resolution before connection attempt by <a
href="https://github.com/JeremyMahieu"><code>@​JeremyMahieu</code></a>
in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/893">rabbitmq/rabbitmq-dotnet-client#893</a></li>
<li>Unify on IModel by <a
href="https://github.com/danielmarbach"><code>@​danielmarbach</code></a>
in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/858">rabbitmq/rabbitmq-dotnet-client#858</a></li>
<li>Missing ConfigureAwait in TcpClientAdapter by <a
href="https://github.com/danielmarbach"><code>@​danielmarbach</code></a>
in <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/897">rabbitmq/rabbitmq-dotnet-client#897</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/main/CHANGELOG.md">RabbitMQ.Client's
changelog</a>.</em></p>
<blockquote>
<h1>Changelog</h1>
<p><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/compare/v7.0.0-rc.14...HEAD">Full
Changelog</a></p>
<p><strong>Merged pull requests:</strong></p>
<ul>
<li>Fix build warnings in API <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/1718">#1718</a>
(<a href="https://github.com/lukebakken">lukebakken</a>)</li>
<li>Change OTel attribute messaging.operation to
messaging.operation.type <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/1716">#1716</a>
(<a href="https://github.com/iinuwa">iinuwa</a>)</li>
<li>Throw when lease not acquired. This can happen then the rate limiter
doesn't allow queuing or is generally wrongly configured <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/1714">#1714</a>
(<a href="https://github.com/danielmarbach">danielmarbach</a>)</li>
</ul>
<h2><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/tree/v7.0.0-rc.14">v7.0.0-rc.14</a>
(2024-10-24)</h2>
<p><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/compare/v7.0.0-rc.13...v7.0.0-rc.14">Full
Changelog</a></p>
<p><strong>Implemented enhancements:</strong></p>
<ul>
<li>Make handling of publisher confirmations transparent to the user <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/issues/1682">#1682</a></li>
</ul>
<p><strong>Merged pull requests:</strong></p>
<ul>
<li>Remove <code>ChannelOptions</code> internal class <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/1712">#1712</a>
(<a href="https://github.com/lukebakken">lukebakken</a>)</li>
<li>Xml doc updates for the rate limiting <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/1711">#1711</a>
(<a href="https://github.com/danielmarbach">danielmarbach</a>)</li>
<li>Only add <code>x-dotnet-pub-seq-no</code> when tracking enabled <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/1710">#1710</a>
(<a href="https://github.com/lukebakken">lukebakken</a>)</li>
<li>Safeguarding against duplicate sequence numbers <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/1709">#1709</a>
(<a href="https://github.com/danielmarbach">danielmarbach</a>)</li>
</ul>
<h2><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/tree/v7.0.0-rc.13">v7.0.0-rc.13</a>
(2024-10-22)</h2>
<p><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/compare/v7.0.0-rc.12...v7.0.0-rc.13">Full
Changelog</a></p>
<p><strong>Merged pull requests:</strong></p>
<ul>
<li>Address some more TODOs <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/1708">#1708</a>
(<a href="https://github.com/lukebakken">lukebakken</a>)</li>
<li>Upgrade NET6.0 to NET8.0 since NET6.0 is soon EOL <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/1707">#1707</a>
(<a href="https://github.com/danielmarbach">danielmarbach</a>)</li>
<li>Leverage <code>System.Threading.RateLimiting</code> <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/1706">#1706</a>
(<a href="https://github.com/lukebakken">lukebakken</a>)</li>
<li>Enforce maximum outstanding publisher confirms, if set <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/1703">#1703</a>
(<a href="https://github.com/lukebakken">lukebakken</a>)</li>
<li>Isolate publisher confirmation code <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/1702">#1702</a>
(<a href="https://github.com/lukebakken">lukebakken</a>)</li>
<li>Integrate <code>Channel</code> into <code>ChannelBase</code> <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/pull/1700">#1700</a>
(<a href="https://github.com/lukebakken">lukebakken</a>)</li>
</ul>
<h2><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/tree/v7.0.0-rc.12">v7.0.0-rc.12</a>
(2024-10-08)</h2>
<p><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/compare/v7.0.0-rc.11...v7.0.0-rc.12">Full
Changelog</a></p>
<p><strong>Implemented enhancements:</strong></p>
<ul>
<li>Allow DateTime for Headers in IBasicProperties <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/issues/1691">#1691</a></li>
<li>Polyfill language gaps <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/issues/1688">#1688</a></li>
<li>DispatchConsumerConcurrency might be misplaced on the connection
factory <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/issues/1668">#1668</a></li>
<li>Consider using <code>AsyncManualResetEvent</code> when handling flow
state <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/issues/1644">#1644</a></li>
</ul>
<p><strong>Fixed bugs:</strong></p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/commit/7c78e66a42fe13d81cf04b76975f86b13ecba23c"><code>7c78e66</code></a>
7.0.0 CHANGELOG</li>
<li><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/commit/ab8b2796c58574b804f57dfc64e3a9388ed88f1d"><code>ab8b279</code></a>
Merge pull request <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/issues/1718">#1718</a>
from rabbitmq/lukebakken/fix-api-warnings</li>
<li><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/commit/1bdd78ca09a05bf7bfb6d1fd2b413578ad9ac17f"><code>1bdd78c</code></a>
Fix build warnings in API</li>
<li><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/commit/4525c6dc8449afb30016b4cdbe4519bbe4cce625"><code>4525c6d</code></a>
Merge pull request <a
href="https://redirect.github.com/rabbitmq/rabbitmq-dotnet-client/issues/1716">#1716</a>
from iinuwa/fix/change-otel-attribute-name</li>
<li><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/commit/e2c246f1c251949ea0a6c605eb2eb93e891b2662"><code>e2c246f</code></a>
docs: Add clone and build steps to contributing guide</li>
<li><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/commit/fe9ccbe3b62c9d29ed8275a5e7c1612a1ea5fc38"><code>fe9ccbe</code></a>
Update tests for Activity source operation name and attribute value</li>
<li><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/commit/c4d10450b53c067c73abcf495d391df2097c35c3"><code>c4d1045</code></a>
Use const strings for OTel operation types</li>
<li><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/commit/f71273b7fb00c31204d1fd68c21d12e053949dc4"><code>f71273b</code></a>
Update span operation names to comply with OTel semantic
conventions</li>
<li><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/commit/3d708a8b118e5305be0aec060f4f83c7db07e489"><code>3d708a8</code></a>
Change OTel attribute messaging.operation to
messaging.operation.type</li>
<li><a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/commit/898c21f5d484f850805522a17c42405c9bb2806b"><code>898c21f</code></a>
Throw when lease not acquired. This can happen then the rate limiter
doesn't ...</li>
<li>Additional commits viewable in <a
href="https://github.com/rabbitmq/rabbitmq-dotnet-client/compare/v6.8.1...v7.0.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=RabbitMQ.Client&package-manager=nuget&previous-version=6.8.1&new-version=7.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>
  • Loading branch information
hwinther authored Nov 6, 2024
2 parents cdcf9da + 98f0d51 commit 9f888cd
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 65 deletions.
4 changes: 4 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ MAIN_BRANCH="main"

current_branch="$(git rev-parse --abbrev-ref HEAD)"

if [[ $current_branch =~ dependabot/.* ]]; then
exit 0
fi

case "$current_branch" in
$DEV_BRANCH)
error_msg="Aborting commit. Please use the following format: <Imperative verb> <short description of change>"
Expand Down
2 changes: 1 addition & 1 deletion .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ source .githooks/config.sh
local_branch="$(git rev-parse --abbrev-ref HEAD)"

# valid_branch_regex="^(feature|bugfix|improvement|library|prerelease|release|hotfix)\/[a-z0-9._-]+$"
valid_branch_regex="^(main|qa|test|dev|${BRANCH_PREFIXES}\/${JIRA_TAG}-[0-9]+-[A-Za-z0-9-]+)$"
valid_branch_regex="^(main|qa|test|dev|${BRANCH_PREFIXES}\/${JIRA_TAG}-[0-9]+-[A-Za-z0-9-]+|dependabot/.*)$"

message="There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex. Your commit will be rejected. You should rename your branch to a valid name and try again."

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ jobs:

- name: Stryker
id: stryker
if: ${{ github.event_name == 'pull_request' && github.base_ref == 'main' }}
run: |
dotnet stryker --reporter "html" --reporter "json" --reporter "markdown" --solution Backend.sln --output StrykerOutput
cp -r StrykerOutput/reports StrykerReports
Expand All @@ -206,21 +207,22 @@ jobs:
echo "EOF" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'pull_request' && github.base_ref == 'main' }}
with:
name: StrykerReports
path: ${{ env.BACKEND_SOLUTION_PATH }}/StrykerReports

- name: "Create or Update PR Comment"
uses: im-open/[email protected]
if: ${{ always() && github.event_name == 'pull_request' }}
if: ${{ always() && github.event_name == 'pull_request' && github.base_ref == 'main' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-identifier: "${{ env.WORKFLOW_SHORT_NAME }}-Stryker"
comment-content: ${{ steps.stryker.outputs.markdown }}

- name: Inspect code
uses: muno92/resharper_inspectcode@v1
if: ${{ github.event_name == 'pull_request' }}
if: ${{ github.event_name == 'pull_request' && github.base_ref == 'main' }}
with:
workingDirectory: ${{ env.BACKEND_SOLUTION_PATH }}
solutionPath: Backend.sln
Expand Down
8 changes: 4 additions & 4 deletions src/backend/WebApi/Controllers/SendMessageController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public class SendMessageController(IMessageSender messageSender) : ControllerBas
/// </summary>
/// <returns>A string indicating the result of the message sending operation.</returns>
[HttpGet]
public Task<ActionResult<GenericValue<string>>> Get() =>
Task.FromResult<ActionResult<GenericValue<string>>>(Ok(new GenericValue<string>
public async Task<ActionResult<GenericValue<string>>> Get() =>
Ok(new GenericValue<string>
{
Value = messageSender.SendMessage()
}));
Value = await messageSender.SendMessageAsync()
});
}
25 changes: 16 additions & 9 deletions src/backend/WebApi/Messaging/MessageReceiver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public sealed class MessageReceiver : IDisposable

private readonly ILogger<MessageReceiver> _logger;
private readonly IConnection _connection;
private readonly IModel _channel;
private readonly IChannel _channel;

/// <summary>
/// Initializes a new instance of the <see cref="MessageReceiver" /> class, creating a connection to RabbitMQ
Expand All @@ -32,8 +32,13 @@ public sealed class MessageReceiver : IDisposable
public MessageReceiver(ILogger<MessageReceiver> logger)
{
_logger = logger;
_connection = RabbitMqHelper.CreateConnection();
_channel = RabbitMqHelper.CreateModelAndDeclareTestQueue(_connection);
_connection = RabbitMqHelper.CreateConnectionAsync()
.GetAwaiter()
.GetResult();

_channel = RabbitMqHelper.CreateModelAndDeclareTestQueueAsync(_connection)
.GetAwaiter()
.GetResult();
}

/// <summary>
Expand All @@ -48,9 +53,9 @@ public void Dispose()
/// <summary>
/// Starts the message consumer which listens for messages on the declared queue and processes them.
/// </summary>
public void StartConsumer()
public async Task StartConsumerAsync()
{
RabbitMqHelper.StartConsumer(_channel, ReceiveMessage);
await RabbitMqHelper.StartConsumerAsync(_channel, ReceiveMessageAsync);
}

/// <summary>
Expand All @@ -59,7 +64,7 @@ public void StartConsumer()
/// duration.
/// </summary>
/// <param name="ea">The event arguments containing the message and metadata.</param>
public void ReceiveMessage(BasicDeliverEventArgs ea)
public Task ReceiveMessageAsync(BasicDeliverEventArgs ea)
{
// Extract the PropagationContext of the upstream parent from the message headers.
var parentContext = Propagator.Extract(default, ea.BasicProperties, ExtractTraceContextFromBasicProperties);
Expand All @@ -74,7 +79,7 @@ public void ReceiveMessage(BasicDeliverEventArgs ea)
{
var message = Encoding.UTF8.GetString(ea.Body.Span.ToArray());

_logger.LogInformation($"Message received: [{message}]");
_logger.LogInformation("Message received: [{Message}]", message);

activity?.SetTag("message", message);

Expand All @@ -89,13 +94,15 @@ public void ReceiveMessage(BasicDeliverEventArgs ea)
{
_logger.LogError(ex, "Message processing failed.");
}

return Task.CompletedTask;
}

private IEnumerable<string> ExtractTraceContextFromBasicProperties(IBasicProperties props, string key)
private IEnumerable<string> ExtractTraceContextFromBasicProperties(IReadOnlyBasicProperties props, string key)
{
try
{
if (props.Headers.TryGetValue(key, out var value) && value is byte[] bytes)
if (props.Headers != null && props.Headers.TryGetValue(key, out var value) && value is byte[] bytes)
return
[
Encoding.UTF8.GetString(bytes)
Expand Down
25 changes: 15 additions & 10 deletions src/backend/WebApi/Messaging/MessageSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public sealed class MessageSender : IMessageSender, IDisposable

private readonly ILogger<MessageSender> _logger;
private readonly IConnection _connection;
private readonly IModel _channel;
private readonly IChannel _channel;

/// <summary>
/// Initializes a new instance of the <see cref="MessageSender" /> class, establishing a connection and channel to
Expand All @@ -31,8 +31,13 @@ public sealed class MessageSender : IMessageSender, IDisposable
public MessageSender(ILogger<MessageSender> logger)
{
_logger = logger;
_connection = RabbitMqHelper.CreateConnection();
_channel = RabbitMqHelper.CreateModelAndDeclareTestQueue(_connection);
_connection = RabbitMqHelper.CreateConnectionAsync()
.GetAwaiter()
.GetResult();

_channel = RabbitMqHelper.CreateModelAndDeclareTestQueueAsync(_connection)
.GetAwaiter()
.GetResult();
}

/// <summary>
Expand All @@ -46,7 +51,7 @@ public void Dispose()

/// <inheritdoc />
/// <remarks>Including propagating the OpenTelemetry trace context.</remarks>
public string SendMessage()
public async Task<string> SendMessageAsync()
{
try
{
Expand All @@ -55,7 +60,7 @@ public string SendMessage()
var activityName = $"{RabbitMqHelper.TestQueueName} send";

using var activity = ActivitySource.StartActivity(activityName, ActivityKind.Producer);
var props = _channel.CreateBasicProperties();
var props = new BasicProperties();

// Depending on Sampling (and whether a listener is registered or not), the
// activity above may not be created.
Expand All @@ -77,13 +82,14 @@ public string SendMessage()

var body = $"Published message: DateTime.Now = {DateTime.Now}.";

_channel.BasicPublish(
await _channel.BasicPublishAsync(
RabbitMqHelper.DefaultExchangeName,
RabbitMqHelper.TestQueueName,
true,
props,
Encoding.UTF8.GetBytes(body));

_logger.LogInformation($"Message sent: [{body}]");
_logger.LogInformation("Message sent: [{Body}]", body);

return body;
}
Expand All @@ -104,8 +110,7 @@ private void InjectTraceContextIntoBasicProperties(IBasicProperties props, strin
{
try
{
if (props.Headers == null)
props.Headers = new Dictionary<string, object>();
props.Headers ??= new Dictionary<string, object?>();

props.Headers[key] = value;
}
Expand All @@ -126,5 +131,5 @@ public interface IMessageSender
/// Sends a message to a RabbitMQ queue
/// </summary>
/// <returns>A string representing the message that was sent.</returns>
public string SendMessage();
public Task<string> SendMessageAsync();
}
19 changes: 9 additions & 10 deletions src/backend/WebApi/Messaging/RabbitMqHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,22 @@ public static class RabbitMqHelper
/// Creates and returns a new RabbitMQ connection using the configured ConnectionFactory.
/// </summary>
/// <returns>A new IConnection instance for interacting with RabbitMQ.</returns>
public static IConnection CreateConnection() => ConnectionFactory.CreateConnection();
public static async Task<IConnection> CreateConnectionAsync() => await ConnectionFactory.CreateConnectionAsync();

/// <summary>
/// Creates a new channel from the given connection, and declares a test queue for message delivery.
/// </summary>
/// <param name="connection">The RabbitMQ connection to use for creating the channel and declaring the queue.</param>
/// <returns>A new IModel instance representing the channel with the declared queue.</returns>
public static IModel CreateModelAndDeclareTestQueue(IConnection connection)
public static async Task<IChannel> CreateModelAndDeclareTestQueueAsync(IConnection connection)
{
var channel = connection.CreateModel();
var channel = await connection.CreateChannelAsync();

channel.QueueDeclare(
await channel.QueueDeclareAsync(
TestQueueName,
false,
false,
false,
null);
false);

return channel;
}
Expand All @@ -68,13 +67,13 @@ public static IModel CreateModelAndDeclareTestQueue(IConnection connection)
/// </summary>
/// <param name="channel">The channel to start the consumer on.</param>
/// <param name="processMessage">The callback to invoke for each received message.</param>
public static void StartConsumer(IModel channel, Action<BasicDeliverEventArgs> processMessage)
public static async Task StartConsumerAsync(IChannel channel, Func<BasicDeliverEventArgs, Task> processMessage)
{
var consumer = new EventingBasicConsumer(channel);
var consumer = new AsyncEventingBasicConsumer(channel);

consumer.Received += (bc, ea) => processMessage(ea);
consumer.ReceivedAsync += (bc, ea) => processMessage(ea);

channel.BasicConsume(TestQueueName, true, consumer);
await channel.BasicConsumeAsync(TestQueueName, true, consumer);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/backend/WebApi/WebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
<PackageReference Include="RabbitMQ.Client" Version="6.8.1" />
<PackageReference Include="RabbitMQ.Client" Version="7.0.0" />
<PackageReference Include="SauceControl.InheritDoc" Version="2.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
27 changes: 16 additions & 11 deletions src/backend/WebApi/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@
},
"RabbitMQ.Client": {
"type": "Direct",
"requested": "[6.8.1, )",
"resolved": "6.8.1",
"contentHash": "jNsmGgmCNw2S/NzskeN2ijtGywtH4Sk/G6jWUTD5sY9SrC27Xz6BsLIiB8hdsfjeyWCa4j4GvCIGkpE8wrjU1Q==",
"requested": "[7.0.0, )",
"resolved": "7.0.0",
"contentHash": "8YJz22mOSMtkbIVuVSz2HbJwbpKwRoXQ1uqbczDUt1w1Ds8dxFs6dkV/oZ8AlTmkErZjtQelHv+oBu52ud00WA==",
"dependencies": {
"System.Memory": "4.5.5",
"System.Threading.Channels": "7.0.0"
"System.IO.Pipelines": "8.0.0",
"System.Threading.RateLimiting": "8.0.0"
}
},
"SauceControl.InheritDoc": {
Expand Down Expand Up @@ -736,13 +736,13 @@
},
"System.IO.Pipelines": {
"type": "Transitive",
"resolved": "6.0.3",
"contentHash": "ryTgF+iFkpGZY1vRQhfCzX0xTdlV3pyaTTqRu2ETbEv+HlV7O6y7hyQURnghNIXvctl5DuZ//Dpks6HdL/Txgw=="
"resolved": "8.0.0",
"contentHash": "FHNOatmUq0sqJOkTx+UF/9YK1f180cnW5FVqnQMvYUN0elp6wFzbtPSiqbo1/ru8ICp43JM1i7kKkk6GsNGHlA=="
},
"System.Memory": {
"type": "Transitive",
"resolved": "4.5.5",
"contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw=="
"resolved": "4.5.4",
"contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw=="
},
"System.Memory.Data": {
"type": "Transitive",
Expand Down Expand Up @@ -853,8 +853,13 @@
},
"System.Threading.Channels": {
"type": "Transitive",
"resolved": "7.0.0",
"contentHash": "qmeeYNROMsONF6ndEZcIQ+VxR4Q/TX/7uIVLJqtwIWL7dDWeh0l1UIqgo4wYyjG//5lUNhwkLDSFl+pAWO6oiA=="
"resolved": "6.0.0",
"contentHash": "TY8/9+tI0mNaUMgntOxxaq2ndTkdXqLSxvPmas7XEqOlv9lQtB7wLjYGd756lOaO7Dvb5r/WXhluM+0Xe87v5Q=="
},
"System.Threading.RateLimiting": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "7mu9v0QDv66ar3DpGSZHg9NuNcxDaaAcnMULuZlaTpP9+hwXhrxNGsF5GmLkSHxFdb5bBc1TzeujsRgTrPWi+Q=="
},
"System.Threading.Tasks.Extensions": {
"type": "Transitive",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public void SetUp()
public async Task Get_ReturnsOkResult()
{
// Arrange
_messageSenderMock.Setup(static messageSender => messageSender.SendMessage())
.Returns("Message sent");
_messageSenderMock.Setup(static messageSender => messageSender.SendMessageAsync())
.ReturnsAsync("Message sent");

// Act
var result = await _controller.Get();
Expand Down
10 changes: 5 additions & 5 deletions tests/backend/WebApi.Tests/Messaging/RabbitMqTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async Task DisposeAsync()

[Test]
[Order(1)]
public void IsOpen_ReturnsTrue()
public async Task IsOpen_ReturnsTrue()
{
// Given
var connectionFactory = new ConnectionFactory
Expand All @@ -40,15 +40,15 @@ public void IsOpen_ReturnsTrue()
};

// When
using var connection = connectionFactory.CreateConnection();
await using var connection = await connectionFactory.CreateConnectionAsync();

// Then
Assert.That(connection.IsOpen);
}

[Test]
[Order(2)]
public void MessageSender_SendsMessage()
public async Task MessageSender_SendsMessage()
{
// Given
var connectionFactory = new ConnectionFactory
Expand All @@ -66,8 +66,8 @@ public void MessageSender_SendsMessage()
using var messageReceiver = new MessageReceiver(messageReceiverLogger.Object);

// When
messageSender.SendMessage();
messageReceiver.ReceiveMessage(new BasicDeliverEventArgs());
await messageSender.SendMessageAsync();
await messageReceiver.ReceiveMessageAsync(new BasicDeliverEventArgs("consumerTag", ulong.MinValue, false, "exchange", "channel", new BasicProperties(), ReadOnlyMemory<byte>.Empty));

// Then
messageSenderLogger.VerifyLog(LogLevel.Information, Times.Once(), "Message sent:");
Expand Down
Loading

0 comments on commit 9f888cd

Please sign in to comment.