Class ToStringPulsarHeaderMapper
java.lang.Object
org.springframework.pulsar.support.header.AbstractPulsarHeaderMapper<Object,Object>
org.springframework.pulsar.support.header.ToStringPulsarHeaderMapper
- All Implemented Interfaces:
PulsarHeaderMapper
A
PulsarHeaderMapper that converts header values using simple 'toString'.- Author:
- Chris Bono
-
Field Summary
Fields inherited from class AbstractPulsarHeaderMapper
logger -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a 'ToString' mapper that will match all inbound headers and all outbound headers (except internal framework headers and id/timestamp).ToStringPulsarHeaderMapper(List<String> inboundPatterns, List<String> outboundPatterns) Construct a 'ToString' mapper that will match the supplied inbound and outbound patterns. -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable StringtoPulsarHeaderValue(String name, @Nullable Object value, @Nullable Object context) Determine the Pulsar header value to use for a Spring Messaging header.protected ObjecttoSpringHeaderValue(String headerName, String rawHeader, @Nullable Object context) Determine the Spring Messaging header value to use for a Pulsar header.
-
Constructor Details
-
ToStringPulsarHeaderMapper
public ToStringPulsarHeaderMapper()Construct a 'ToString' mapper that will match all inbound headers and all outbound headers (except internal framework headers and id/timestamp). -
ToStringPulsarHeaderMapper
Construct a 'ToString' mapper that will match the supplied inbound and outbound patterns.- Parameters:
inboundPatterns- the inbound patterns to match - or empty map to match alloutboundPatterns- the outbound patterns to match - or empty to match all (except internal framework headers and id/timestamp)
-
-
Method Details
-
toPulsarHeaderValue
protected @Nullable String toPulsarHeaderValue(String name, @Nullable Object value, @Nullable Object context) Description copied from class:AbstractPulsarHeaderMapperDetermine the Pulsar header value to use for a Spring Messaging header.- Specified by:
toPulsarHeaderValuein classAbstractPulsarHeaderMapper<Object,Object> - Parameters:
name- the Spring Messaging header namevalue- the Spring Messaging header value, possibly nullcontext- the optional context used for the mapping invocation- Returns:
- the Pulsar header value to use
-
toSpringHeaderValue
Description copied from class:AbstractPulsarHeaderMapperDetermine the Spring Messaging header value to use for a Pulsar header.- Specified by:
toSpringHeaderValuein classAbstractPulsarHeaderMapper<Object,Object> - Parameters:
headerName- the Pulsar header namerawHeader- the Pulsar header valuecontext- the optional context used for the mapping invocation- Returns:
- the Spring Messaging header value to use
-