Apache Camel 3.14 version upgrade – impacts and resolutions – all in one place for easy reference

SAP CPI has recently upgraded its Apache Camel runtime from version 2.24 to 3.14.7. This upgrade is significant for users who have deployed custom integration adapters, as they must validate their adapters in the new runtime before the update is applied.

When SAP CPI upgrades to the latest version, it can have several impacts on your tenant, especially if you have custom integrations or adapters. Some Groovy scripts and Camel expressions may need adjustments due to syntax changes.

To check your Cloud Integration suite tenant version: https://me.sap.com/notes/0002351301

The latest SAP CPI version introduces several new features and enhancements aimed at improving integration capabilities and user experience. Here are some highlights:

Users can now see detailed deployment information, including runtime status, deployed by, deployed on, and deployed version.

New options allow configuring namespace and prefixes for externally referenced schemas in Message Mapping.

AS2/AS2 MDN Sender Adapter Update – The X-content-type-options header is now suppressed to comply with the AS2 protocol.

New parameters have been added to SFTP and AMQP adapters, offering better control over data transfers.

Diagnostic tasks in Edge Integration Cell provide better debugging capabilities.EDI Flat-File Payload Support: The previous version lacked native support for EDI flat-file payloads, which is now available.

Principal propagation for on-premise connections is now supported, improving security and integration.

The latest Apache Camel upgrade introduces some notable changes in Integration suite, which may impact the integration flows. Here’s a comprehensive rundown of potential impacts and corresponding resolutions provided by SAP, for CPI tenants upgrading to Apache Camel 3.14 – all in one place for easy reference:

SimpleParserException:

If an integration flow is in status “Error” and the error details from the “Manage Integration Content” view show a SimpleParserException

Example:

[CAMEL][IFLOW][CAUSE]: Cause: org.apache.camel.language.simple.types.SimpleParserException: Unknown function: ${In.Body}

…org.apache.camel.language.simple.types.SimpleParserException: Unknown function: Null

Resolution:

In this error, it is expression ${In.Body} which makes the issue. Due to it has an incorrect capitalization, typographical error. Correct expression could be currently ${in.body}.

The expression ${in.body} is still supported in the new Camel 3.14-based runtime of SAP Cloud Integration.

For now, you can continue to use ${in.body} for your existing integration flows,

However, SAP recommends using ${body} instead of ${in.body} for all new integration flows to ensure compatibility with upcoming Camel versions, which may make the use of ${body} mandatory.

Error in Scheduler Based iFlows:

If your scheduler-based integration flow is in “Error” status with the following error message

“[CAMEL][IFLOW][NO_MORE_POLLS] : No more polls in schedule”

Example:

[CONTENT][CONTENT_DEPLOY][ArtifactDeploymentFailed] : All attempts of deployment of artifact failed. Error details: […] missing requirement […] osgi.wiring.package; (osgi.wiring.package=org.apache.camel.component.quartz2) Unresolved requirements: […] osgi.wiring.package; (osgi.wiring.package=org.apache.camel.component.quartz2)]].

Resolution:

Update the configuration of the scheduler so that a valid date/time is selected for the next scheduled run of the iFlow, and redeploy the iFlow after making the change.No consumers available on endpoint error:

If you are using ProcessDirect adapter in your integration flow, that fails with “No consumers available on endpoint” error

Resolution:

Make sure to remove the following whitespace characters when setting the ProcessDirect target endpoint

Whitespace characters are affected due to the Camel change. Below is the list of affected characters.

t      the tab character (u0009)n      the newline (line feed) character (u000A)r      the carriage-return character (u000D)f      the form-feed character (u000C)x0B the vertical tabulation (VT) characterExchange properties: 

After the upgrade of camel version 3.14, the following error happens during integration flow processing at Filter step with XPath expression:

org.apache.camel.language.simple.types.SimpleIllegalSyntaxException: Unknown function: property.propertyname at location 0 ${property.propertyname} * , cause: org.apache.camel.language.simple.types.SimpleParserException: Unknown function: property.propertyname

Resolution:

In the filter “${property.propertyname}” needs to be changed to “${exchangeProperty.PropertyName}”.

Make sure to use exchangeProperty instead of property when referencing any property in the integration flow filter step in XPath expression.

Changes to Groovy Scripts:

SAP recommends that you use the Attachment Wrapper class to handle attachments in groovy scripts. The class – AttachmentWrapper, as a replacement for DefaultAttachment and Attachment.

After making the recommended changes, you must redeploy your script artifacts and integration flows for the changes to get activated.

Existing Script

import com.sap.gateway.ip.core.customdev.util.Message;
import org.apache.camel.impl.DefaultAttachment;
import javax.mail.util.ByteArrayDataSource;
import javax.mail.internet.MimeUtility;

def Message getEmailData(Message message) {

String body = message.getBody(String.class);
def attachmentDataSource = new ByteArrayDataSource(“Test Content”.getBytes(), “text/html”);

def defaultAttachment = new DefaultAttachment(attachmentDataSource); //Unsupported DefaultAttachment object is being created.

message.addAttachmentObject(“AttachmentObject”, defaultAttachment);
return message;

}

Proposed Script

import com.sap.gateway.ip.core.customdev.util.Message;
import com.sap.gateway.ip.core.customdev.util.AttachmentWrapper;
import javax.mail.util.ByteArrayDataSource;
import javax.mail.internet.MimeUtility;

def Message getEmailData(Message message) {

String body = message.getBody(String.class);

def attachmentDataSource = new ByteArrayDataSource(“Test Content”.getBytes(), “text/html”);

def defaultAttachment = new AttachmentWrapper(attachmentDataSource); //Usage of AttachmentWrapper, replacement for DefaultAttachment

message.addAttachmentObject(“AttachmentObject”, defaultAttachment);
return message;

}

 

The AttachmentWrapper works well for all Apache Camel versions.

6. Invalid content was found starting with element ‘camel:property’: 

The issue occurs when your tenant has been updated to a higher Apache Camel version. 

Example: 

[CAMEL][IFLOW][CAUSE]: Cause: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element ‘camel:property’.

Resolution: 

Verify that the Start Timer/Sender Adapter Scheduler configurations are as per requirements and redeploy the integration flow. 

7. AS2 & AS4 integration adapters run into multiple retries in Camel 3.x runtime:

For the tenants in SAP Cloud Integration using Apache Camel 3.14 runtime, the integration flows utilizing AS2 and AS4 adapters experience frequent retries during message processing failures.

This occurs if under ‘Delivery Assurance’ tab anything except ‘Best Effort’ is selected in ‘Quality of Service’ drop-down, regardless of the ‘Retry Interval’ configuration.

Moreover, for AS4 adapters, this issue occurs only if under ‘Delivery Assurance’ tab you have selected ‘Temporary Storage’ as ‘JMS Queue’.

The frequency of retries depends on the time it takes for the integration flow to process the message. For instance, if a retry message fails in 1 second, the next retry executes immediately after the previous execution failure.

The JMS component internally uses an exchange header for Camel 2.x, which is unavailable upon transitioning to Camel 3.x causing multiple retries.

Resolution: Redeploy the integration flow.

8. Attribute ‘uri’ is not allowed to appear in element ‘camel:enrich’:

If your integration flow is in “Error” state with the following error messages

[CAMEL][IFLOW][ERROR]: Integration flow failed.

 [CAMEL][IFLOW][EXCEPTION]: org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to validate xml

 [CAMEL][IFLOW][CAUSE]: Cause: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute ‘uri’ is not allowed to appear in element ‘camel:enrich’.

Resolution: Verify that the Start Timer/Sender Adapter Scheduler configurations are as per requirements and redeploy the integration flow. 

9. ResolveEndpointFailedException : Failed to resolve endpoint

The issue occurs when your tenant has been updated to a higher Apache Camel version.

org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: ahc://https://<tenantId>-iflmap.hcisb.<landscape-name>/http?binding=%23binding_Receiver_HTTP&clientConfig=%23clientConfig_Receiver_HTTP&clientConfig.connectTimeout=10000&clientConfig.idleConnectionInPoolTimeoutInMs=60000&clientConfig.idleConnectionTimeoutInMs=60000&clientConfig.requestTimeoutInMs=60000 

There are 3 parameters that couldn’t be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint.

Unknown parameters=[{idleConnectionInPoolTimeoutInMs=60000, idleConnectionTimeoutInMs=60000, requestTimeoutInMs=60000}]

Resolution: Verify that the Start Timer/Sender Adapter Scheduler configurations are as per requirements and redeploy the integration flow. 

 

Conclusion:

I have compiled this blog covering majority of potential impacts, and their resolutions for CPI tenants upgrading to the latest Apache Camel version, based on SAP guidance.  This guide should help you to ensure a seamless transition to Apache Camel 3.14, minimizing potential disruptions and maximizing the benefits of the upgrade.

For more information: https://me.sap.com/notes/3383568 

 

 

 

​ SAP CPI has recently upgraded its Apache Camel runtime from version 2.24 to 3.14.7. This upgrade is significant for users who have deployed custom integration adapters, as they must validate their adapters in the new runtime before the update is applied.When SAP CPI upgrades to the latest version, it can have several impacts on your tenant, especially if you have custom integrations or adapters. Some Groovy scripts and Camel expressions may need adjustments due to syntax changes.To check your Cloud Integration suite tenant version: https://me.sap.com/notes/0002351301The latest SAP CPI version introduces several new features and enhancements aimed at improving integration capabilities and user experience. Here are some highlights:Users can now see detailed deployment information, including runtime status, deployed by, deployed on, and deployed version.New options allow configuring namespace and prefixes for externally referenced schemas in Message Mapping.AS2/AS2 MDN Sender Adapter Update – The X-content-type-options header is now suppressed to comply with the AS2 protocol.New parameters have been added to SFTP and AMQP adapters, offering better control over data transfers.Diagnostic tasks in Edge Integration Cell provide better debugging capabilities.EDI Flat-File Payload Support: The previous version lacked native support for EDI flat-file payloads, which is now available.Principal propagation for on-premise connections is now supported, improving security and integration.The latest Apache Camel upgrade introduces some notable changes in Integration suite, which may impact the integration flows. Here’s a comprehensive rundown of potential impacts and corresponding resolutions provided by SAP, for CPI tenants upgrading to Apache Camel 3.14 – all in one place for easy reference:SimpleParserException:If an integration flow is in status “Error” and the error details from the “Manage Integration Content” view show a SimpleParserExceptionExample:[CAMEL][IFLOW][CAUSE]: Cause: org.apache.camel.language.simple.types.SimpleParserException: Unknown function: ${In.Body}…org.apache.camel.language.simple.types.SimpleParserException: Unknown function: NullResolution:In this error, it is expression ${In.Body} which makes the issue. Due to it has an incorrect capitalization, typographical error. Correct expression could be currently ${in.body}.The expression ${in.body} is still supported in the new Camel 3.14-based runtime of SAP Cloud Integration.For now, you can continue to use ${in.body} for your existing integration flows,However, SAP recommends using ${body} instead of ${in.body} for all new integration flows to ensure compatibility with upcoming Camel versions, which may make the use of ${body} mandatory.Error in Scheduler Based iFlows:If your scheduler-based integration flow is in “Error” status with the following error message“[CAMEL][IFLOW][NO_MORE_POLLS] : No more polls in schedule”Example:[CONTENT][CONTENT_DEPLOY][ArtifactDeploymentFailed] : All attempts of deployment of artifact failed. Error details: missing requirement osgi.wiring.package; (osgi.wiring.package=org.apache.camel.component.quartz2) Unresolved requirements:  osgi.wiring.package; (osgi.wiring.package=org.apache.camel.component.quartz2)]].Resolution:Update the configuration of the scheduler so that a valid date/time is selected for the next scheduled run of the iFlow, and redeploy the iFlow after making the change.No consumers available on endpoint error:If you are using ProcessDirect adapter in your integration flow, that fails with “No consumers available on endpoint” errorResolution:Make sure to remove the following whitespace characters when setting the ProcessDirect target endpointWhitespace characters are affected due to the Camel change. Below is the list of affected characters.t      the tab character (u0009)n      the newline (line feed) character (u000A)r      the carriage-return character (u000D)f      the form-feed character (u000C)x0B the vertical tabulation (VT) characterExchange properties: After the upgrade of camel version 3.14, the following error happens during integration flow processing at Filter step with XPath expression:org.apache.camel.language.simple.types.SimpleIllegalSyntaxException: Unknown function: property.propertyname at location 0 ${property.propertyname} * , cause: org.apache.camel.language.simple.types.SimpleParserException: Unknown function: property.propertynameResolution:In the filter “${property.propertyname}” needs to be changed to “${exchangeProperty.PropertyName}”. Make sure to use exchangeProperty instead of property when referencing any property in the integration flow filter step in XPath expression.Changes to Groovy Scripts:SAP recommends that you use the Attachment Wrapper class to handle attachments in groovy scripts. The class – AttachmentWrapper, as a replacement for DefaultAttachment and Attachment.After making the recommended changes, you must redeploy your script artifacts and integration flows for the changes to get activated.Existing Scriptimport com.sap.gateway.ip.core.customdev.util.Message;
import org.apache.camel.impl.DefaultAttachment;
import javax.mail.util.ByteArrayDataSource;
import javax.mail.internet.MimeUtility;

def Message getEmailData(Message message) {

String body = message.getBody(String.class);
def attachmentDataSource = new ByteArrayDataSource(“Test Content”.getBytes(), “text/html”);

def defaultAttachment = new DefaultAttachment(attachmentDataSource); //Unsupported DefaultAttachment object is being created.

message.addAttachmentObject(“AttachmentObject”, defaultAttachment);
return message;

}Proposed Scriptimport com.sap.gateway.ip.core.customdev.util.Message;
import com.sap.gateway.ip.core.customdev.util.AttachmentWrapper;
import javax.mail.util.ByteArrayDataSource;
import javax.mail.internet.MimeUtility;

def Message getEmailData(Message message) {

String body = message.getBody(String.class);

def attachmentDataSource = new ByteArrayDataSource(“Test Content”.getBytes(), “text/html”);

def defaultAttachment = new AttachmentWrapper(attachmentDataSource); //Usage of AttachmentWrapper, replacement for DefaultAttachment

message.addAttachmentObject(“AttachmentObject”, defaultAttachment);
return message;

} The AttachmentWrapper works well for all Apache Camel versions.6. Invalid content was found starting with element ‘camel:property’: The issue occurs when your tenant has been updated to a higher Apache Camel version. Example: [CAMEL][IFLOW][CAUSE]: Cause: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element ‘camel:property’.Resolution: Verify that the Start Timer/Sender Adapter Scheduler configurations are as per requirements and redeploy the integration flow. 7. AS2 & AS4 integration adapters run into multiple retries in Camel 3.x runtime:For the tenants in SAP Cloud Integration using Apache Camel 3.14 runtime, the integration flows utilizing AS2 and AS4 adapters experience frequent retries during message processing failures.This occurs if under ‘Delivery Assurance’ tab anything except ‘Best Effort’ is selected in ‘Quality of Service’ drop-down, regardless of the ‘Retry Interval’ configuration.Moreover, for AS4 adapters, this issue occurs only if under ‘Delivery Assurance’ tab you have selected ‘Temporary Storage’ as ‘JMS Queue’.The frequency of retries depends on the time it takes for the integration flow to process the message. For instance, if a retry message fails in 1 second, the next retry executes immediately after the previous execution failure.The JMS component internally uses an exchange header for Camel 2.x, which is unavailable upon transitioning to Camel 3.x causing multiple retries.Resolution: Redeploy the integration flow.8. Attribute ‘uri’ is not allowed to appear in element ‘camel:enrich’:If your integration flow is in “Error” state with the following error messages[CAMEL][IFLOW][ERROR]: Integration flow failed. [CAMEL][IFLOW][EXCEPTION]: org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to validate xml [CAMEL][IFLOW][CAUSE]: Cause: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute ‘uri’ is not allowed to appear in element ‘camel:enrich’.Resolution: Verify that the Start Timer/Sender Adapter Scheduler configurations are as per requirements and redeploy the integration flow. 9. ResolveEndpointFailedException : Failed to resolve endpointThe issue occurs when your tenant has been updated to a higher Apache Camel version.org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: ahc://https://<tenantId>-iflmap.hcisb.<landscape-name>/http?binding=%23binding_Receiver_HTTP&clientConfig=%23clientConfig_Receiver_HTTP&clientConfig.connectTimeout=10000&clientConfig.idleConnectionInPoolTimeoutInMs=60000&clientConfig.idleConnectionTimeoutInMs=60000&clientConfig.requestTimeoutInMs=60000 There are 3 parameters that couldn’t be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint.Unknown parameters=[{idleConnectionInPoolTimeoutInMs=60000, idleConnectionTimeoutInMs=60000, requestTimeoutInMs=60000}]Resolution: Verify that the Start Timer/Sender Adapter Scheduler configurations are as per requirements and redeploy the integration flow.  Conclusion:I have compiled this blog covering majority of potential impacts, and their resolutions for CPI tenants upgrading to the latest Apache Camel version, based on SAP guidance.  This guide should help you to ensure a seamless transition to Apache Camel 3.14, minimizing potential disruptions and maximizing the benefits of the upgrade.For more information: https://me.sap.com/notes/3383568      Read More Technology Blog Posts by Members articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author