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

Add expected processer information to send messages/commands #6789

Open
ramonsmits opened this issue Jul 7, 2023 · 0 comments
Open

Add expected processer information to send messages/commands #6789

ramonsmits opened this issue Jul 7, 2023 · 0 comments

Comments

@ramonsmits
Copy link
Member

Describe the feature.

A message consumer tries to correlate handlers to invoke based on the information from the NServiceBus.EnclosedMessageTypes. If the consumer does not have any matching types deserialization will fail.

If the producer provides information about the expected consumer this information can be useful to diagnose processing failures.

For example, let's assume a component sends a message to ServiceControl for a new feature that is part of ServiceControl 99.99.0 but ServiceControl is at version 4.32.0 then ServiceControl as a consumer can detect that and instead raise an error stating:

Received message that requires support for feature ServiceControl 99.99.0 but at version 4.32.0, please upgrade to 99.99.0 to process this message.

or

Received message that requires support for feature ServiceControl which is not available, review if

Messages can be added to message assemblies but often the assembly version is version locked to x.0.0.0 to prevent loading issues and version information is often available via FileVersionInfo.FileVersion. It would be useful if this information can somehow be added. Maybe by default to use FileVersionInfo.FileVersion but potentially that it can be overridden per message type via an attribute or maybe an assembly attribute:

Some potential methods

Attribute from Core:

[RequiredVersion("ServiceControl-99.99.0-alpha2")]
class MyCommand
{
}

// or

[assembly: RequiredVersion("ServiceControl-99.99.0-alpha2"")]  

Custom attribute:

sealed class CustomRequiredVersionAttribute : Attribute
{
    string version;
    public RequiredVersionAttribute(string version) => this.version = version;
    public override string ToString() => version.ToString();
}

[CustomRequiredVersion("ServiceControl-99.99.0-alpha2")]
class MyCommand
{
}

endpointConfiguration.Conventions().AddRequiredVersionAttribute<RequiredVersionAttribute>();

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant