Skip to content

Conversation

PhilBastian
Copy link
Contributor

@PhilBastian PhilBastian commented Sep 9, 2025

Implements #1201

@PhilBastian PhilBastian marked this pull request as ready for review September 12, 2025 00:45
Copy link
Contributor

@danielmarbach danielmarbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the option is misplaced. See inline comment

// cc @SzymonPobiega

/// <summary>
/// Determines if an exception should be thrown when attempting to publish an event not mapped in PublishedEventToTopicsMap
/// </summary>
public bool ThrowIfUnmappedEventTypes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this property belongs here. This is a behavior that is only relevant to opt in for the TopicPerEventTopology. The migration topology already throws when types are unmapped. If you put it here, one could argue the migration topology would have to respect this flag too, which I think should never be the case by design.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed in call: only have it on options and explicitly force migrationoptions version to true

/// <summary>
/// Determines if an exception should be thrown when attempting to publish an event not mapped in PublishedEventToTopicsMap
/// </summary>
public bool ThrowIfUnmappedEventTypes { get; set; } = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above. I think this is the time when we need to introduce the TopicPerEventTopologyOptions again (we killed the type because it was empty at the time and said we could always reintroduce it later).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternative name suggestions: ThrowForUnmappedEventTypes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed in call: having a new subclass of TopologyOptions which now becomes the 'true' representation of options for TopicPerEvent topology introduces potential breaking changes and difficulty in obsoleting which aren't worth this change. Instead we are forcing this property to true for MigrationTopologyOptions since that's the expected behaviour there

@PhilBastian PhilBastian merged commit 75d992c into master Sep 15, 2025
5 of 6 checks passed
@PhilBastian PhilBastian deleted the 1201_throw_on_missing_eventmap branch September 15, 2025 23:25
@PhilBastian PhilBastian modified the milestone: 5.1.0 Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants