|
31 | 31 | import io.rsocket.metadata.CompositeMetadata;
|
32 | 32 | import io.rsocket.metadata.RoutingMetadata;
|
33 | 33 | import io.rsocket.metadata.WellKnownMimeType;
|
| 34 | +import org.apache.commons.logging.Log; |
| 35 | +import org.apache.commons.logging.LogFactory; |
34 | 36 |
|
35 | 37 | import org.springframework.core.ParameterizedTypeReference;
|
36 | 38 | import org.springframework.core.ResolvableType;
|
|
52 | 54 | */
|
53 | 55 | public class DefaultMetadataExtractor implements MetadataExtractor, MetadataExtractorRegistry {
|
54 | 56 |
|
| 57 | + private static final Log logger = LogFactory.getLog(DefaultMetadataExtractor.class); |
| 58 | + |
| 59 | + |
55 | 60 | private final List<Decoder<?>> decoders;
|
56 | 61 |
|
57 | 62 | private final Map<String, EntryExtractor<?>> registrations = new HashMap<>();
|
@@ -119,6 +124,10 @@ public Map<String, Object> extract(Payload payload, MimeType metadataMimeType) {
|
119 | 124 | else {
|
120 | 125 | extractEntry(payload.metadata().slice(), metadataMimeType.toString(), result);
|
121 | 126 | }
|
| 127 | + if (logger.isDebugEnabled()) { |
| 128 | + logger.debug("Values extracted from metadata: " + result + |
| 129 | + " with registrations for " + this.registrations.keySet() + "."); |
| 130 | + } |
122 | 131 | return result;
|
123 | 132 | }
|
124 | 133 |
|
@@ -175,7 +184,7 @@ public void extract(ByteBuf content, Map<String, Object> result) {
|
175 | 184 |
|
176 | 185 | @Override
|
177 | 186 | public String toString() {
|
178 |
| - return "mimeType=" + this.mimeType + ", targetType=" + this.targetType; |
| 187 | + return "\"" + this.mimeType + "\" => " + this.targetType; |
179 | 188 | }
|
180 | 189 | }
|
181 | 190 |
|
|
0 commit comments