/**
 * 
 */
package org.springblade.etl.connector.source.config;

import java.util.Map;

import org.springblade.etl.connector.base.SeatunnelConfig;

import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author wookvn
 *
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class SeatunnelKafkaSourceConfig extends SeatunnelConfig {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@JsonProperty(value = "topic", required = true)
	private String topic;
	
	private Boolean pattern = false;
	
	@JsonProperty("commit_on_checkpoint")
	private Boolean commitOnCheckpoint = true;
	
	@JsonProperty(value = "bootstrap.servers", required = true)
	private String bootstrapServers;
	
	/**
	 * earliest、group_offsets、latest、specific_offsets、timestamp
	 */
	@JsonProperty(value = "start_mode", required = true)
	private String startMode = "earliest";
	
	private SchemaField schema;
	
	@JsonProperty("start_mode.offsets")
	private Map<String, Long> startModeOffsets;
	
	@JsonProperty("start_mode.timestamp")
	private Long startModeTimestamp;
	
	/**
	 * fail、skip
	 */
	@JsonProperty("format_error_handle_way")
	private String errorHandleWay = "fail";

	@JsonProperty("consumer.group")
	private String consumerGroup = "platomix-consumer-group";
	/**
	 * json、text
	 */
	private String format = "json";
	
	@JsonProperty("field_delimiter")
	private String fieldDelimiter;
	
	@JsonProperty("kafka.config")
	private Map<String, String> kafkaConfig;
}
