IntegrationManager 2.0.0

This document summarizes major improvements and fixes introduced in the Pricefx IntegrationManager release version.

VersionIntegrationManager 2.0.0
Release dateAug 25, 2021


In this section:

Migration Steps

Camel has been upgraded from version 3.5 to 3.11. For full upgrade guide, please read https://camel.apache.org/manual/latest/camel-3x-upgrade-guide.html.

Below is a list of breaking changes in IM, identified in testing:

BeforeAfter

public static Object getExpressionValue(String language, String expression, Object body, Exchange exchange) {
    Exchange temporaryExchange = getTemporaryExchange(body, exchange);
    Expression languageExpression = languageExpression(language, expression);
    return evaluateInSandbox(() -> languageExpression.evaluate(temporaryExchange, Object.class), exchange);
}

public static Object getExpressionValue(String language, String expression, Object body, Exchange exchange) {
    Exchange temporaryExchange = getTemporaryExchange(body, exchange);
    Expression languageExpression = languageExpression(language, expression);
    languageExpression.init(exchange.getContext());
    return evaluateInSandbox(() -> languageExpression.evaluate(temporaryExchange, Object.class), exchange);
}
BeforeAfter

public static void initialize(PfxEventConfiguration source, PfxEventEndpoint target) {
    target.setInitialDelay(source.getInitialDelay());
    target.setDelay(source.getDelay());
    target.setUseFixedDelay(source.isUseFixedDelay());
    target.setRunLoggingLevel(source.getRunLoggingLevel());
    target.setGreedy(source.isGreedy());
    target.setTimeUnit(source.getTimeUnit());
    target.setSendEmptyMessageWhenIdle(source.isSendEmptyMessageWhenIdle());
    target.setStartScheduler(source.isStartScheduler());
    target.setExceptionHandler(source.getExceptionHandler());
    Optional.ofNullable(source.getBackoffMultiplier()).ifPresent(target::setBackoffMultiplier);
    Optional.ofNullable(source.getBackoffErrorThreshold()).ifPresent(target::setBackoffErrorThreshold);
    Optional.ofNullable(source.getBackoffIdleThreshold()).ifPresent(target::setBackoffIdleThreshold);
    Optional.ofNullable(source.getScheduledExecutorService()).ifPresent(target::setScheduledExecutorService);
    Optional.ofNullable(source.getSchedulerProperties()).ifPresent(target::setSchedulerProperties);
    Optional.ofNullable(source.getPollStrategy()).ifPresent(target::setPollStrategy);

    target.setSynchronous(source.isSynchronous());
    target.setBridgeErrorHandler(source.isBridgeErrorHandler());
    Optional.ofNullable(source.getExchangePattern()).ifPresent(target::setExchangePattern);
}

public static void initialize(PfxEventConfiguration source, PfxEventEndpoint target) {
    target.setInitialDelay(source.getInitialDelay());
    target.setDelay(source.getDelay());
    target.setUseFixedDelay(source.isUseFixedDelay());
    target.setRunLoggingLevel(source.getRunLoggingLevel());
    target.setGreedy(source.isGreedy());
    target.setTimeUnit(source.getTimeUnit());
    target.setSendEmptyMessageWhenIdle(source.isSendEmptyMessageWhenIdle());
    target.setStartScheduler(source.isStartScheduler());
    target.setExceptionHandler(source.getExceptionHandler());
    Optional.ofNullable(source.getBackoffMultiplier()).ifPresent(target::setBackoffMultiplier);
    Optional.ofNullable(source.getBackoffErrorThreshold()).ifPresent(target::setBackoffErrorThreshold);
    Optional.ofNullable(source.getBackoffIdleThreshold()).ifPresent(target::setBackoffIdleThreshold);
    Optional.ofNullable(source.getScheduledExecutorService()).ifPresent(target::setScheduledExecutorService);
    Optional.ofNullable(source.getSchedulerProperties()).ifPresent(target::setSchedulerProperties);
    Optional.ofNullable(source.getPollStrategy()).ifPresent(target::setPollStrategy);

    target.setBridgeErrorHandler(source.isBridgeErrorHandler());
    Optional.ofNullable(source.getExchangePattern()).ifPresent(target::setExchangePattern);
}

BeforeAfter

public Map setMetadata(Exchange exchange) {
    Map metadata = new HashMap();
    metadata.put(IM_HEADERS.getName(), ObjectMapperUtils.convertMap(exchange.getIn().getHeaders()));
    metadata.put(IM_PROPERTIES.getName(), ObjectMapperUtils.convertMap(exchange.getProperties()));
    return metadata;
}

public Map setMetadata(Exchange exchange) {
    Map metadata = new HashMap();
    metadata.put(IM_HEADERS.getName(), ObjectMapperUtils.convertMap(exchange.getIn().getHeaders()));
    metadata.put(IM_PROPERTIES.getName(), ObjectMapperUtils.convertMap(exchange.getAllProperties()));
    return metadata;
}
BeforeAfter

public void configure() {
    ListToXmlMapper listToXmlMapper = new ListToXmlMapper();
    listToXmlMapper.setElementName(elementName);
    listToXmlMapper.setRootElementName(rootElementName);

    from(getRouteName())

        .split(body())
            .aggregate(new AggregateToList())
                .constant(true)
                .aggregateController(aggregateController)
                .completionSize(getBatchSize())
                .completionTimeout(getCompletionTimeout())
                .bean(listToXmlMapper)
                .to(outputUri)
            .end()
        .end().process(getForceCompletionOnAllGroupsProcessor(aggregateController));
}

public void configure() {
    ListToXmlMapper listToXmlMapper = new ListToXmlMapper();
    listToXmlMapper.setElementName(elementName);
    listToXmlMapper.setRootElementName(rootElementName);

    from(getRouteName())

        .split(body())
            .aggregate(new AggregateToList())
                .constant(true)
                .aggregateController(aggregateController)
                .completionSize(getBatchSize())
                .completionTimeout(getCompletionTimeout())
                .executorService(new SynchronousExecutorService())

                .parallelProcessing(false)
                .bean(listToXmlMapper)
                .to(outputUri)
            .end()
        .end().process(getForceCompletionOnAllGroupsProcessor(aggregateController));
}


Improvements

New Feature DescriptionID
Joda is no longer allowed in Groovy scripts. Use java.time libraries instead.PFIMCORE-710
Dataload route updated - the input will be read only once.PFIMCORE-739
Added charset detection to dataload and components (pfx-validator, pfx-marshal, pfx-unmarshal).PFIMCORE-767
Import V2 has been enabled for production dataloads.PFIMCORE-787
There is a new endpoint POST /api/mappers/test-connection and HTTP client method testMapper(TestMapperRequest) which accept the input data and mapper specification and provide mapper result.PFIMCORE-802
Archetype for provisioned instances has been added. Added methods to manage instance in the HTTP client. Added V3 API. Refactored repository – added GIT implementation, refactored + renamed properties.PFIMCORE-815
IM can now run on Java 16. Also migrated several libraries: Spring Boot to 2.4.0, Groovy to 2.0, Camel to 3.11, Spock to 2.0.PFIMCORE-829

Fixed Issues

Bug DescriptionID
Aggregation progress (batches) using 'recordsCountAggregation' is sending progress in all usages, not only dataloads.PFIMCORE-841

IntegrationManager version 5.8.0