去除多余的null的key ,修正kafka的broker地址
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
package com.gzzn.omms.msgexchangeapi.config;
|
||||||
|
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class JacksonConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@Primary
|
||||||
|
@ConditionalOnMissingBean(ObjectMapper.class)
|
||||||
|
public ObjectMapper jacksonObjectMapper(Jackson2ObjectMapperBuilder builder) {
|
||||||
|
ObjectMapper objectMapper = builder.createXmlMapper(false).build();
|
||||||
|
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||||
|
return objectMapper;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,6 +27,8 @@ public class KafkaProducerConfig {
|
|||||||
private int linger;
|
private int linger;
|
||||||
@Value("${kafka.producer.buffer.memory}")
|
@Value("${kafka.producer.buffer.memory}")
|
||||||
private int bufferMemory;
|
private int bufferMemory;
|
||||||
|
@Value("${kafka.producer.max.request.size}")
|
||||||
|
private int maxRequestSzie;
|
||||||
|
|
||||||
|
|
||||||
public Map<String, Object> producerConfigs() {
|
public Map<String, Object> producerConfigs() {
|
||||||
@@ -36,6 +38,7 @@ public class KafkaProducerConfig {
|
|||||||
props.put(ProducerConfig.BATCH_SIZE_CONFIG, batchSize);
|
props.put(ProducerConfig.BATCH_SIZE_CONFIG, batchSize);
|
||||||
props.put(ProducerConfig.LINGER_MS_CONFIG, linger);
|
props.put(ProducerConfig.LINGER_MS_CONFIG, linger);
|
||||||
props.put(ProducerConfig.BUFFER_MEMORY_CONFIG, bufferMemory);
|
props.put(ProducerConfig.BUFFER_MEMORY_CONFIG, bufferMemory);
|
||||||
|
props.put(ProducerConfig.MAX_REQUEST_SIZE_CONFIG,maxRequestSzie);
|
||||||
props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
|
props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
|
||||||
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
|
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
|
||||||
return props;
|
return props;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.gzzn.omms.msgexchangeapi.dto;
|
package com.gzzn.omms.msgexchangeapi.dto;
|
||||||
|
|
||||||
|
|
||||||
import com.gzzn.omms.msgexchangeapi.enums.ResultCode;
|
import com.gzzn.omms.msgexchangeapi.enums.ResultCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -18,6 +19,7 @@ public class ResponseDto<T> {
|
|||||||
|
|
||||||
private String err_msg;
|
private String err_msg;
|
||||||
|
|
||||||
|
|
||||||
private T body;
|
private T body;
|
||||||
|
|
||||||
public ResponseDto() {}
|
public ResponseDto() {}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ kafka:
|
|||||||
batch:
|
batch:
|
||||||
size: 4096
|
size: 4096
|
||||||
buffer:
|
buffer:
|
||||||
memory: 40960
|
memory: 10240000
|
||||||
max:
|
max:
|
||||||
request:
|
request:
|
||||||
size: 10240000
|
size: 10240000
|
||||||
@@ -39,7 +39,7 @@ kafka:
|
|||||||
reset: latest
|
reset: latest
|
||||||
commit:
|
commit:
|
||||||
interval: 100
|
interval: 100
|
||||||
servers: 130.120.3.237:32796,130.120.3.237:32797,130.120.3.237:32798
|
servers: 130.120.3.237:32796,130.120.3.237:32797,130.120.3.237:32798
|
||||||
zookeeper:
|
zookeeper:
|
||||||
connect: 130.120.3.237:2181
|
connect: 130.120.3.237:2181
|
||||||
session:
|
session:
|
||||||
@@ -50,7 +50,7 @@ kafka:
|
|||||||
topic: test
|
topic: test
|
||||||
concurrency: 10
|
concurrency: 10
|
||||||
group:
|
group:
|
||||||
id: test
|
id: test1
|
||||||
msgExchange:
|
msgExchange:
|
||||||
intervalSeconds: 30
|
intervalSeconds: 30
|
||||||
|
|
||||||
Reference in New Issue
Block a user