public class PubSubHeaderMapper extends Object implements org.springframework.integration.mapping.HeaderMapper<Map<String,String>>
PubsubMessage
s to
Message
s and vice-versa.
By default, filters out headers called "id", "timestamp", "gcp_pubsub_acknowledgement" or
"nativeHeaders" on the Message
to
PubsubMessage
header conversion.
Constructor and Description |
---|
PubSubHeaderMapper() |
Modifier and Type | Method and Description |
---|---|
void |
fromHeaders(org.springframework.messaging.MessageHeaders messageHeaders,
Map<String,String> pubsubMessageHeaders)
Generate headers in
PubsubMessage format from
MessageHeaders . |
void |
setInboundHeaderPatterns(String... inboundHeaderPatterns)
Set the patterns of the headers to be mapped in
toHeaders(Map) . |
void |
setOutboundHeaderPatterns(String... outboundHeaderPatterns)
Set the patterns of the headers to be mapped in
fromHeaders(MessageHeaders, Map) . |
Map<String,Object> |
toHeaders(Map<String,String> pubsubMessageHeaders)
Generate headers in
Message format from
Map<String, String> . |
public void setOutboundHeaderPatterns(String... outboundHeaderPatterns)
fromHeaders(MessageHeaders, Map)
.
First patterns take precedence.outboundHeaderPatterns
- header patterns to be mappedpublic void setInboundHeaderPatterns(String... inboundHeaderPatterns)
toHeaders(Map)
.
First patterns take precedence.inboundHeaderPatterns
- header patterns to be mappedpublic void fromHeaders(org.springframework.messaging.MessageHeaders messageHeaders, Map<String,String> pubsubMessageHeaders)
PubsubMessage
format from
MessageHeaders
. All headers are converted into strings.
Will map only the headers that match the patterns in outboundHeaderPatternsMap
.
Copyright © 2021. All rights reserved.