This commit is contained in:
parent
cf00b03faf
commit
c9ef0ae75f
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 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.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.CurrencyPairSecurityNewRequest;
|
||||
import ru.spcex.platform.enumeration.InstrumentType;
|
||||
|
||||
@Service
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package ru.spcex.clearing.gatewayapi.service.processor;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -57,9 +57,9 @@ public class ListingCurrMassiveProcessor {
|
|||
currencyInstrumentId = currencyInstrument.getId();
|
||||
log.debug("Process currencyInstrumentId : {}", currencyInstrumentId);
|
||||
UUID finalCurrencyInstrumentId = currencyInstrumentId;
|
||||
Optional<TradingMode> tradingMode = request.getTradingModeList().stream()
|
||||
Collection<TradingMode> tradingMode = request.getTradingModeList().stream()
|
||||
.filter(tm -> tm.getCurrencySpecId().equals(finalCurrencyInstrumentId))
|
||||
.findFirst();
|
||||
.collect(Collectors.toSet());
|
||||
if (tradingMode.isEmpty()) {
|
||||
log.warn("Trading mode not found for instrument {}", finalCurrencyInstrumentId);
|
||||
continue;
|
||||
|
|
@ -68,9 +68,11 @@ public class ListingCurrMassiveProcessor {
|
|||
// log.warn("Incorrect code : {}, skip record", currencyInstrument.getCode());
|
||||
// continue;
|
||||
// }
|
||||
CurrencyPairSecurityNewGatewayRequest currencySecurityNewRequest = currencyPairSecurityRequestAdapter
|
||||
.toCurrencySecurityNewRequest(currencyInstrument, tradingMode.get());
|
||||
kafkaSender.sendRequestToQueue(Consts.DESTINATION_GATEWAY_CURRENCY_PAIR_SECURITY, currencySecurityNewRequest);
|
||||
for (TradingMode tm : tradingMode) {
|
||||
CurrencyPairSecurityNewGatewayRequest currencySecurityNewRequest = currencyPairSecurityRequestAdapter
|
||||
.toCurrencySecurityNewRequest(currencyInstrument, tm);
|
||||
kafkaSender.sendRequestToQueue(Consts.DESTINATION_GATEWAY_CURRENCY_PAIR_SECURITY, currencySecurityNewRequest);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
log.error("currencyInstrumentId={}: {}", currencyInstrumentId, ExceptionUtils.getStackTrace(e));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue