SUPPORT-8400: fix for review (1)
This commit is contained in:
parent
828884954d
commit
bca11f37a6
4 changed files with 15 additions and 19 deletions
|
|
@ -11,18 +11,18 @@ import org.springframework.kafka.config.TopicBuilder;
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class KafkaTopicConfig {
|
public class KafkaTopicConfig {
|
||||||
@Value("${kafka-out.topic.error.name}")
|
@Value("${kafka-out.error.topic.name}")
|
||||||
private String kafkaOutTopicErrorName;
|
private String kafkaOutErrorTopicName;
|
||||||
@Value("${kafka-out.topic.success.name}")
|
@Value("${kafka-out.success.topic.name}")
|
||||||
private String kafkaOutTopicSuccessName;
|
private String kafkaOutSuccessTopicName;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public NewTopic outErrorTopic() {
|
public NewTopic outErrorTopic() {
|
||||||
return TopicBuilder.name(kafkaOutTopicErrorName).build();
|
return TopicBuilder.name(kafkaOutErrorTopicName).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public NewTopic outSuccessTopic() {
|
public NewTopic outSuccessTopic() {
|
||||||
return TopicBuilder.name(kafkaOutTopicSuccessName).build();
|
return TopicBuilder.name(kafkaOutSuccessTopicName).build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,8 @@ public class FileUploadService {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(FileUploadService.class);
|
private static final Logger logger = LoggerFactory.getLogger(FileUploadService.class);
|
||||||
@Value("${av.rest.address}")
|
@Value("${av.rest.address}")
|
||||||
private String avRestAddress;
|
private String avRestAddress;
|
||||||
@Value("${file.before.av.path:}")
|
@Value("${file.saving.path}")
|
||||||
private String fileBeforeAvPath;
|
private String fileSavingPath;
|
||||||
@Value("${http.file.server.out.address:http://localhost/out}")
|
@Value("${http.file.server.out.address:http://localhost/out}")
|
||||||
private String httpFileServerOutAddress;
|
private String httpFileServerOutAddress;
|
||||||
private final KafkaTemplate<String, String> kafkaTemplate;
|
private final KafkaTemplate<String, String> kafkaTemplate;
|
||||||
|
|
@ -67,7 +67,7 @@ public class FileUploadService {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
FileUrl fileUrl = parseFileUrl(inMessage.fileInfo().getFileNameBase());
|
FileUrl fileUrl = parseFileUrl(inMessage.fileInfo().getFileNameBase());
|
||||||
String filePath = fileBeforeAvPath + fileUrl.fileName();
|
String filePath = fileSavingPath + fileUrl.fileName();
|
||||||
String downloadUrl = fileUrl.fileUrl();
|
String downloadUrl = fileUrl.fileUrl();
|
||||||
downloadFileByHttp(downloadUrl, filePath);
|
downloadFileByHttp(downloadUrl, filePath);
|
||||||
|
|
||||||
|
|
@ -232,4 +232,7 @@ public class FileUploadService {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private record FileUrl(String fileName, String fileUrl) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
package ru.cg.subproject.service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author r.latypov
|
|
||||||
*/
|
|
||||||
public record FileUrl(String fileName, String fileUrl) {
|
|
||||||
}
|
|
||||||
|
|
@ -24,9 +24,9 @@ spring.kafka.properties.sasl.jaas.config=org.apache.kafka.common.security.scram.
|
||||||
spring.kafka.properties.sasl.mechanism=SCRAM-SHA-256
|
spring.kafka.properties.sasl.mechanism=SCRAM-SHA-256
|
||||||
#
|
#
|
||||||
kafka-in.topic.name=file-to-upload
|
kafka-in.topic.name=file-to-upload
|
||||||
kafka-out.topic.error.name=error
|
kafka-out.error.topic.name=error
|
||||||
kafka-out.topic.success.name=success
|
kafka-out.success.topic.name=success
|
||||||
#
|
#
|
||||||
av.rest.address=http://<server>:<port>/scans
|
av.rest.address=http://<server>:<port>/scans
|
||||||
file.before.av.path=/nginx/transfer/
|
file.saving.path=/nginx/transfer/
|
||||||
http.file.server.out.address=http://localhost/out
|
http.file.server.out.address=http://localhost/out
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue