Shuttle / Shuttle.Esb

A highly extensible service bus implementation.
http://shuttle.github.io/shuttle-esb/
BSD 3-Clause "New" or "Revised" License
95 stars 30 forks source link

Investigate an `IMessageTypeResolver` #15

Closed eben-roux closed 8 years ago

eben-roux commented 8 years ago

Currently the AssemblyQualifiedName is used to instantiate the message. However, for updates to the message assembly any "old" messages would not instantiate as that type is not available.

An interim solution may be the following (untested) to be used in the DeserializeMessageObserver:

http://stackoverflow.com/questions/1159354/ignoring-version-in-an-assembly-qualified-name-passed-to-type-gettype

Type type = Type.GetType(typeName, AssemblyResolver, null);

private static System.Reflection.Assembly AssemblyResolver(System.Reflection.AssemblyName assemblyName)
{
    assemblyName.Version = null;
    return System.Reflection.Assembly.Load(assemblyName);
}
eben-roux commented 8 years ago

This can probably be handled using binding redirects.