org.citrusframework.kafka.message.KafkaMessageConverter Maven / Gradle / Ivy
The newest version!
/*
* Copyright 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
*
* http://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 org.citrusframework.kafka.message;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.citrusframework.context.TestContext;
import org.citrusframework.exceptions.CitrusRuntimeException;
import org.citrusframework.kafka.endpoint.KafkaEndpointConfiguration;
import org.citrusframework.message.Message;
import org.citrusframework.message.MessageConverter;
import org.citrusframework.spi.Resource;
import org.citrusframework.util.FileUtils;
import java.io.IOException;
import java.util.Optional;
/**
* Basic message converter for converting Spring Integration message implementations to Kafka
* messages and vice versa. Converter combines message converting logic and header mapping.
* Usually the message's payload is extracted to the Kafka message payload and default Kafka headers are mapped.
*
* @since 2.8
*/
public class KafkaMessageConverter implements MessageConverter, ProducerRecord
© 2015 - 2025 Weber Informatics LLC | Privacy Policy