SUPPORT-8553: fix properties
This commit is contained in:
parent
f4ac8585c5
commit
6c41fa792c
7 changed files with 29 additions and 29 deletions
|
|
@ -23,7 +23,7 @@ import org.springframework.kafka.listener.ContainerProperties;
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableKafka
|
@EnableKafka
|
||||||
public class InputKafkaConsumerConfig {
|
public class InputKafkaConsumerConfig {
|
||||||
@Value("${spring.kafka.consumer.bootstrap-servers}")
|
@Value("${spring.kafka.consumer.bootstrap.servers}")
|
||||||
private List<String> bootstrapAddress;
|
private List<String> bootstrapAddress;
|
||||||
@Value("${spring.kafka.consumer.security.protocol}")
|
@Value("${spring.kafka.consumer.security.protocol}")
|
||||||
private String securityProtocol;
|
private String securityProtocol;
|
||||||
|
|
@ -31,9 +31,9 @@ public class InputKafkaConsumerConfig {
|
||||||
private String jaasConfig;
|
private String jaasConfig;
|
||||||
@Value("${spring.kafka.consumer.properties.sasl.mechanism}")
|
@Value("${spring.kafka.consumer.properties.sasl.mechanism}")
|
||||||
private String saslMechanism;
|
private String saslMechanism;
|
||||||
@Value("${spring.kafka.consumer.enable-auto-commit}")
|
@Value("${spring.kafka.consumer.enable.auto.commit}")
|
||||||
private String enableAutoCommit;
|
private String enableAutoCommit;
|
||||||
@Value("${spring.kafka.listener.ack-mode}")
|
@Value("${spring.kafka.listener.ack.mode}")
|
||||||
private String ackMode;
|
private String ackMode;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import org.springframework.kafka.listener.ContainerProperties;
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableKafka
|
@EnableKafka
|
||||||
public class OutputKafkaConsumerConfig {
|
public class OutputKafkaConsumerConfig {
|
||||||
@Value("${spring.kafka.out.consumer.bootstrap-servers}")
|
@Value("${spring.kafka.out.consumer.bootstrap.servers}")
|
||||||
private List<String> bootstrapAddress;
|
private List<String> bootstrapAddress;
|
||||||
@Value("${spring.kafka.out.consumer.security.protocol}")
|
@Value("${spring.kafka.out.consumer.security.protocol}")
|
||||||
private String securityProtocol;
|
private String securityProtocol;
|
||||||
|
|
@ -31,9 +31,9 @@ public class OutputKafkaConsumerConfig {
|
||||||
private String jaasConfig;
|
private String jaasConfig;
|
||||||
@Value("${spring.kafka.out.consumer.properties.sasl.mechanism}")
|
@Value("${spring.kafka.out.consumer.properties.sasl.mechanism}")
|
||||||
private String saslMechanism;
|
private String saslMechanism;
|
||||||
@Value("${spring.kafka.out.consumer.enable-auto-commit}")
|
@Value("${spring.kafka.out.consumer.enable.auto.commit}")
|
||||||
private String enableAutoCommit;
|
private String enableAutoCommit;
|
||||||
@Value("${spring.kafka.out.listener.ack-mode}")
|
@Value("${spring.kafka.out.listener.ack.mode}")
|
||||||
private String ackMode;
|
private String ackMode;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import org.springframework.kafka.core.ProducerFactory;
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class OutputKafkaProducerConfig {
|
public class OutputKafkaProducerConfig {
|
||||||
@Value("${spring.kafka.producer.bootstrap-servers}")
|
@Value("${spring.kafka.producer.bootstrap.servers}")
|
||||||
private List<String> bootstrapAddress;
|
private List<String> bootstrapAddress;
|
||||||
@Value("${spring.kafka.producer.security.protocol}")
|
@Value("${spring.kafka.producer.security.protocol}")
|
||||||
private String securityProtocol;
|
private String securityProtocol;
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ import org.springframework.kafka.config.TopicBuilder;
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class OutputKafkaTopicConfig {
|
public class OutputKafkaTopicConfig {
|
||||||
@Value("${kafka-out.error.topic.name}")
|
@Value("${kafka.out.error.topic.name}")
|
||||||
private String kafkaOutErrorTopicName;
|
private String kafkaOutErrorTopicName;
|
||||||
@Value("${kafka-out.success.topic.name}")
|
@Value("${kafka.out.success.topic.name}")
|
||||||
private String kafkaOutSuccessTopicName;
|
private String kafkaOutSuccessTopicName;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ public class FileUploadService {
|
||||||
this.s3Service = s3Service;
|
this.s3Service = s3Service;
|
||||||
}
|
}
|
||||||
|
|
||||||
@KafkaListener(id = "${spring.kafka.consumer.group-id}", topics = "${kafka-in.topic.name}",
|
@KafkaListener(id = "${spring.kafka.consumer.group.id}", topics = "${kafka.in.topic.name}",
|
||||||
containerFactory = "inputKafkaListenerContainerFactory")
|
containerFactory = "inputKafkaListenerContainerFactory")
|
||||||
public void listenKafkaIn(String kafkaInMessage, Acknowledgment acknowledgment) {
|
public void listenKafkaIn(String kafkaInMessage, Acknowledgment acknowledgment) {
|
||||||
DownloadRequest downloadRequest = new Gson().fromJson(kafkaInMessage, DownloadRequest.class);
|
DownloadRequest downloadRequest = new Gson().fromJson(kafkaInMessage, DownloadRequest.class);
|
||||||
|
|
@ -128,8 +128,8 @@ public class FileUploadService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@KafkaListener(id = "${spring.kafka.out.consumer.group-id}",
|
@KafkaListener(id = "${spring.kafka.out.consumer.group.id}",
|
||||||
topics = "${kafka-out.response.topic.name}",
|
topics = "${kafka.out.response.topic.name}",
|
||||||
containerFactory = "outputKafkaListenerContainerFactory")
|
containerFactory = "outputKafkaListenerContainerFactory")
|
||||||
public void listenKafkaOut(String kafkaOutResponseMessage, Acknowledgment acknowledgment) {
|
public void listenKafkaOut(String kafkaOutResponseMessage, Acknowledgment acknowledgment) {
|
||||||
DownloadResponse downloadResponse = new Gson().fromJson(kafkaOutResponseMessage,
|
DownloadResponse downloadResponse = new Gson().fromJson(kafkaOutResponseMessage,
|
||||||
|
|
@ -269,7 +269,7 @@ public class FileUploadService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (IOException e) {
|
catch (IOException e) {
|
||||||
// непредусмотренная ошибка доступа через http-клиент
|
// непредусмотренная ошибка доступа через http-клиент
|
||||||
throw new FileUploadException(e);
|
throw new FileUploadException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import ru.micord.ervu.av.response.AvResponse;
|
||||||
@Service
|
@Service
|
||||||
public class ReceiveScanReportRetryable {
|
public class ReceiveScanReportRetryable {
|
||||||
@Retryable(retryFor = {RetryableException.class},
|
@Retryable(retryFor = {RetryableException.class},
|
||||||
maxAttemptsExpression = "${av.retry.max-attempts.count}",
|
maxAttemptsExpression = "${av.retry.max.attempts.count}",
|
||||||
backoff = @Backoff(delayExpression = "${av.retry.delay.milliseconds}"))
|
backoff = @Backoff(delayExpression = "${av.retry.delay.milliseconds}"))
|
||||||
public AvResponse receiveScanReport(CloseableHttpClient client, HttpGet get)
|
public AvResponse receiveScanReport(CloseableHttpClient client, HttpGet get)
|
||||||
throws FileUploadException {
|
throws FileUploadException {
|
||||||
|
|
|
||||||
|
|
@ -6,24 +6,24 @@ spring.kafka.admin.properties.sasl.jaas.config=org.apache.kafka.common.security.
|
||||||
spring.kafka.admin.properties.sasl.mechanism=SCRAM-SHA-256
|
spring.kafka.admin.properties.sasl.mechanism=SCRAM-SHA-256
|
||||||
# kafka out servers for admin bean
|
# kafka out servers for admin bean
|
||||||
#host1:port1, host2:port2
|
#host1:port1, host2:port2
|
||||||
spring.kafka.bootstrap-servers=${OUT_KAFKA_SERVERS}
|
spring.kafka.bootstrap.servers=${OUT_KAFKA_SERVERS}
|
||||||
#
|
#
|
||||||
# kafka in consumer (with possibility for default bean)
|
# kafka in consumer (with possibility for default bean)
|
||||||
#host1:port1, host2:port2
|
#host1:port1, host2:port2
|
||||||
spring.kafka.consumer.bootstrap-servers=${IN_KAFKA_SERVERS}
|
spring.kafka.consumer.bootstrap.servers=${IN_KAFKA_SERVERS}
|
||||||
spring.kafka.consumer.security.protocol=SASL_PLAINTEXT
|
spring.kafka.consumer.security.protocol=SASL_PLAINTEXT
|
||||||
#login password to set
|
#login password to set
|
||||||
spring.kafka.consumer.properties.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="${IN_KAFKA_USERNAME}" password="${IN_KAFKA_PASSWORD}";
|
spring.kafka.consumer.properties.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="${IN_KAFKA_USERNAME}" password="${IN_KAFKA_PASSWORD}";
|
||||||
spring.kafka.consumer.properties.sasl.mechanism=SCRAM-SHA-256
|
spring.kafka.consumer.properties.sasl.mechanism=SCRAM-SHA-256
|
||||||
#
|
#
|
||||||
spring.kafka.consumer.enable-auto-commit=false
|
spring.kafka.consumer.enable.auto.commit=false
|
||||||
spring.kafka.consumer.group-id=file-to-upload-consumers
|
spring.kafka.consumer.group.id=file-to-upload-consumers
|
||||||
# kafka in listeners
|
# kafka in listeners
|
||||||
spring.kafka.listener.ack-mode=MANUAL_IMMEDIATE
|
spring.kafka.listener.ack.mode=MANUAL_IMMEDIATE
|
||||||
#
|
#
|
||||||
# kafka out producer (with possibility for default bean)
|
# kafka out producer (with possibility for default bean)
|
||||||
#host1:port1, host2:port2
|
#host1:port1, host2:port2
|
||||||
spring.kafka.producer.bootstrap-servers=${OUT_KAFKA_SERVERS}
|
spring.kafka.producer.bootstrap.servers=${OUT_KAFKA_SERVERS}
|
||||||
spring.kafka.producer.security.protocol=SASL_PLAINTEXT
|
spring.kafka.producer.security.protocol=SASL_PLAINTEXT
|
||||||
#login password to set
|
#login password to set
|
||||||
spring.kafka.producer.properties.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="${OUT_KAFKA_USERNAME}" password="${OUT_KAFKA_PASSWORD}";
|
spring.kafka.producer.properties.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="${OUT_KAFKA_USERNAME}" password="${OUT_KAFKA_PASSWORD}";
|
||||||
|
|
@ -38,26 +38,26 @@ spring.kafka.properties.sasl.mechanism=SCRAM-SHA-256
|
||||||
#
|
#
|
||||||
# kafka out consumer (not for default bean creation by spring)
|
# kafka out consumer (not for default bean creation by spring)
|
||||||
#host1:port1, host2:port2
|
#host1:port1, host2:port2
|
||||||
spring.kafka.out.consumer.bootstrap-servers=${OUT_KAFKA_SERVERS}
|
spring.kafka.out.consumer.bootstrap.servers=${OUT_KAFKA_SERVERS}
|
||||||
spring.kafka.out.consumer.security.protocol=SASL_PLAINTEXT
|
spring.kafka.out.consumer.security.protocol=SASL_PLAINTEXT
|
||||||
#login password to set
|
#login password to set
|
||||||
spring.kafka.out.consumer.properties.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="${OUT_KAFKA_USERNAME}" password="${OUT_KAFKA_PASSWORD}";
|
spring.kafka.out.consumer.properties.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="${OUT_KAFKA_USERNAME}" password="${OUT_KAFKA_PASSWORD}";
|
||||||
spring.kafka.out.consumer.properties.sasl.mechanism=SCRAM-SHA-256
|
spring.kafka.out.consumer.properties.sasl.mechanism=SCRAM-SHA-256
|
||||||
#
|
#
|
||||||
spring.kafka.out.consumer.enable-auto-commit=false
|
spring.kafka.out.consumer.enable.auto.commit=false
|
||||||
spring.kafka.out.consumer.group-id=response-consumers
|
spring.kafka.out.consumer.group.id=response-consumers
|
||||||
# kafka out listeners
|
# kafka out listeners
|
||||||
spring.kafka.out.listener.ack-mode=MANUAL_IMMEDIATE
|
spring.kafka.out.listener.ack.mode=MANUAL_IMMEDIATE
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
kafka-in.topic.name=${IN_KAFKA_TOPIC_NAME}
|
kafka.in.topic.name=${IN_KAFKA_TOPIC_NAME}
|
||||||
kafka-out.error.topic.name=${OUT_KAFKA_ERROR_TOPIC_NAME}
|
kafka.out.error.topic.name=${OUT_KAFKA_ERROR_TOPIC_NAME}
|
||||||
kafka-out.success.topic.name=${OUT_KAFKA_SUCCESS_TOPIC_NAME}
|
kafka.out.success.topic.name=${OUT_KAFKA_SUCCESS_TOPIC_NAME}
|
||||||
kafka-out.response.topic.name=${OUT_KAFKA_RESPONSE_TOPIC_NAME}
|
kafka.out.response.topic.name=${OUT_KAFKA_RESPONSE_TOPIC_NAME}
|
||||||
#
|
#
|
||||||
av.rest.address=${AV_REST_ADDRESS}
|
av.rest.address=${AV_REST_ADDRESS}
|
||||||
av.first.timeout.milliseconds=${AV_FIRST_TIMEOUT_MILLISECONDS}
|
av.first.timeout.milliseconds=${AV_FIRST_TIMEOUT_MILLISECONDS}
|
||||||
av.retry.max-attempts.count=${AV_RETRY_MAX_ATTEMPTS_COUNT}
|
av.retry.max.attempts.count=${AV_RETRY_MAX_ATTEMPTS_COUNT}
|
||||||
av.retry.delay.milliseconds=${AV_RETRY_DELAY_MILLISECONDS}
|
av.retry.delay.milliseconds=${AV_RETRY_DELAY_MILLISECONDS}
|
||||||
file.saving.path=${FILE_SAVING_PATH}
|
file.saving.path=${FILE_SAVING_PATH}
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue