Aurea Messenger Workbench Migration Guide

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

With the release 12.0.0, JDK has been upgraded from 1.7 to 1.8 Amazon Corretto.

Third party
libraries used in Aurea Messenger such as Spring-framework, Apache Cxf, Apache Camel are
also updated.
Existing Sonic Connect projects will be affected by this upgrade. Some migration steps need to
be executed in order to run these existing projects in the newer version.
This document explains the required steps.

Changes in spring.xml files

1. Extensions are automatically loaded in CXF. Explicit inclusion of cxf extensions need to
be removed. Example lines to be deleted
​ esource​="classpath:META-INF/cxf/cxf-extension-soap.xml"​/>
<​import r
<​import r​ esource​="classpath:META-INF/cxf/cxf-extension-http-jetty.xml"​/>
<​import r ​ esource​="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml"​/>

2. Since all spring, cxf and camel libraries have been upgraded, schema locations
referencing old versions of libraries need to be updated. (Xsd reference without a
reference will use the latest version). Example Changes:

xsi​:schemaLocation​="
http://camel.apache.org/schema/cxf
http://camel.apache.org/schema/cxf/camel-cxf-​2.0.7​.xsd​"​>

Version part needs to be removed

xsi​:schemaLocation​="
http://camel.apache.org/schema/cxf
http://camel.apache.org/schema/cxf/camel-cxf.xsd​"​>

3. Type converter mechanisms changed. Legacy type converters need to be explicitly


loaded. Camel context loadTypeConverters attribute needs to set true. Example
changes :

​ <camel:camelContext id="camel">

loadTypeConverter attribute has been added.

<camel:camelContext id="camel" ​loadTypeConverters="true"​>

4. Header name attribute has been changed from headerName to name in xsd files.
headerName​ attribute needs to set ​name.​ Example changes:

​ <camel:setHeader headerName="ANY">
should be converted to
<camel:setHeader name="ANY">
5. ​org.apache.camel.processor.RedeliveryPolicy has been refactored.
a. Package name needs to be updated. New package is
org.apache.camel.processor.​errorhandler​.RedeliveryPolicy

b. redeliverDelay​ attribute has to be renamed.


New attribute name is ​redeliver​y​Delay

Example Changes :

<​bean ​id​="myRedeliveryPolicy"
class​="org.apache.camel.processor.RedeliveryPolicy"​>
<​property ​name​="maximumRedeliveries" ​value​="5"​/>
​<​property ​name​="redeliverDelay" ​value​="0"​/>
</​bean​>

Needs to be updated as

<​bean ​id​="myRedeliveryPolicy"
class​="org.apache.camel.processor.​errorhandler​.RedeliveryPolicy"​>
<​property ​name​="maximumRedeliveries" ​value​="5"​/>
<​property ​name​="redeliver​y​Delay" ​value​="0"​/>
</​bean​>

6. Spring security library has been updated.


● New xsd changes. Authentication provider is a child of authentication manager tag
now.
● NoOpPasswordEncoder​ m ​ ust be explicitly set

<​security​:authentication-manager ​alias​="authenticationManager"​/>
<​security​:authentication-provider​>
<​security​:user-service​>
<​security​:user ​name​="customerbob" ​password​="bobspassword”
authorities​="ROLE_CUSTOMER" ​/>
</​security​:user-service​>
</​security​:authentication-provider​>

Needs to be changed to

<​security​:authentication-manager ​alias​="authenticationManager"​>
<​security​:authentication-provider​>
<​security​:user-service​>
<​security​:user ​name​="customerbob" ​password​="​{noop}​bobspassword"
authorities​="ROLE_CUSTOMER" ​/>
</​security​:user-service​>
</​security​:authentication-provider​>
</​security​:authentication-manager​>

7.​ ​ ​cxfbean​ component for rest endpoints has been deprecated and removed.
It will be replaced by jaxrs server and cxfrs components.

For example to replace

<camel:to uri="​cxfbean​:Bean.org.example.resources.PatientList"/>

The following migration steps need to be executed.

a. JaxRs & Camel transports schemas should be added if they don’t exist.

<​beans ​xmlns:​xsi​="http://www.w3.org/2001/XMLSchema-instance"
​xmlns​="http://www.springframework.org/schema/beans"
​xmlns:​camel​="http://camel.apache.org/schema/spring"
​xmlns:​jaxrs​="​http://cxf.apache.org/jaxrs​"
xmlns:​cameltransport​="http://cxf.apache.org/transports/camel"
​xsi​:schemaLocation​="
​http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
http://cxf.apache.org/jaxrs
http://cxf.apache.org/schemas/jaxrs.xsd
http://cxf.apache.org/transports/camel
http://cxf.apache.org/transports/camel.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd​”​>

b. Jaxrs server should be added with XHttpMethodOverrideFilter.

<​bean ​id​="xhttpMethodOverrideFilter"
class​="com.progress.sonic.esb.camel.XHttpMethodOverrideFilter"​>

<​cameltransport​:conduit ​name​="*.camel-conduit" ​camelContextId​="camel" ​/>


<​cameltransport​:destination ​name​="*.camel-destination" ​camelContextId​="camel"​/>

<​jaxrs​:server ​id​="restService" ​address​="camel://direct:rsServer"


​staticSubresourceResolution​="true"​>
<​jaxrs​:serviceBeans​>
<​ref ​bean​="Bean.org.example.resources.PatientList" ​/>
</​jaxrs​:serviceBeans​>
<​jaxrs​:providers​>
<​ref ​bean​="xhttpMethodOverrideFilter"​/>
</​jaxrs​:providers​>
</​jaxrs​:server​>
c. The Cxfbean component is deprecated.

<​camel​:to ​uri​="cxfbean:Bean.org.example.resources.PatientList"​/>

Will be replaced by the following line..

<​camel​:to ​uri​="direct:rsServer"​/>

8.​ ​ ​cxfbean ​component for jaxws endpoints has been deprecated and removed.
It will be replaced by jaxws server and cxf endpoint components.

For example to replace

​<​camel​:to ​uri​="​cxfbean​:org.example.patientservice.PatientImpljaxwsBean"​/>

The following migration steps need to be executed.

a. Jaxws & camel transport schemas should be added if it doesn’t exist.

<beans ​xmlns:​xsi​="http://www.w3.org/2001/XMLSchema-instance"
​xmlns​="http://www.springframework.org/schema/beans"
​xmlns:​camel​="http://camel.apache.org/schema/spring"
​xmlns:​cxf​="http://camel.apache.org/schema/cxf"
​xmlns:​tns​="http://www.example.org/patientservice/"
​xmlns:​jaxws​="http://cxf.apache.org/jaxws"
xmlns:​cameltransport​="http://cxf.apache.org/transports/camel"
​xsi​:schemaLocation​="
http://camel.apache.org/schema/cxf
http://camel.apache.org/schema/cxf/camel-cxf.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
http://cxf.apache.org/transports/camel
http://cxf.apache.org/transports/camel.xsd
​ http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/transports/camel
http://cxf.apache.org/transports/camel.xsd

"​>

b. ​Jaxws server should be added.

<​cameltransport​:conduit ​name​="*.camel-conduit" ​camelContextId​="camel" ​/>


<​cameltransport​:destination ​name​="*.camel-destination"
camelContextId​="camel"​/>

<​jaxws​:server ​id​="wsServer" ​address​="camel://direct:wsServer"​>


<​jaxws​:serviceBean​>
<​bean ​class​="org.example.patientservice.PatientImpl"​/>
</​jaxws​:serviceBean​>
</​jaxws​:server​>

c. Cxf endpoint should be added.

​<​cxf​:cxfEndpoint ​id​="wsEndpoint"
serviceClass​="org.example.patientservice.Patient"
address​="camel://direct:wsServer"​>
<​cxf​:properties​>
<​entry ​key​="dataFormat" ​value​="MESSAGE"​/>
</​cxf​:properties​>
</​cxf​:cxfEndpoint​>

d. cxfbean component needs to be replaced

<​camel​:to
uri​="cxfbean:org.example.patientservice.PatientImpljaxwsBean"​/>

by

<camel:to uri="cxf:bean:wsEndpoint"/>

9. With the release 12.0.0 Workbench component will be using a newer version (4.13) of
Eclipse. Since existing workspaces are created by the old version they need to be adjusted to
work with the new workbench.

Before opening existing workspaces

INSTALL_LOCATION/Workbench12.0/eclipse/SonicLauncher.ini file needs to be updated.


-clean parameter should be added.

After opening existing workspaces for the first time, the ​clean​ parameter can be deleted. It
is not necessary to remove it. But it will slow down the workbench startup. This is valid for each
and every one of old workspaces you have. Please close the Workbench after you set the
-clean parameter and start again for each and every one of the old workspaces you switch
once. Do not use File > Restart option for this.
10. Many third-party libraries have been updated. For existing maven based projects, update
projects with "Force Update" should be done in workbench.

You might also like