I am playing with rsocket-java.
Is there any way to send custom object via metadata.?
I saw this code sample in their documenation.
RSocketStrategies strategies = RSocketStrategies.builder()
.metadataExtractorRegistry(registry -> {
registry.metadataToExtract(fooMimeType, Foo.class, "foo");
// ...
})
.build();
return strategies;
I tried something similar.
@Bean
public RSocketStrategies strategies(){
RSocketStrategies strategies = RSocketStrategies.builder()
.metadataExtractorRegistry(registry -> {
registry.metadataToExtract(someMimeType, Something.class, "something");
// ...
})
.build();
return strategies;
}
but getting this exception.
Caused by: java.lang.IllegalArgumentException: No decoder for messaging/x.something and com.demo.Something
Should I create my own decoder for each and every object type?
Please do not show String examples. Question is for passing custom objects.
You should be registering this bean somewhere, see https://docs.spring.io/spring-integration/docs/current/reference/html/rsocket.html
But it isn't possible to answer with just the minimal snippet you have provided. Can you provide a runnable example or more context in your example?