Skip to content

Commit

Permalink
Use serializer from configuration object
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Hartenberger committed May 13, 2024
1 parent acc163d commit 4369e03
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageIconUrl>https://raw.githubusercontent.com/BookBeat/knightbus/master/documentation/media/images/knighbus-64.png</PackageIconUrl>
<PackageIcon>knighbus-64.png</PackageIcon>
<RepositoryUrl>https://github.com/BookBeat/knightbus</RepositoryUrl>
<Version>1.1.1</Version>
<Version>1.1.2</Version>
<PackageTags>knightbus;postgresql;queues;messaging</PackageTags>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ public class PostgresManagementClient
private readonly NpgsqlDataSource _npgsqlDataSource;
private readonly IMessageSerializer _serializer;

public PostgresManagementClient(NpgsqlDataSource npgsqlDataSource, IMessageSerializer serializer)
public PostgresManagementClient(NpgsqlDataSource npgsqlDataSource, IPostgresConfiguration configuration)
{
_npgsqlDataSource = npgsqlDataSource;
_serializer = serializer;
_serializer = configuration.MessageSerializer;
}

public async Task<List<PostgresQueueMetadata>> ListQueues(CancellationToken ct)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public async Task OneTimeSetUp()
{
_postgresBus = new PostgresBus(PostgresTestBase.TestNpgsqlDataSource, new PostgresConfiguration());
_postgresQueueClient = new PostgresQueueClient<TestCommand>(PostgresTestBase.TestNpgsqlDataSource, new MicrosoftJsonSerializer());
_postgresManagementClient = new PostgresManagementClient(PostgresTestBase.TestNpgsqlDataSource, new MicrosoftJsonSerializer());
_postgresManagementClient = new PostgresManagementClient(PostgresTestBase.TestNpgsqlDataSource,
new PostgresConfiguration { MessageSerializer = new MicrosoftJsonSerializer() });
await QueueInitializer.InitQueue(
PostgresQueueName.Create(AutoMessageMapper.GetQueueName<TestCommand>()),
PostgresTestBase.TestNpgsqlDataSource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ public class PostgresMessageStateHandlerTests : MessageStateHandlerTests<Postgre
public override async Task Setup()
{
_postgresManagementClient = new PostgresManagementClient(
PostgresTestBase.TestNpgsqlDataSource, new MicrosoftJsonSerializer());
PostgresTestBase.TestNpgsqlDataSource,
new PostgresConfiguration { MessageSerializer = new MicrosoftJsonSerializer() });
_postgresQueueClient = new PostgresQueueClient<PostgresTestCommand>(
PostgresTestBase.TestNpgsqlDataSource, new MicrosoftJsonSerializer());
_bus = new PostgresBus(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public class PostgresQueueManagerTests : QueueManagerTests<PostgresTestCommand>

public override async Task Setup()
{
_postgresManagementClient = new PostgresManagementClient(PostgresTestBase.TestNpgsqlDataSource, new MicrosoftJsonSerializer());
_postgresManagementClient = new PostgresManagementClient(PostgresTestBase.TestNpgsqlDataSource,
new PostgresConfiguration { MessageSerializer = new MicrosoftJsonSerializer() });
_postgresQueueClient = new PostgresQueueClient<PostgresTestCommand>(PostgresTestBase.TestNpgsqlDataSource, new MicrosoftJsonSerializer());
QueueManager = new PostgresQueueManager(_postgresManagementClient, new MicrosoftJsonSerializer());
QueueType = QueueType.Queue;
Expand Down

0 comments on commit 4369e03

Please sign in to comment.