Skip to content

Commit 681a219

Browse files
committed
Expose ManagementClient instance to ServiceControl
1 parent 2bdfa80 commit 681a219

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/NServiceBus.Transport.RabbitMQ/NServiceBus.Transport.RabbitMQ.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<ItemGroup>
2929
<InternalsVisibleTo Include="NServiceBus.Transport.RabbitMQ.AcceptanceTests" Key="$(NServiceBusTestsKey)" />
3030
<InternalsVisibleTo Include="NServiceBus.Transport.RabbitMQ.Tests" Key="$(NServiceBusTestsKey)" />
31+
<InternalsVisibleTo Include="ServiceControl.Transports.RabbitMQ" Key="$(NServiceBusKey)" />
3132
</ItemGroup>
3233

3334
</Project>

src/NServiceBus.Transport.RabbitMQ/RabbitMQTransport.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ public void AddClusterNode(string hostName, int port, bool useTls)
203203
additionalClusterNodes.Add((hostName, port, useTls));
204204
}
205205

206+
internal ManagementClient ManagementClient { get; private set; }
207+
206208
/// <inheritdoc />
207209
public override async Task<TransportInfrastructure> Initialize(HostSettings hostSettings, ReceiveSettings[] receivers, string[] sendingAddresses, CancellationToken cancellationToken = default)
208210
{
@@ -226,14 +228,12 @@ public override async Task<TransportInfrastructure> Initialize(HostSettings host
226228
additionalClusterNodes
227229
);
228230

229-
ManagementClient managementClient = null;
230-
231231
if (UseManagementApi)
232232
{
233-
managementClient = new ManagementClient(ConnectionConfiguration, ManagementApiConfiguration);
233+
ManagementClient = new ManagementClient(ConnectionConfiguration, ManagementApiConfiguration);
234234
}
235235

236-
var brokerVerifier = new BrokerVerifier(connectionFactory, UseManagementApi, managementClient);
236+
var brokerVerifier = new BrokerVerifier(connectionFactory, UseManagementApi, ManagementClient);
237237
await brokerVerifier.Initialize(cancellationToken).ConfigureAwait(false);
238238

239239
var channelProvider = new ChannelProvider(connectionFactory, NetworkRecoveryInterval, RoutingTopology);

0 commit comments

Comments
 (0)