Commit 76daa775 authored by Simhadri Guntreddi's avatar Simhadri Guntreddi

Delete ConfigProps.java

parent f68a108e
package com.safeway.epe.Config;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.boot.web.client.RootUriTemplateHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpHeaders;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriTemplateHandler;
@Data
@Configuration
@ConfigurationProperties(prefix = "kafka.producer")
public class ConfigProps {
private String offerTransactionRecordTopic;
@Value("${schema.api.baseurl}")
private String schemaBaseUrl;
private static final String USER_AGENT = "Producer";
private static final String APPLICATION_KAFKA_JSON_VALUE = "application/vnd.kafka.json.v2+json";
private static final String ACCEPT_APPLICATION_KAFKA_JSON_VALUE = "application/vnd.kafka.v2+json";
@Bean
RestTemplate restTemplate(RestTemplateBuilder builder) {
UriTemplateHandler uriTemplateHandler = new RootUriTemplateHandler(schemaBaseUrl);
return builder
.uriTemplateHandler(uriTemplateHandler)
.defaultHeader(HttpHeaders.USER_AGENT, USER_AGENT)
.defaultHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_KAFKA_JSON_VALUE)
.defaultHeader(HttpHeaders.ACCEPT, ACCEPT_APPLICATION_KAFKA_JSON_VALUE)
.build();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment