
com.google.cloud.spring.pubsub.integration.PubSubHeaderMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-cloud-gcp-pubsub Show documentation
Show all versions of spring-cloud-gcp-pubsub Show documentation
Spring Framework on Google Cloud Pub/Sub Module
The newest version!
/*
* Copyright 2017-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.spring.pubsub.integration;
import com.google.cloud.spring.pubsub.support.GcpPubSubHeaders;
import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;
import org.springframework.integration.history.MessageHistory;
import org.springframework.integration.mapping.HeaderMapper;
import org.springframework.integration.support.utils.PatternMatchUtils;
import org.springframework.messaging.MessageHeaders;
import org.springframework.messaging.support.NativeMessageHeaderAccessor;
import org.springframework.util.Assert;
/**
* Maps headers from {@link com.google.pubsub.v1.PubsubMessage}s to {@link
* org.springframework.messaging.Message}s and vice-versa.
*
* By default, filters out headers called "id", "timestamp", "gcp_pubsub_acknowledgement" or
* "nativeHeaders" on the {@link org.springframework.messaging.Message} to {@link
* com.google.pubsub.v1.PubsubMessage} header conversion.
*/
public class PubSubHeaderMapper implements HeaderMapper
© 2015 - 2025 Weber Informatics LLC | Privacy Policy