This commit is contained in:
parent
13a464fe7d
commit
f1dfcedb2d
2 changed files with 9 additions and 7 deletions
|
|
@ -3,8 +3,8 @@ package ru.spcex.clearing.gatewayapi.service.adapter;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import ru.spcex.clearing.gatewayapi.controller.inbound.request.listing.curr.mkr.CurrencyInstrument;
|
import ru.spcex.clearing.gatewayapi.controller.inbound.request.listing.curr.mkr.CurrencyInstrument;
|
||||||
import ru.spcex.clearing.gatewayapi.controller.inbound.request.listing.curr.mkr.TradingMode;
|
import ru.spcex.clearing.gatewayapi.controller.inbound.request.listing.curr.mkr.TradingMode;
|
||||||
import ru.spcex.clearing.platform.messaging.domain.cud.security.CurrencyPairSecurityNewRequest;
|
|
||||||
import ru.spcex.clearing.platform.messaging.domain.cud.security.CurrencyPairSecurityNewGatewayRequest;
|
import ru.spcex.clearing.platform.messaging.domain.cud.security.CurrencyPairSecurityNewGatewayRequest;
|
||||||
|
import ru.spcex.clearing.platform.messaging.domain.cud.security.CurrencyPairSecurityNewRequest;
|
||||||
import ru.spcex.platform.enumeration.InstrumentType;
|
import ru.spcex.platform.enumeration.InstrumentType;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package ru.spcex.clearing.gatewayapi.service.processor;
|
package ru.spcex.clearing.gatewayapi.service.processor;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
@ -57,9 +57,9 @@ public class ListingCurrMassiveProcessor {
|
||||||
currencyInstrumentId = currencyInstrument.getId();
|
currencyInstrumentId = currencyInstrument.getId();
|
||||||
log.debug("Process currencyInstrumentId : {}", currencyInstrumentId);
|
log.debug("Process currencyInstrumentId : {}", currencyInstrumentId);
|
||||||
UUID finalCurrencyInstrumentId = currencyInstrumentId;
|
UUID finalCurrencyInstrumentId = currencyInstrumentId;
|
||||||
Optional<TradingMode> tradingMode = request.getTradingModeList().stream()
|
Collection<TradingMode> tradingMode = request.getTradingModeList().stream()
|
||||||
.filter(tm -> tm.getCurrencySpecId().equals(finalCurrencyInstrumentId))
|
.filter(tm -> tm.getCurrencySpecId().equals(finalCurrencyInstrumentId))
|
||||||
.findFirst();
|
.collect(Collectors.toSet());
|
||||||
if (tradingMode.isEmpty()) {
|
if (tradingMode.isEmpty()) {
|
||||||
log.warn("Trading mode not found for instrument {}", finalCurrencyInstrumentId);
|
log.warn("Trading mode not found for instrument {}", finalCurrencyInstrumentId);
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -68,9 +68,11 @@ public class ListingCurrMassiveProcessor {
|
||||||
// log.warn("Incorrect code : {}, skip record", currencyInstrument.getCode());
|
// log.warn("Incorrect code : {}, skip record", currencyInstrument.getCode());
|
||||||
// continue;
|
// continue;
|
||||||
// }
|
// }
|
||||||
CurrencyPairSecurityNewGatewayRequest currencySecurityNewRequest = currencyPairSecurityRequestAdapter
|
for (TradingMode tm : tradingMode) {
|
||||||
.toCurrencySecurityNewRequest(currencyInstrument, tradingMode.get());
|
CurrencyPairSecurityNewGatewayRequest currencySecurityNewRequest = currencyPairSecurityRequestAdapter
|
||||||
kafkaSender.sendRequestToQueue(Consts.DESTINATION_GATEWAY_CURRENCY_PAIR_SECURITY, currencySecurityNewRequest);
|
.toCurrencySecurityNewRequest(currencyInstrument, tm);
|
||||||
|
kafkaSender.sendRequestToQueue(Consts.DESTINATION_GATEWAY_CURRENCY_PAIR_SECURITY, currencySecurityNewRequest);
|
||||||
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
log.error("currencyInstrumentId={}: {}", currencyInstrumentId, ExceptionUtils.getStackTrace(e));
|
log.error("currencyInstrumentId={}: {}", currencyInstrumentId, ExceptionUtils.getStackTrace(e));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue