Comments (12)
We don't want to support/encourage the use of untyped data in message schema.
Can you explain what information your moving around here and what the context of the message is?
from nservicebus.
Hi,
I have generic message class that contains three common parameters with specific meaning and dictionary for all other needs. I suppose I could use inheritance and name all parameters but I obviously didn't :-). Anyway, using dictionary should be either explicitly forbidden or fixed. This way it just doesn't work and that is confusing.
from nservicebus.
Dictionaries are supported - it's just that generics of object aren't. For example, you can use Dictionary of string and string.
from nservicebus.
I just wanted to point out that Dictionary of string and object serialization works and deserialization fails silently. However you look at it, that isn't good behaviour.
from nservicebus.
Sorry, I pressed wrong button.
from nservicebus.
Udi: What should we do here ? a better exception?
from nservicebus.
Yes, a better exception - I think we can generalize the check to yell about anything which is of the type "object".
from nservicebus.
Joseph:
Add a test: When_serializing_a_property_with_idictionary_object
It should throw an exception saying that its not supported
And make the above change
from nservicebus.
For IDictionary the Test and Exception is already there
Here is the Log
[exec] Errors and Failures:
[exec] 1) Test Error : NServiceBus.Serializers.XML.Test.SerializerTests.Comparison
[exec] System.NotSupportedException : IDictionary<T, K> is not a supported property type for serialization, use
Dictionary<T,K> instead. Type: NServiceBus.Serializers.XML.Test.IM2 Property: AnyFoos. Consider using a concrete Dictionary<T, K> instead.
Do we need same kind of exception while using Dictionary<object, object> ?
from nservicebus.
Yes, Dictionary<string,string> is supported, it's the use of "object" that is not supported.
Add the following test:
When_using_a_dictionary_with_an_object_key_or_value
It Should throw an exception telling the user that untyped dictionaries is not supported
/Andreas
http://twitter.com/andreasohlund
Date: Sat, 13 Aug 2011 23:41:33 -0700
From: [email protected]
To: [email protected]
Subject: Re: [NServiceBus] Dictionary<string,object> deserialization problem (#65)For IDictionary the Test and Exception is already there
Here is the Log
[exec] Errors and Failures:
[exec] 1) Test Error : NServiceBus.Serializers.XML.Test.SerializerTests.Comparison
[exec] System.NotSupportedException : IDictionary<T, K> is not a supported property type for serialization, use
Dictionary<T,K> instead. Type: NServiceBus.Serializers.XML.Test.IM2 Property: AnyFoos. Consider using a concrete Dictionary<T, K> instead.Do we need same kind of exception while using Dictionary<object, object> ?
Reply to this email directly or view it on GitHub:
#65 (comment)
from nservicebus.
Please Look for the fix and Unit test cases.
from nservicebus.
Looks good (I've made a minor comment in the commit)
from nservicebus.
Related Issues (20)
- Stream-based data bus implementation HOT 1
- Premature ITransportAddressResolver access corrupts service HOT 1
- AssemblyScanner cannot find concrete serialization types from unobtrusive assembly HOT 14
- It is unnecessarily hard to send messages from recoverability
- Spans and activities on the consumer are not created if the producer does not have OpenTelemetry enabled HOT 12
- ContextPropagation throws an ArgumentNullException when the Activity.Current.Baggage contains a key with value null HOT 4
- Reduce dependencies for net 6 HOT 1
- AssemblyScanner duplicated assembly loading with possible System.IO.FileLoadException: Assembly with same name is already loaded HOT 7
- Allow users to control child trace span creation
- The automatic rate-limiting feature can unknowingly cripple endpoints if there's a bug in the user's system
- Remove polyfil dependencies HOT 3
- For OpenTelemetry metrics, allow Func<string, string> to be specified to trim the enclosed message types tag HOT 6
- Saga and outbox persistence that uses Entity Framework
- Overriding the host name does not work consistently
- AssemblyScanner finds private classes HOT 1
- Obsolete NServiceBus.Logging in favor of Microsoft.Extensions.Logging
- DefineCriticalErrorAction access to IServiceProvider HOT 3
- Support for Azure Event Hubs (Kafka) HOT 1
- Support for Azure Event Grid (MQTT)
- Messages cannot be sent from Windows to Linux using the file share data bus HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nservicebus.