Top Description Fields Methods
org.springframework.messaging.rsocket

public Interface MetadataExtractor

Known Direct Implementers
org.springframework.messaging.rsocket.DefaultMetadataExtractor
Imports
java.util.Map, io.rsocket.Payload, org.springframework.core.codec.DecodingException, org.springframework.util.MimeType

Strategy to extract a map of value(s) from Payload metadata, which could be composite metadata with multiple entries. Each metadata entry is decoded based on its MimeType and a name is assigned to the decoded value. The resulting name-value pairs can be added to the headers of a Message.
Author
Rossen Stoyanchev
Since
5.2
See Also
MetadataExtractorRegistry

Field Summary

Modifier and TypeField and Description
public static final String
ROUTE_KEY

The key to assign to the extracted "route" of the payload.

Method Summary

Modifier and TypeMethod and Description
public Map<String, Object>

Returns:

name values pairs extracted from the metadata
extract
(Payload
the payload whose metadata should be read
payload
,
MimeType
the metadata MimeType for the connection.
metadataMimeType
)

Extract a map of values from the given Payload metadata.

Field Detail

ROUTE_KEYback to summary
public static final String ROUTE_KEY

The key to assign to the extracted "route" of the payload.

Method Detail

extractback to summary
public Map<String, Object> extract(Payload payload, MimeType metadataMimeType)

Extract a map of values from the given Payload metadata. The Payload "route", if present, should be saved under ROUTE_KEY.

Parameters
payload:Payload

the payload whose metadata should be read

metadataMimeType:MimeType

the metadata MimeType for the connection.

Returns:Map<String, Object>

name values pairs extracted from the metadata

Exceptions
DecodingException:
if the metadata cannot be decoded
IllegalArgumentException:
if routing metadata cannot be decoded