diff --git a/spring-messaging/src/main/java/org/springframework/messaging/rsocket/DefaultMetadataExtractor.java b/spring-messaging/src/main/java/org/springframework/messaging/rsocket/DefaultMetadataExtractor.java
index 6e320bd5d0..90b76a3787 100644
--- a/spring-messaging/src/main/java/org/springframework/messaging/rsocket/DefaultMetadataExtractor.java
+++ b/spring-messaging/src/main/java/org/springframework/messaging/rsocket/DefaultMetadataExtractor.java
@@ -38,13 +38,11 @@ import org.springframework.lang.Nullable;
import org.springframework.util.MimeType;
/**
- * Default {@link MetadataExtractor} implementation that relies on {@link Decoder}s
- * to deserialize the content of metadata entries.
- *
+ * Default {@link MetadataExtractor} implementation that relies on
+ * {@link Decoder}s to deserialize the content of metadata entries.
*
By default only {@code "message/x.rsocket.routing.v0""} is extracted and
- * saved under {@link MetadataExtractor#ROUTE_KEY}. Use the
- * {@code metadataToExtract} methods to specify other metadata mime types of
- * interest to extract.
+ * saved under {@link MetadataExtractor#ROUTE_KEY}. Use {@code metadataToExtract}
+ * methods to specify other metadata mime types of interest to extract.
*
* @author Rossen Stoyanchev
* @since 5.2
diff --git a/spring-messaging/src/main/java/org/springframework/messaging/rsocket/DefaultRSocketRequester.java b/spring-messaging/src/main/java/org/springframework/messaging/rsocket/DefaultRSocketRequester.java
index 8fac1b1593..8ce78b4cf3 100644
--- a/spring-messaging/src/main/java/org/springframework/messaging/rsocket/DefaultRSocketRequester.java
+++ b/spring-messaging/src/main/java/org/springframework/messaging/rsocket/DefaultRSocketRequester.java
@@ -49,18 +49,13 @@ import org.springframework.util.MimeType;
import org.springframework.util.ObjectUtils;
/**
- * Default, package-private {@link RSocketRequester} implementation.
+ * Default implementation of {@link RSocketRequester}.
*
* @author Rossen Stoyanchev
* @since 5.2
*/
final class DefaultRSocketRequester implements RSocketRequester {
- static final MimeType COMPOSITE_METADATA = new MimeType("message", "x.rsocket.composite-metadata.v0");
-
- static final MimeType ROUTING = new MimeType("message", "x.rsocket.routing.v0");
-
-
/** For route variable replacement. */
private static final Pattern VARS_PATTERN = Pattern.compile("\\{([^/]+?)\\}");
@@ -114,7 +109,7 @@ final class DefaultRSocketRequester implements RSocketRequester {
public RequestSpec route(String route, Object... vars) {
Assert.notNull(route, "'route' is required");
route = expand(route, vars);
- return new DefaultRequestSpec(route, metadataMimeType().equals(COMPOSITE_METADATA) ? ROUTING : null);
+ return new DefaultRequestSpec(route, isCompositeMetadata() ? MetadataExtractor.ROUTING : null);
}
private static String expand(String route, Object... vars) {
@@ -134,6 +129,10 @@ final class DefaultRSocketRequester implements RSocketRequester {
return sb.toString();
}
+ private boolean isCompositeMetadata() {
+ return metadataMimeType().equals(MetadataExtractor.COMPOSITE_METADATA);
+ }
+
@Override
public RequestSpec metadata(Object metadata, @Nullable MimeType mimeType) {
return new DefaultRequestSpec(metadata, mimeType);
@@ -154,16 +153,12 @@ final class DefaultRSocketRequester implements RSocketRequester {
private final Map