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

Message Type serialization without assembly version #65

Closed
pardahlman opened this issue Mar 1, 2016 · 6 comments
Closed

Message Type serialization without assembly version #65

pardahlman opened this issue Mar 1, 2016 · 6 comments
Milestone

Comments

@pardahlman
Copy link
Owner

Generic types like GenericType<TFirst, TSecond> have a fully qualified name like

RawRabbit.IntegrationTests.TestMessages.GenericResponse`2[[RawRabbit.IntegrationTests.TestMessages.First, RawRabbit.IntegrationTests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[RawRabbit.IntegrationTests.TestMessages.Second, RawRabbit.IntegrationTests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]

The type name is sent in the basic properties of the message, and then used to create a Type instance that will be used when deserializing the message. The problem here is that Version, Culture and PublicKeyToken are present. If the version is wrong, we might not be able to create the type instance (even though the class itself is identical between versions). However, it is enough to have type name and assembly name to create the type instance. That is, this string (should) be enough:

RawRabbit.IntegrationTests.TestMessages.GenericResponse`2[[RawRabbit.IntegrationTests.TestMessages.First, RawRabbit.IntegrationTests],[RawRabbit.IntegrationTests.TestMessages.Second, RawRabbit.IntegrationTests]]

In BasicPropertiesProvider.cs, we should have a strategy to create type such that

  • It does not include version, culture and public key token for main class or generic arguments
  • It should do this recursively, GenericMessage<GenericArgument<NestedGeneric<NestedAgain>>> should contain no version, culture or public key token
@Originalutter
Copy link
Contributor

In your example string

RawRabbit.IntegrationTests.TestMessages.GenericResponse`2[[RawRabbit.IntegrationTests.TestMessages.First, RawRabbit.IntegrationTests],[RawRabbit.IntegrationTests.TestMessages.Second, RawRabbit.IntegrationTests]]

do we really need the namespace of the generic type arguments? Since their names already include the namespace I guess the following should be enough

RawRabbit.IntegrationTests.TestMessages.GenericResponse`2[RawRabbit.IntegrationTests.TestMessages.First,RawRabbit.IntegrationTests.TestMessages.Second]

@pardahlman
Copy link
Owner Author

Well @Originalutter -- the generic argument could come from another assembly. So, in order to be sure that we can create the type, we need the Assembly name to.

@Originalutter
Copy link
Contributor

I see @pardahlman, is this also possible for the outer type? In this case that is, could GenericResponse come from another assembly and if so, how would that be presented?

@pardahlman
Copy link
Owner Author

That is correct, so each type should have TypeName, AssemblyName where TypeName is the full name including name space. If the type is generic, then the generic arguments will be within '[TypeName, AssemblyName] and (I assume) if that generic type is in itself generic it too would specified with type name and assembly name.

For the example with GenericResponse, it Should be something like

RawRabbit.IntegrationTests.TestMessages.GenericResponse`2[[RawRabbit.IntegrationTests.TestMessages.First, RawRabbit.IntegrationTests],[RawRabbit.IntegrationTests.TestMessages.Second, RawRabbit.IntegrationTests]], RawRabbit.IntegrationTests

Originalutter pushed a commit to Originalutter/RawRabbit that referenced this issue Mar 3, 2016
Originalutter pushed a commit to Originalutter/RawRabbit that referenced this issue Mar 3, 2016
Originalutter pushed a commit to Originalutter/RawRabbit that referenced this issue Mar 3, 2016
Originalutter pushed a commit to Originalutter/RawRabbit that referenced this issue Mar 3, 2016
Originalutter pushed a commit to Originalutter/RawRabbit that referenced this issue Mar 3, 2016
pardahlman pushed a commit that referenced this issue Mar 5, 2016
So that we are compatible with RawRabbit > 1.8.12
pardahlman pushed a commit that referenced this issue Mar 5, 2016
pardahlman pushed a commit that referenced this issue Mar 5, 2016
And by doing so, no one uses the operation base anymore, so it's gone baby,
gone.
@pardahlman
Copy link
Owner Author

@Originalutter I've been rewriting large portions of Requester and Responder in ticket #64 and done some extensive testing in the stable branch for it. I'm inclined to push this to release 1.8.13.

@pardahlman
Copy link
Owner Author

This issue will be part of 1.8.13

pardahlman pushed a commit that referenced this issue Mar 16, 2016
pardahlman pushed a commit that referenced this issue Mar 16, 2016
pardahlman pushed a commit that referenced this issue Mar 16, 2016
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

2 participants