Exploring Internals and Discovering Hidden Features of Cloud Services: SAP Cloud Platform Integration Showcase
Event: SAP Inside Track Vienna 2019
Date: November 23, 2019
Speaker: Vadim Klimov
Session: Exploring internals and discovering hidden features of cloud services: SAP Cloud Platform Integration showcase
service components comply with terms of use agreement of the service? SAP CPI is provisioned as iPaaS – why shall a developer / architect be bothered about the internal mechanics of the cloud service? Can such activities introduce side effects, negative impact on service stability, performance or security?
Management Node (TMN) Web UI Runtime (Worker) Node(s) (IFLMAP) Participant (System) A Participant (System) B Internal APIs • Operations API Command Framework • Web UI API (itspaces) E.g. Catalog API, Workspace API • Alert Retrieval API Public OData APIs (SAP API Business Hub) • Integration Content API • Log Files API • Message Processing Logs API • Message Store API • Partner Directory API • Security Content API
OSGi Framework OSGi Container (Application Runtime) Integration Framework Additional SAP CPI Specific Components SAP JVM Java runtime and accompanying tooling and services Apache Karaf OSGi application runtime / container. Designed to use Apache Felix or Eclipse Equinox as OSGi framework Linux SUSE Operating system environment, including corresponding required services and resources (CPU, memory, filesystems, network, etc.) Apache Felix OSGi framework and service platform Apache Camel Integration framework based on enterprise integration patterns. Among other deployment options, designed to work inside OSGi container CPI specific components SAP CPI specific tooling and components. Deployed to runtime node as OSGi bundles
SAP JVM Apache Felix Apache Karaf Apache Camel Additional SAP CPI Specific Components JVM layer (runtime & services) • Java runtime properties System, Runtime.runtime • Groovy runtime properties GroovySystem • JVM startup arguments RuntimeMXBean.inputArguments • Platform MXBeans Operating System, Runtime, Thread, Memory, Garbage Collector, Class Loading, etc. • MBeans Felix and Karaf shell commands, etc. • Class loaders • Attach API OSGi layer • OSGi bundle context FrameworkUtil.getBundle({…}).bundleC ontext Information about bundles (versions, resources, etc.), operations on bundles • Service references • OSGi shell commands execution • Events – Event Admin Service System environment layer • Environment properties System.getenv() • Access to some directories (such as home – /usr/sap/ljs/home) and files File(‘{…}’).bytes, File(‘{…}’).text • Access to Linux pseudo-filesystem / proc Information about filesystems and mount points, networking layer, processes (/proc/{pid}), statistics about CPU and memory usage, etc. • Directories monitoring in real time (WatchService for FileSystems / Paths) Integration framework layer • Camel context Message.exchange.context Includes properties (such as Camel version) and context objects (such as endpoints, components, routes)
Apache Karaf Apache Camel SAP CPI Web UI Integration flow consists of one or multiple integration processes. Each integration process exposes an endpoint. Integration process is deployed to runtime as a Camel route. Camel route is added to a Camel context. Each integration flow is started within a separate context. Endpoint creates exchanges, where messages are processed (routed). Each integration flow is assembled and deployed as a separate OSGi Blueprint bundle. Some OSGi bundles together with other required resources are combined into features to ease application provisioning and management. For example, Camel Core feature comprises 30+ OSGi bundles.
https://github.com/codebude/cpi-dashboard CPI Filesystem Explorer by Ariel Bravo Ayala https://github.com/ambravo/CPI-FileSystemExplorer CPITracker by Morten Wittrock https://twitter.com/cpitracker
Explore exposed HTTP APIs of CPI nodes – both tenant management and runtime. PUBLIC API C h e c k A P I s c o n s u m e d b y standard tools – for example, by Web UI tools. INTERNAL API CPI is based on A p a c h e C a m e l f r a m e w o r k – e x p l o r e C a m e l c o n t e x t a n d components. CAMEL FRAMEWORK Examine runtime environment, its startup arguments and properties. RUNTIME ENVIRONMENT CPI runs in OSGi container – explore OSGi Framework s p e c i f i c a t i o n , bundles context and components. OSGI FRAMEWORK AND CONTAINER Pay attention to threads’ call stack a n d c a l l e d components. THREAD DETAILS P r o g r a m m a t i c a l l y accessible monitoring and administration capabilities of JVM – JMX, JNI, JVM TI and Attach API, to name a few. JVM TOOLS
frameworks’ documentation. Refer to frameworks’ source code where possible and when in- depth insights are required. SHARE AND CONTRIBUTE Get involved in community discussions and contribute. Let other experts provide early feedback to your thoughts and developments. EXPLORE Don’t give up on examining fe at u re s b e h av i o r a n d putting your ideas and theories under test. There is no negative experience – instead, there are lessons learned. ACT RESPONSIBLY B e m i n d f u l o f t h e consequences – security aspects, runtime node stability, maintenance and s u p p o r t a b i l i t y o f t h e developed solution shall not b e u n d e re s t i m at e d o r compromised under no circumstances.