Skip to content

Commit

Permalink
feat: remove v1 producer
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneD committed Jan 29, 2025
1 parent 501efa0 commit a828f2a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 284 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,29 +94,6 @@ private void RegisterProjections(ContainerBuilder builder)
.RegisterProjectionMigrator<ProducerContextMigrationFactory>(
_configuration,
_loggerFactory)
.RegisterProjections<ProducerMigrateProjections, ProducerContext>(() =>
{
var bootstrapServers = _configuration["Kafka:BootstrapServers"]!;
var topic =
$"{_configuration[ProducerMigrateProjections.AddressTopicKey]}"
?? throw new ArgumentException($"Configuration has no value for {ProducerMigrateProjections.AddressTopicKey}");
var producerOptions = new ProducerOptions(
new BootstrapServers(bootstrapServers),
new Topic(topic),
true,
EventsJsonSerializerSettingsProvider.CreateSerializerSettings())
.ConfigureEnableIdempotence();

if (!string.IsNullOrEmpty(_configuration["Kafka:SaslUserName"])
&& !string.IsNullOrEmpty(_configuration["Kafka:SaslPassword"]))
{
producerOptions.ConfigureSaslAuthentication(new SaslAuthentication(
_configuration["Kafka:SaslUserName"]!,
_configuration["Kafka:SaslPassword"]!));
}

return new ProducerMigrateProjections(new Producer(producerOptions));
}, connectedProjectionSettings)
.RegisterProjections<ProducerMigrateReaddressFixProjections, ProducerContext>(c =>
{
var bootstrapServers = _configuration["Kafka:BootstrapServers"]!;
Expand Down
258 changes: 0 additions & 258 deletions src/AddressRegistry.Producer/ProducerMigrateProjections.cs

This file was deleted.

2 changes: 0 additions & 2 deletions src/AddressRegistry.Producer/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
"BootstrapServers": "localhost:29092/"
},

"AddressTopic": "dev.address",
"AddressMigrationTopic": "dev.address.migration",
"AddressMigrationReaddressFixTopic": "dev.address.migration.2",
"AddressV3Topic": "dev.address.migration.3",

Expand Down
1 change: 0 additions & 1 deletion test/AddressRegistry.Tests/ProjectionsHandlesEventTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ public static IEnumerable<object[]> GetProjectionsToTest()

yield return [new List<ConnectedProjection<AddressRegistry.Producer.ProducerContext>>
{
new ProducerMigrateProjections(Mock.Of<IProducer>()),
new ProducerMigrateReaddressFixProjections(Mock.Of<IProducer>(), Mock.Of<IStreamStore>()),
new ProducerProjectionsV3(Mock.Of<IProducer>(), Mock.Of<IStreamStore>())
}];
Expand Down

0 comments on commit a828f2a

Please sign in to comment.