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 org.springframework.pulsar.support.header.AbstractPulsarHeaderMapper
logger
-
Constructor Summary
ConstructorDescriptionConstruct 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 String
toPulsarHeaderValue
(String name, Object value, Object context) Determine the Pulsar header value to use for a Spring Messaging header.protected Object
toSpringHeaderValue
(String headerName, String rawHeader, Object context) Determine the Spring Messaging header value to use for a Pulsar header.Methods inherited from class org.springframework.pulsar.support.header.AbstractPulsarHeaderMapper
matchesForInbound, matchesForOutbound, toPulsarHeaders, toPulsarHeadersOnCompleted, toPulsarHeadersOnStarted, toSpringHeaders, toSpringHeadersOnCompleted, toSpringHeadersOnStarted
-
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
Description copied from class:AbstractPulsarHeaderMapper
Determine the Pulsar header value to use for a Spring Messaging header.- Specified by:
toPulsarHeaderValue
in classAbstractPulsarHeaderMapper<Object,
Object> - Parameters:
name
- the Spring Messaging header namevalue
- the Spring Messaging header valuecontext
- the optional context used for the mapping invocation- Returns:
- the Pulsar header value to use
-
toSpringHeaderValue
Description copied from class:AbstractPulsarHeaderMapper
Determine the Spring Messaging header value to use for a Pulsar header.- Specified by:
toSpringHeaderValue
in 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
-