Commit ca2521e1 authored by Simhadri Guntreddi's avatar Simhadri Guntreddi

Merge branch 'master' into 'Feign_Client_Branch'

# Conflicts:
#   build.gradle
#   gradle/wrapper/gradle-wrapper.properties
#   src/main/java/com/safeway/epe/StoreProducerApplication.java
#   src/main/java/com/safeway/epe/controller/TransactionController.java
#   src/main/java/com/safeway/epe/domain/TransactionRecorder.java
#   src/main/java/com/safeway/epe/service/ProducerService.java
#   src/main/java/com/safeway/epe/service/TransactionService.java
#   src/main/java/com/safeway/epe/service/TransactionServiceImpl.java
#   src/test/java/com/safeway/epe/StoreProducerApplicationTests.java
parents d88f6361 6ddb2d93
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();
}
}
{
"name": "TransactionRecorder",
"type": "record",
"namespace": "com.safeway.epe.domain",
"fields": [
{
"name": "uuid",
"type": "string"
},
{
"name": "offertransactionresponse",
"type": "string"
},
{
"name": "offers",
"type": "string"
}
]
}
\ No newline at end of file
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