Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove v1 producer #1290

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading