.
This commit is contained in:
parent
be2d9aa234
commit
2d7bfae8a0
3 changed files with 30 additions and 3 deletions
|
|
@ -27,6 +27,8 @@ import java.util.concurrent.Future;
|
||||||
* <p>
|
* <p>
|
||||||
* Ожидает из очереди (CommonIdRequest)
|
* Ожидает из очереди (CommonIdRequest)
|
||||||
*
|
*
|
||||||
|
* Похожая функция ожидания: KafkaSender.sendToQueueWaitForAnswer
|
||||||
|
*
|
||||||
* @param <TOut> отправляется в очередь
|
* @param <TOut> отправляется в очередь
|
||||||
*/
|
*/
|
||||||
public class BiDirectionQueueExchanger<TOut extends BaseRequest<?>> extends QueueConsumer implements Closeable {
|
public class BiDirectionQueueExchanger<TOut extends BaseRequest<?>> extends QueueConsumer implements Closeable {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
package ru.spcex.clearing.lim.exporter.services;
|
package ru.spcex.clearing.lim.exporter.services;
|
||||||
|
|
||||||
import org.apache.kafka.clients.producer.Producer;
|
|
||||||
import org.apache.kafka.clients.producer.ProducerRecord;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
@ -74,7 +72,7 @@ public abstract class AbstractExporterService {
|
||||||
sendLimExportedNotification(fileName);
|
sendLimExportedNotification(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void sendLimExportedNotification(String fileName) {
|
void sendLimExportedNotification(String fileName) {
|
||||||
LimExportedRequest limExportedRequest = new LimExportedRequest();
|
LimExportedRequest limExportedRequest = new LimExportedRequest();
|
||||||
limExportedRequest.setLimFileName(fileName);
|
limExportedRequest.setLimFileName(fileName);
|
||||||
log.debug("Send message to kafka \"{}\": {}", LIM_EXPORTED, LogFormatter.toStringWrapper(limExportedRequest));
|
log.debug("Send message to kafka \"{}\": {}", LIM_EXPORTED, LogFormatter.toStringWrapper(limExportedRequest));
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package ru.spcex.clearing.lim.exporter.services;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import ru.spcex.clearing.lim.exporter.AbstractServiceTest;
|
||||||
|
import ru.spcex.clearing.test.TestUtils;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
class AbstractExporterServiceTest extends AbstractServiceTest {
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
super.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void sendLimExportedNotification() {
|
||||||
|
AbstractExporterService moneyExporterService = new MoneyExporterService(null, kafkaSender, imdgProvider);
|
||||||
|
|
||||||
|
String fileName = "limits_money_202305241832.lim";
|
||||||
|
moneyExporterService.sendLimExportedNotification(fileName);
|
||||||
|
//TestUtils.waitingSendAndCheckRecord(null, mockProducer);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue