Skip to content

ACS 7 Migration Guide

CezarLeahu edited this page Feb 25, 2021 · 5 revisions

Synopsis

This page describes guidelines to migrate the code written on top of ACS to support the latest libraries included in 7.0 release.

Content:

Spring:

Spring has been upgraded to 5.3.2

  • MockHttpServletResponse - contentType property is now updated via MockHttpServletResponse::setCharacterEncoding(). Any tests using MockHttpServletResponse need to update existing assertions on contentType, e.g:
 - assertThat(response.getContentType()).isEqualTo("test/plain");
 + assertThat(response.getContentType()).isEqualTo("test/plain;charset=UTF-8");
  • Spring’s SQLExceptionTranslator implementations do not throw a fallback UncategorizedSQLException anymore but rather leave this up to the caller. However, it may still be thrown by custom translators, therefore it is a good idea to verify that before updating any code.

  • New method has been introduced in org.springframework.transaction.interceptor.TransactionAttribute. Classes implementing it will also need to implement:

Collection<String> getLabels();

Camel:

Camel has been upgraded to 3.7.0

  • camel-core has been split into multiple jars. With Maven, you can either use only the dependencies on the modules you need, or directly camel-core, as it has transitive dependencies on all of its modules, except for camel-main.

  • Many of the core components have been moved out of camel-core to individual components. Thus, for each endpoint prefix we need to add its corresponding maven dependency, e.g. "direct:alfresco.default" endpoint needs camel-direct.

  • The default value of the useBreadcrumb argument in camel context has changed to false with Camel 3. It is now explicitly set to true in the Alfresco Repository messaging configuration:

<camelContext id="alfrescoCamelContext" xmlns="http://camel.apache.org/schema/spring" useBreadcrumb="true">
   <contextScan/>
   <jmxAgent id="agent" />
   <template id="camelProducerTemplate" defaultEndpoint="direct:alfresco.default" />
</camelContext>
  • The jms, activemq and amqp components are now all explicitly declared in Alfresco Repository's default messaging context configuration and they all use one common configuration (one shared connection factory, one shared transaction manager):
<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
    <property name="connectionFactory" ref="pooledConnectionFactory" />
    <property name="transacted" value="${messaging.transacted}" />
    <property name="transactionManager" ref="messagingTransactionManager" />
</bean>
  • The Camel Context configuration is now exposed through JMX at Camel's default org.apache.camel domain namespace, instead of Alfresco.Camel.

Jakarta:

Save for the Servlet API libraries which remained at the javax.servlet:javax.servlet-api:3.0.1 version, all other JavaX libraries in ACS have been replaced with their Jakarta equivalent. With that said, there were only minor version upgrades on these libraries and in spite of the JAR library name changes, their internal Java packages have remained the same (the javax.[...] namespaces are still the ones used). Therefore, the switch from JavaX to Jakarta libraries will not affect Java code imports.

Clone this wiki locally