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
|
||||
public class KafkaTopicConfig {
|
||||
@Value("${kafka-out.topic.error.name}")
|
||||
private String kafkaOutTopicErrorName;
|
||||
@Value("${kafka-out.topic.success.name}")
|
||||
private String kafkaOutTopicSuccessName;
|
||||
@Value("${kafka-out.error.topic.name}")
|
||||
private String kafkaOutErrorTopicName;
|
||||
@Value("${kafka-out.success.topic.name}")
|
||||
private String kafkaOutSuccessTopicName;
|
||||
|
||||
@Bean
|
||||
public NewTopic outErrorTopic() {
|
||||
return TopicBuilder.name(kafkaOutTopicErrorName).build();
|
||||
return TopicBuilder.name(kafkaOutErrorTopicName).build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
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);
|
||||
@Value("${av.rest.address}")
|
||||
private String avRestAddress;
|
||||
@Value("${file.before.av.path:}")
|
||||
private String fileBeforeAvPath;
|
||||
@Value("${file.saving.path}")
|
||||
private String fileSavingPath;
|
||||
@Value("${http.file.server.out.address:http://localhost/out}")
|
||||
private String httpFileServerOutAddress;
|
||||
private final KafkaTemplate<String, String> kafkaTemplate;
|
||||
|
|
@ -67,7 +67,7 @@ public class FileUploadService {
|
|||
|
||||
try {
|
||||
FileUrl fileUrl = parseFileUrl(inMessage.fileInfo().getFileNameBase());
|
||||
String filePath = fileBeforeAvPath + fileUrl.fileName();
|
||||
String filePath = fileSavingPath + fileUrl.fileName();
|
||||
String downloadUrl = fileUrl.fileUrl();
|
||||
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
|
||||
#
|
||||
kafka-in.topic.name=file-to-upload
|
||||
kafka-out.topic.error.name=error
|
||||
kafka-out.topic.success.name=success
|
||||
kafka-out.error.topic.name=error
|
||||
kafka-out.success.topic.name=success
|
||||
#
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue