@Deprecated public class BinderHeaderMapper extends org.springframework.kafka.support.AbstractKafkaHeaderMapper
KafkaHeaders
are not mapped on outbound messages.
The exceptions are correlation and reply headers for request/reply
messaging.
Header types are added to a special header JSON_TYPES
.Modifier and Type | Class and Description |
---|---|
static class |
BinderHeaderMapper.NonTrustedHeaderType
Deprecated.
Represents a header that could not be decoded due to an untrusted type.
|
Modifier and Type | Field and Description |
---|---|
static String |
JSON_TYPES
Deprecated.
Header name for java types of other headers.
|
Constructor and Description |
---|
BinderHeaderMapper()
Deprecated.
Construct an instance with the default object mapper and default header patterns
for outbound headers; all inbound headers are mapped.
|
BinderHeaderMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Deprecated.
Construct an instance with the provided object mapper and default header patterns
for outbound headers; all inbound headers are mapped.
|
BinderHeaderMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
String... patterns)
Deprecated.
Construct an instance with the provided object mapper and the provided header
patterns for outbound headers; all inbound headers are mapped.
|
BinderHeaderMapper(String... patterns)
Deprecated.
Construct an instance with a default object mapper and the provided header patterns
for outbound headers; all inbound headers are mapped.
|
Modifier and Type | Method and Description |
---|---|
void |
addToStringClasses(String... classNames)
Deprecated.
Add class names that the outbound mapper should perform toString() operations on
before mapping.
|
void |
addTrustedPackages(String... trustedPackages)
Deprecated.
Add packages to the trusted packages list (default
java.util, java.lang ) used
when constructing objects from JSON. |
void |
fromHeaders(org.springframework.messaging.MessageHeaders headers,
org.apache.kafka.common.header.Headers target)
Deprecated.
|
protected com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper()
Deprecated.
Return the object mapper.
|
protected Set<String> |
getToStringClasses()
Deprecated.
Provide direct access to the toString() classes by subclasses.
|
protected Set<String> |
getTrustedPackages()
Deprecated.
Provide direct access to the trusted packages set for subclasses.
|
void |
toHeaders(org.apache.kafka.common.header.Headers source,
Map<String,Object> headers)
Deprecated.
|
protected boolean |
trusted(String requestedType)
Deprecated.
|
public static final String JSON_TYPES
public BinderHeaderMapper()
"!id", "!timestamp" and "*"
. In addition, most of the headers in
KafkaHeaders
are never mapped as headers since they represent data in
consumer/producer records.BinderHeaderMapper(ObjectMapper)
public BinderHeaderMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
"!id", "!timestamp" and "*"
. In addition, most of the headers in
KafkaHeaders
are never mapped as headers since they represent data in
consumer/producer records.objectMapper
- the object mapper.PatternMatchUtils.simpleMatch(String, String)
public BinderHeaderMapper(String... patterns)
"id" and "timestamp"
headers. Note:
most of the headers in KafkaHeaders
are ever mapped as headers since they
represent data in consumer/producer records.patterns
- the patterns.PatternMatchUtils.simpleMatch(String, String)
public BinderHeaderMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper, String... patterns)
"id" and "timestamp"
headers. Note: most
of the headers in KafkaHeaders
are never mapped as headers since they
represent data in consumer/producer records.objectMapper
- the object mapper.patterns
- the patterns.PatternMatchUtils.simpleMatch(String, String)
protected com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
protected Set<String> getTrustedPackages()
protected Set<String> getToStringClasses()
public void addTrustedPackages(String... trustedPackages)
java.util, java.lang
) used
when constructing objects from JSON.
If any of the supplied packages is "*"
, all packages are trusted.
If a class for a non-trusted package is encountered, the header is returned to the
application with value of type BinderHeaderMapper.NonTrustedHeaderType
.trustedPackages
- the packages to trust.public void addToStringClasses(String... classNames)
classNames
- the class names.public void fromHeaders(org.springframework.messaging.MessageHeaders headers, org.apache.kafka.common.header.Headers target)
public void toHeaders(org.apache.kafka.common.header.Headers source, Map<String,Object> headers)
protected boolean trusted(String requestedType)
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.