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
Now RSocket adopts "message/x.rsocket.composite-metadata.v0" and "message/x.rsocket.routing.v0" as metadata MimeType. Please consider add "text/plain" as metadata Mime type, some cases, the text just as route key. If possible, could "application/json" be added as metadata Mime type and routing key is "routing" field like following:
{
"routing": "chat_room",
....
}
Both "text/plain" and "application/json" are friendly and easy for Javascript in browser.
private String getDestination(Payload payload) {
if (this.metadataMimeType.equals(DefaultRSocketRequester.COMPOSITE_METADATA)) {
CompositeMetadata metadata = new CompositeMetadata(payload.metadata(), false);
for (CompositeMetadata.Entry entry : metadata) {
String mimeType = entry.getMimeType();
if (DefaultRSocketRequester.ROUTING.toString().equals(mimeType)) {
return entry.getContent().toString(StandardCharsets.UTF_8);
}
}
return "";
}
else if (this.metadataMimeType.equals(DefaultRSocketRequester.ROUTING)) {
return payload.getMetadataUtf8();
}
// Should not happen (given constructor assertions)
throw new IllegalArgumentException("Unexpected metadataMimeType");
}
The text was updated successfully, but these errors were encountered:
linux-china
changed the title
RSocket Metadata Mimetype text/plain support
RSocket Metadata Mimetype "text/plain" and "application/json" support
Jun 19, 2019
Now RSocket adopts "message/x.rsocket.composite-metadata.v0" and "message/x.rsocket.routing.v0" as metadata MimeType. Please consider add "text/plain" as metadata Mime type, some cases, the text just as route key. If possible, could "application/json" be added as metadata Mime type and routing key is "routing" field like following:
Both "text/plain" and "application/json" are friendly and easy for Javascript in browser.
https://github.com/spring-projects/spring-framework/blob/master/spring-messaging/src/main/java/org/springframework/messaging/rsocket/MessagingRSocket.java
The text was updated successfully, but these errors were encountered: