Technical Articles
Apache Camel Community adapters usage in SAP Cloud Integration
SAP Cloud Integration uses Apache Camel which is an open source framework provides message-oriented middleware with a rule-based routing and mediation engine. Apache Camel community provides larger no of standard apache camel components which provides uniform endpoint interfaces, to which Camel can send messages or receive messages from them. Basically, these Apache camel components acts as connector to any 3rd party systems, implementing enterprise integration patterns (EIP).
This blog talks about how to use Apache camel community standard components as SAP Cloud Integration (sender/receiver) adapters with a sample CPI integration flow to demonstrate usage of it.
We provide some of the standard Apache Camel Community components as SAP Cloud Integration ADK compliant adapters (ESA) files. These ESA files can be deployed into Cloud Integration runtime using Eclipse tooling Deploy Artefacts wizard.
For example, a sample ADK compliant adapter file for RabbitMQ Apache Camel Component
We are also providing sample Integration flow, which demonstrate the usage of the Apache Camel community Adapter. Just import the Integration flow artefact, provide the server configuration by referring to example provided in the adapter property sheet.
Please note that adapter ESA file should be deployed before importing the integration flow artefact.
Deploy the integration flow and check that the integration flow message processing successfully completed in the CPI monitoring
In this integration flow, whatever payload we have configured in the Message payload will be persisted to RabbitMQ queue. An example configuration used here as follows:
Sample input provided in the message payload content modifier:
Output you can see In the RabbitMQ Queue as you see below:
We are also providing the transformed project source code of Apache camel community standard components, which had Cloud integration ADK specific metadata pre-generated.
These source you can modify as per your requirements by importing the project in to Eclipse IDE using Maven project import wizard and do your changes as required, build the final project using Maven build , which will generate the ESA file which is the Cloud integration ADK compliant adapter.
You can find the all above mentioned artefacts in the SAP GitHub apibusinesshub-integration-recipes, whose link is provided below
Also going forward, we continue to provide more samples of Apache Camel components (https://github.com/apache/camel/tree/master/components ) as Cloud integration ADK
Compliant adapters. Here all the components we provide based on Apache Camel version 2.17.4.
Disclaimer: This adapter is shipped as “community contribution” under Apache 2.0 license; support for this adapter should be requested by raising an issue in the GitHub repo and not standard SAP channels.
Hello Mayur,
Great news and a reasonable move! I have a few questions!
-I had the knowledge that SAP didn't support custom CPI sender adapters in the past. Did that change?
RabbitMQ adapters sender/consumer will stay connected when the flow's status is deployed. There are adapters that connect, fetch data, and close the connection e.g. AWS S3 adapter. These polling adapters can benefit from a scheduler.
-How do you(also we since it is a community repo) plan to add this feature?
-If the CPI tenant has several runtime nodes how can we synchronize the scheduler? Is there an SAP supported standard way?
-Can we add the beautiful scheduler tab to the sender adapter configuration page?
If we implement these polling types of adapters as receiver/producer we can't start a new process for each file/item. We need another step to split them.
-Basically, can we recreate standard SFTP sender adapter behavior for other protocols?
Best regards,
Fatih
Thanks Fatih for the comments.
we have provided the source code of Apache Camel RabbitMQ component. which you can change and implement timer task , where you can do connect, fetch and close as desired.
you can also change the ADK UI metadata file to include custom attributed to support timer task configuration. which you can later read in consumer/producer side of the adapter logic.
RabbitMQ underneath uses AMQP protocol which is based on Events and pub/sub pattern which is completely different from SFTP behavior. so we cant replicate the same.
Best Regards,
Mayur
Hi Mayur,
I am very new to SAP platform, i need much information or sample code (java) about connection
between SAP HANA to Apache Camel endpoints , or Apache-camel Components to fetch or push
to SAP HANA. Or any other required information to know for better development.
Best Regards,
Jalaj Kumar M
Thanks for sharing this information!
I'm however wondering why we should use SAP CPI instead of just native Apache Camel. You obviously know both worlds. Where do you see the advantages of SAP CPI vs Apache Camel or of Apache Camel vs SAP CPI?