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

Refactored serialization feature to be aligned with transport #3310

Merged
merged 1 commit into from
Feb 2, 2016

Conversation

SzymonPobiega
Copy link
Member

  • Made feature class not abstract
  • Removed DI usages across the feature
  • Removed the intermediate ConfigureSerialization-inherited classes
  • Changed the API for SerializationDefinition

Associated Doco PR

@SzymonPobiega SzymonPobiega self-assigned this Jan 11, 2016
@SzymonPobiega SzymonPobiega added this to the 6.0.0 milestone Jan 11, 2016
@hmemcpy
Copy link
Contributor

hmemcpy commented Jan 11, 2016

Bye bye ConfigureSerialization :)

@hmemcpy
Copy link
Contributor

hmemcpy commented Jan 12, 2016

@SzymonPobiega I'm working on the samples: Particular/docs.particular.net#1020
Do I need your PR for this? Are you changing the public API I need to implement external serialization features?

@SzymonPobiega
Copy link
Member Author

The API for registering a custom serializer is different now (requires a SerializerDefinition class in addition to implementation of IMessageSerializer). Other stuff is the same. I'll wait for you to update the samples to current V6 and then I'll create my pull to accompany this PR.

@hmemcpy
Copy link
Contributor

hmemcpy commented Jan 12, 2016

We're in a deadlock :D nice!
Will send a samples PR soon.

@SzymonPobiega
Copy link
Member Author

Still a WIP, but @Particular/nservicebus-maintainers you can start reviewing. I might need to form a TF to take it further though. Currently will focus on doco PR and then spike another attempt to kill the message mapper.

@danielmarbach
Copy link
Contributor

I think we should call YAGNI on this right now and focus on getting other things outside the door.

@SzymonPobiega
Copy link
Member Author

@danielmarbach then I call it non-WIP and pause here. Consider this one done in terms of code, syncing with @hmemcpy with regards to doco updates now.

@SzymonPobiega SzymonPobiega changed the title [WIP] Refactored serialization feature to be aligned with transport. Refactored serialization feature to be aligned with transport. Jan 27, 2016
@danielmarbach
Copy link
Contributor

Cheecky ;) Then I like it 💃 Can you rebase

@SzymonPobiega
Copy link
Member Author

Aye aye, sir!

@johnsimons
Copy link
Member

Why should this be done for v6.0?

@SzymonPobiega
Copy link
Member Author

@johnsimons because I was bored on Koh Samet ;-)

@andreasohlund andreasohlund changed the title Refactored serialization feature to be aligned with transport. Refactored serialization feature to be aligned with transport Jan 28, 2016
@SzymonPobiega
Copy link
Member Author

@Particular/nservicebus-maintainers can you please take a look at this one?

@@ -56,7 +57,7 @@ public DefaultServer(List<Type> typesToInclude)

if (serializer != null)
{
builder.UseSerialization(Type.GetType(serializer));
builder.UseSerialization((SerializationDefinition)Activator.CreateInstance(Type.GetType(serializer, true)));
Copy link
Contributor

Choose a reason for hiding this comment

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

This is ugly but I see there is no other way around because you want to deprecate

public static void UseSerialization(this NServiceBus.BusConfiguration config, System.Type serializerType)

I first thought we can repurpose the above method to:

public static void UseSerialization(this NServiceBus.BusConfiguration config, System.Type serializerDefinitionType)

But that would be strange

@andreasohlund
Copy link
Member

@SzymonPobiega this will affect the downstream serializers right? (in that case we need to line up pull for them as well?)

@danielmarbach
Copy link
Contributor

Yes at least this one

https://github.com/Particular/NServiceBus.Newtonsoft.Json

This rest is not officially owned by us

@danielmarbach
Copy link
Contributor

I really like it!

@mauroservienti
Copy link
Member

should we consider this in scope for V6? if yes, could you please ad the expected Tag: Core V6 label? cheers.

context.Pipeline.Register("SerializeMessageConnector", new SerializeMessageConnector(defaultSerializer, messageMetadataRegistry), "Converts a logical message into a physical message");

context.Container.ConfigureComponent(_ => mapper, DependencyLifecycle.SingleInstance);
context.Container.ConfigureComponent(_ => messageMetadataRegistry, DependencyLifecycle.SingleInstance);
Copy link
Contributor

Choose a reason for hiding this comment

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

For backwards compat reasons should we add?

context.Container.ConfigureComponent(_ => defaultSerializer, DependencyLifecycle.SingleInstance);

// cc @Scooletz

@danielmarbach
Copy link
Contributor

danielmarbach commented Jan 29, 2016 via email

SzymonPobiega referenced this pull request in Particular/NServiceBus.AzureStorageQueues Jan 29, 2016
…ore's message serializer and there's no way TransportDefinition can access it.
@SzymonPobiega
Copy link
Member Author

@Scooletz
Copy link
Contributor

Scooletz commented Feb 1, 2016

I had a discussion with @danielmarbach & @andreasohlund was summarized in Particular/NServiceBus.AzureStorageQueues#29. I'm going to ensure wire compatibility with tests on ASQ end and detect by ReadOnlySettings what kind of serializer is used in Core. Then provide either proper impl or throw a configuration exception.
This removes any requirements from this PR. I'll need only the name of the serializer in the settings.

@SzymonPobiega
Copy link
Member Author

Yupi!

@SzymonPobiega
Copy link
Member Author

Rabased, squashed and changed public configure to protected internal. If the ATTs pass I think it is ready to be merged.

@danielmarbach
Copy link
Contributor

See my last comment about obsoletes

@SzymonPobiega
Copy link
Member Author

@danielmarbach obsoletes added. I didn't have to rename because internal types are in the root namespace.

@SzymonPobiega
Copy link
Member Author

Ping

danielmarbach added a commit that referenced this pull request Feb 2, 2016
Refactored serialization feature to be aligned with transport
@danielmarbach danielmarbach merged commit 2c142d5 into develop Feb 2, 2016
@danielmarbach danielmarbach deleted the refactor-serialization-config branch February 2, 2016 13:18
@SimonCropp
Copy link
Contributor

@danielmarbach @SzymonPobiega so this broke docs in a way that i dont know how to work around. specifically this sample http://docs.particular.net/samples/pipeline/multi-serializer/#code-walk-through-serialization-mapper can you let me know how i tweak that sample to get it working

CC @indualagarsamy

@danielmarbach
Copy link
Contributor

Since this has an associated doco PR, it fulfilled all the necessary requirements to be able to get merge.

@SimonCropp
Copy link
Contributor

@danielmarbach that PR did not touch the sample in question

@danielmarbach
Copy link
Contributor

If @SzymonPobiega doesn't find time until tomorrow I can have s look after
tomorrow after my day off

On Wednesday, February 10, 2016, Simon Cropp notifications@github.com
wrote:

@danielmarbach https://github.com/danielmarbach that PR did not touch
the sample in question


Reply to this email directly or view it on GitHub
#3310 (comment)
.

@SzymonPobiega
Copy link
Member Author

Looking at it now.

@SimonCropp
Copy link
Contributor

@SzymonPobiega thanks

@andreasohlund
Copy link
Member

Here is the proposed core fix #3444 (comment)

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

Successfully merging this pull request may close these issues.

None yet

8 participants