platform-messaging поправил возврат текста ошибки валидаций в очередь "request-info-update"

This commit is contained in:
AKurakin 2023-05-12 18:38:01 +03:00
parent 5021443bb1
commit f05e93e14e
11 changed files with 30 additions and 34 deletions

View file

@ -95,16 +95,16 @@ public class AccountService extends QueueConsumer implements InitializingBean {
@Override
public void afterPropertiesSet() {
callback(AccountSdf01Request.class)
.setConsumer(this::accountNewSdf01)
.setFunction(this::accountNewSdf01)
.forDestination(Consts.ACCOUNT_NEW_SDF01, callbacks::put);
callback(CorrespondentAccountNewRequest.class)
.setConsumer(this::accountCorrespondentNew)
.setFunction(this::accountCorrespondentNew)
.forDestination(Consts.DESTINATION_CORRESPONDENT_ACCOUNT_NEW, callbacks::put);
callback(CorrespondentAccountUpdateRequest.class)
.setConsumer(this::correspondentAccountUpdate)
.setFunction(this::correspondentAccountUpdate)
.forDestination(Consts.DESTINATION_CORRESPONDENT_ACCOUNT_UPDATE, callbacks::put);
callback(CommonIdRequest.class)
.setConsumer(this::correspondentAccountBlock)
.setFunction(this::correspondentAccountBlock)
.forDestination(Consts.DESTINATION_CORRESPONDENT_ACCOUNT_BLOCK, callbacks::put);
init();
}

View file

@ -61,7 +61,7 @@ public class DepoAccountService extends QueueConsumer implements InitializingBea
@Override
public void afterPropertiesSet() throws Exception {
callback(DepoAccountNewRequest.class)
.setConsumer(this::depoAccountNew)
.setFunction(this::depoAccountNew)
.forDestination(Consts.DESTINATION_DEPO_ACCOUNT_NEW, callbacks::put);
init();
}

View file

@ -78,7 +78,7 @@ public class InformationAccountService extends QueueConsumer implements Initiali
@Override
public void afterPropertiesSet() throws Exception {
callback(InformationAccountNewRequest.class)
.setConsumer(this::informationAccountNew)
.setFunction(this::informationAccountNew)
.forDestination(Consts.DESTINATION_INFORMATION_ACCOUNT_NEW, callbacks::put);
init();
}

View file

@ -112,16 +112,16 @@ public class TradingClearingRegistryService extends QueueConsumer implements Ini
public void afterPropertiesSet() throws Exception {
init();
callback(TradingClearingRegistryNewRequest.class)
.setConsumer(this::tradingClearingRegistryAutoNew)
.setFunction(this::tradingClearingRegistryAutoNew)
.forDestination(Consts.DESTINATION_TRADING_CLEARING_REGISTRY_AUTO_NEW, callbacks::put);
callback(TradingClearingRegistryNewRequest.class)
.setConsumer(this::tradingClearingRegistryNew)
.setFunction(this::tradingClearingRegistryNew)
.forDestination(Consts.DESTINATION_TRADING_CLEARING_REGISTRY_NEW, callbacks::put);
callback(TradingClearingRegistryUpdateRequest.class)
.setConsumer(this::tradingClearingRegistryUpdate)
.setFunction(this::tradingClearingRegistryUpdate)
.forDestination(Consts.DESTINATION_TRADING_CLEARING_REGISTRY_UPDATE, callbacks::put);
callback(CommonIdRequest.class)
.setConsumer(this::tradingClearingRegistryBlock)
.setFunction(this::tradingClearingRegistryBlock)
.forDestination(Consts.DESTINATION_TRADING_CLEARING_REGISTRY_BLOCK, callbacks::put);
}

View file

@ -9,25 +9,15 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import ru.spcex.clearing.platform.messaging.domain.ActionType;
import ru.spcex.clearing.platform.messaging.domain.BaseRequest;
import ru.spcex.clearing.platform.messaging.domain.Consts;
import ru.spcex.clearing.platform.messaging.domain.cud.balance.AccountBalanceClearingRequest;
import ru.spcex.clearing.platform.messaging.domain.cud.clearing.Sdf04Request;
import ru.spcex.clearing.platform.messaging.domain.cud.common.CommonIdRequest;
import ru.spcex.clearing.platform.messaging.domain.cud.schedule.LauncherCommandRequest;
import ru.spcex.clearing.platform.messaging.service.QueueConsumer;
import ru.spcex.clearing.platform.messaging.service.RequestInfoUpdate;
import ru.spcex.clearing.platform.messaging.service.Status;
import ru.spcex.clearing.platform.messaging.service.sender.KafkaSender;
import ru.spcex.platform.enumeration.Task;
import ru.spcex.platform.utils.log.ExceptionUtils;
import java.io.Closeable;
import java.util.Objects;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicInteger;
/**
* Синхронный обмен сообщениями с ассинхронным сервисом.

View file

@ -57,13 +57,13 @@ public class ClearingMemberCategoryService extends QueueConsumer implements Init
@Override
public void afterPropertiesSet() {
callback(ClearingMemberCategoryNewRequest.class)
.setConsumer(this::clearingMemberCategoryNew)
.setFunction(this::clearingMemberCategoryNew)
.forDestination(Consts.DESTINATION_CLEARING_MEMBER_CATEGORY_NEW, callbacks::put);
callback(ClearingMemberCategoryUpdateRequest.class)
.setConsumer(this::clearingMemberCategoryUpdate)
.setFunction(this::clearingMemberCategoryUpdate)
.forDestination(Consts.DESTINATION_CLEARING_MEMBER_CATEGORY_UPDATE, callbacks::put);
callback(CommonDeleteRequest.class)
.setConsumer(this::clearingMemberCategoryDelete)
.setFunction(this::clearingMemberCategoryDelete)
.forDestination(Consts.DESTINATION_CLEARING_MEMBER_CATEGORY_DELETE, callbacks::put);
init();
}

View file

@ -102,17 +102,17 @@ public class ClientCodeService extends QueueConsumer implements InitializingBean
@Override
public void afterPropertiesSet() {
callback(ClientCodeNewRequest.class)
.setConsumer(this::clientCodeNew)
.setFunction(this::clientCodeNew)
.forDestination(Consts.DESTINATION_CLIENT_CODE_NEW, callbacks::put);
callback(ClientCodeNewRequest.class)
.setConsumer(this::clientCodeNewFromApiUmCompany)
.setFunction(this::clientCodeNewFromApiUmCompany)
.forDestination(Consts.DESTINATION_CLIENT_CODE_NEW_UM_COMPANY, callbacks::put);
callback(ClientCodeUpdateRequest.class)
.setConsumer(this::clientCodeUpdate)
.setFunction(this::clientCodeUpdate)
.forDestination(Consts.DESTINATION_CLIENT_CODE_UPDATE, callbacks::put);
callback(CommonDeleteRequest.class)
.setConsumer(this::clientCodeDelete)
.setFunction(this::clientCodeDelete)
.forDestination(Consts.DESTINATION_CLIENT_CODE_DELETE, callbacks::put);
init();

View file

@ -95,16 +95,16 @@ public class CompanyService extends QueueConsumer implements InitializingBean {
@Override
public void afterPropertiesSet() {
callback(CommonDeleteRequest.class)
.setConsumer(request -> requestHelper.requestFunction(this::deleteCompany, request))
.setFunction(request -> requestHelper.requestFunction(this::deleteCompany, request))
.forDestination(Consts.DESTINATION_COMPANY_DELETE, callbacks::put);
callback(CommonDeleteRequest.class)
.setConsumer(request -> requestHelper.requestFunction(this::blockCompanyAfterDocument, request))
.setFunction(request -> requestHelper.requestFunction(this::blockCompanyAfterDocument, request))
.forDestination(Consts.DESTINATION_COMPANY_BLOCK, callbacks::put);
callback(CompanyNewRequest.class)
.setFunction(request -> requestHelper.requestFunction(this::createCompany, request))
.forDestination(Consts.DESTINATION_COMPANY_NEW, callbacks::put);
callback(CompanyNewRequest.class)
.setConsumer(request -> requestHelper.requestFunction(this::updateCompany, request))
.setFunction(request -> requestHelper.requestFunction(this::updateCompany, request))
.forDestination(Consts.DESTINATION_COMPANY_UPDATE, callbacks::put);
init();
}

View file

@ -52,10 +52,10 @@ public class ContactService extends QueueConsumer implements InitializingBean {
@Override
public void afterPropertiesSet() {
callback(ContactNewRequest.class)
.setConsumer(this::contactNew)
.setFunction(this::contactNew)
.forDestination(Consts.DESTINATION_CONTACT_NEW, callbacks::put);
callback(ContactUpdateRequest.class)
.setConsumer(this::contactUpdate)
.setFunction(this::contactUpdate)
.forDestination(Consts.DESTINATION_CONTACT_UPDATE, callbacks::put);
init();
}

View file

@ -57,10 +57,10 @@ public class FixedIncomeCashFlowService extends QueueConsumer implements Initial
public void afterPropertiesSet() throws Exception {
log.debug("EquitySecurityNewRequest received");
callback(FixedIncomeCashFlowNewRequest.class)
.setConsumer(this::fixedIncomeCashFlowNew)
.setFunction(this::fixedIncomeCashFlowNew)
.forDestination(Consts.DESTINATION_FIXED_INCOME_CASH_FLOW_NEW, callbacks::put);
callback(FixedIncomeCashFlowUpdateRequest.class)
.setConsumer(this::fixedIncomeCashFlowUpdate)
.setFunction(this::fixedIncomeCashFlowUpdate)
.forDestination(Consts.DESTINATION_FIXED_INCOME_CASH_FLOW_UPDATE, callbacks::put);
init();
}

View file

@ -6,6 +6,12 @@ import java.util.function.Consumer;
import java.util.function.Function;
public interface BuilderConsumerStep<T1> {
/**
* Рекомендуется использовать setFunction, когда возвращается результат.
* @param consumer
* @return
*/
@Deprecated
BuilderDestinationStep setConsumer(Consumer<BaseRequest<T1>> consumer);
BuilderDestinationStep setFunction(Function<BaseRequest<T1>, Object> function);
}