Skip to content

Commit

Permalink
Update ProcessManagerServiceBusClientsOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ebbeknudsen committed Nov 19, 2024
1 parent 898cded commit 5fdb373
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ public static IServiceCollection AddProcessManagerRequestCalculatedDataClient(th
var serviceBusOptions = provider.GetRequiredService<IOptions<ProcessManagerServiceBusClientsOptions>>().Value;
var serviceBusSender = provider
.GetRequiredService<ServiceBusClient>()
.CreateSender(serviceBusOptions.ProcessManagerTopic);
.CreateSender(serviceBusOptions.TopicName);

return serviceBusSender;
})
.WithName(nameof(ProcessManagerServiceBusClientsOptions.ProcessManagerTopic));
.WithName(nameof(ProcessManagerServiceBusClientsOptions.TopicName));
});

services.AddScoped<IRequestCalculatedDataClientV1, RequestCalculatedDataClientV1>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ public class ProcessManagerServiceBusClientsOptions
/// Name of the topic which the Process Manager receives service bus messages on
/// </summary>
[Required]
public string ProcessManagerTopic { get; set; } = string.Empty;
public string TopicName { get; set; } = string.Empty;
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
namespace Energinet.DataHub.ProcessManager.Client.Processes.BRS_026_028.V1;

public class RequestCalculatedDataClientV1(
IAzureClientFactory<ServiceBusSender> serviceBusFactory) : IRequestCalculatedDataClientV1
IAzureClientFactory<ServiceBusSender> serviceBusFactory)
: IRequestCalculatedDataClientV1
{
private readonly ServiceBusSender _serviceBusSender = serviceBusFactory.CreateClient(nameof(ProcessManagerServiceBusClientsOptions.ProcessManagerTopic));
private readonly ServiceBusSender _serviceBusSender = serviceBusFactory.CreateClient(nameof(ProcessManagerServiceBusClientsOptions.TopicName));

public async Task RequestCalculatedEnergyTimeSeriesAsync(RequestCalculatedDataInputV1<RequestCalculatedEnergyTimeSeriesInputV1> input, CancellationToken cancellationToken)
{
Expand Down

0 comments on commit 5fdb373

Please sign in to comment.