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
we're using MessageConverter to convert incoming messages to a custom object. Specifically we use canConvert to check the type of the message's payload. However we've found that the Converter is cached (see
for (MessageConverterconv : getSortedInstances(converters)) {
if (conv.canConvert(o, injectedPayloadType)) {
actual = conv;
returnactual.convert(o, injectedPayloadType);
}
}
).
In our case canConvert returns true if the message's payload is of type byte-array and convert is called for subsequent messages where payload is null.
I was wondering why the message is presented to the canConvert method, if we may end up calling convert for different messages.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
we're using MessageConverter to convert incoming messages to a custom object. Specifically we use canConvert to check the type of the message's payload. However we've found that the Converter is cached (see
smallrye-reactive-messaging/smallrye-reactive-messaging-provider/src/main/java/io/smallrye/reactive/messaging/providers/helpers/ConverterUtils.java
Lines 44 to 46 in bd75189
smallrye-reactive-messaging/smallrye-reactive-messaging-provider/src/main/java/io/smallrye/reactive/messaging/providers/helpers/ConverterUtils.java
Lines 53 to 59 in bd75189
In our case canConvert returns true if the message's payload is of type byte-array and convert is called for subsequent messages where payload is null.
I was wondering why the message is presented to the canConvert method, if we may end up calling convert for different messages.
Beta Was this translation helpful? Give feedback.
All reactions