You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where ProtobufMessageSerializer is a custom type that can handle any protobuf message. Unfortunately, the code does not compile because the constructor of DelegatingByTypeSerializer and the internal member variables all expect to see the raw Serializer type. It is, of course, possible to tweak the code to:
Our project uses the retryable topics feature, @SendTo and the ErrorHandlingDeserializer class to intercept potential poison pill messages. They are, however, extremely unlikely to happen, so I'd like to make sure that the first delegate that's checked at runtime is the base protobuf Message class. As far as I know, the only way to guarantee the iteration order is to explicitly populate a LinkedHashMap, but creating such a map requires warning suppression.
The text was updated successfully, but these errors were encountered:
Fixesspring-projects#2140
Improve some internal code around generics in the `DelegatingByTypeSerializer`.
This allows us to use a dedicated external `Map` variable for the delegates
Fixes#2140
Improve some internal code around generics in the `DelegatingByTypeSerializer`.
This allows us to use a dedicated external `Map` variable for the delegates
Expected Behavior
I've tried using the newly added assignable types support and, initially, wrote the following code:
Where
ProtobufMessageSerializer
is a custom type that can handle any protobuf message. Unfortunately, the code does not compile because the constructor ofDelegatingByTypeSerializer
and the internal member variables all expect to see the rawSerializer
type. It is, of course, possible to tweak the code to:But then a warning is raised to highlight the usage of raw types. Generally we treat this warning type as an error.
Current Behavior
I am basically forced to do this instead to silence the warning:
Context
Our project uses the retryable topics feature,
@SendTo
and theErrorHandlingDeserializer
class to intercept potential poison pill messages. They are, however, extremely unlikely to happen, so I'd like to make sure that the first delegate that's checked at runtime is the base protobufMessage
class. As far as I know, the only way to guarantee the iteration order is to explicitly populate aLinkedHashMap
, but creating such a map requires warning suppression.The text was updated successfully, but these errors were encountered: