jahia dx 7.2 : bye bye felix, hello karaf
TRANSCRIPT
#jahiaXDC 1
Bye bye Felix, Hello Karaf
Serge Huber Jahia CTO & Co-Founder
Title of Presentation I Date of Presentation 2
What is this about ?
Bye Bye Felix, Hello Karaf I #jahiaXDC
Chronology
Jahia Digital Experience Manager (DX) 7.0 • Introduces OSGi for modules • Implemented using the embedded Apache Felix OSGi
framework implementation
Jahia Digital Experience Manager (DX) 7.1 • No major change in the OSGi framework
Jahia Digital Experience Manager (DX) 7.2 (upcoming) • Replaces the embedded Felix Framework with Apache
Karaf (embedded)
Apache Unomi • Part of Jahia Marketing Factory • Built on top of a standalone Apache Karaf runtime
Bye Bye Felix, Hello Karaf I #jahiaXDC 4
- Open Source OSGi Framework implementation - Implements part of the OSGi Compendium such as :
- HTTP Service - Shell Service (Gogo Shell) - Configuration Admin Service - Event Service
- Provides additional tools such as: - Web Console - iPOJO - uPNP support
Bye Bye Felix, Hello Karaf I #jahiaXDC 5
• “The Tomcat for OSGI”, basically all you will need for a minimal server OSGi runtime (where Felix is not necessarily focused at servers)
• Uses Apache Felix or Eclipse Equinox as the OSGi Framework implementation
• Provides a lot of additional services such as : - Serious logging (Felix is really basic), backed by Log4J - Provisioning (Features) - Advanced remote SSH Shell - Two-way data binding configuration files - JMX support - Diagnostic and developer commands - JAAS support
KarafAPACHE
Title of Presentation I Date of Presentation 6
Comparison
Bye Bye Felix, Hello Karaf I #jahiaXDC 7
Quick comparison
Felix Karaf
OSGi Specification Version supported
R4 R6 (adds enterprise technologies)
Embedded Felix Framework Version
4.2.1 5.4.0
Remote Shell technology Telnet (insecure), deactivated by default
SSH (secure), activated by default
Shell autocompletion no yes
Shell help no yes
Shell history no yes
Bye Bye Felix, Hello Karaf I #jahiaXDC 8
Quick comparison, continued
Supports regions (OSGi subsystems) no yes
Karaf Cellar (clustering) no yes
Karaf Decanter (monitoring) no yes
Karaf Cave (repository) no yes
Karaf Features (bundle packages) (provisioning) no yes
Two-way OSGi configuration sync (file to memory and back) no yes
Bye Bye Felix, Hello Karaf I #jahiaXDC 9
Quick comparison, continued
Deploy bundle/features directly from Maven repository (or Karaf Cave)
no yes
Built-in support from JAR wrapping (dynamic generation of OSGi bundle from non-OSGi jar)
no yes
Built-in features (Spring, Blueprint, Hibernate) no yes
Diagnostic, JMX features no yes
Developer features (bundle:watch) no yes
Bye Bye Felix, Hello Karaf I #jahiaXDC 10
Quick comparison, continued
Paves the way to a standalone runtime
no yes
Enterprise features (JNDI, JDBC, JPA, JTA, CDI, ...)
no yes
Security support (encryption, RBAC, JAAS, …)
no yes
Linux Comparison Similar to Linux Kernel Similar to “Lightweight” Linux Distribution (Debian)
Title of Presentation I Date of Presentation 11
What’s New
Bye Bye Felix, Hello Karaf I #jahiaXDC 12
Apache Karaf Shell
Bye Bye Felix, Hello Karaf I #jahiaXDC 13
Apache Karaf Provisioning Features
A feature describes an application as: • a name • a version • a optional description (eventually with a long description) • a set of bundles • optionally a set configurations or configuration files • optionally a set of dependency features
Bye Bye Felix, Hello Karaf I #jahiaXDC 14
Apache Karaf Features, continued
Karaf Shell - “feature:install feature1” will install all defined bundles for the feature name “feature1”
<features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0"> <feature name="feature1" version="1.0.0"> <bundle>...</bundle> <bundle>...</bundle> </feature> <feature name="feature2" version="1.1.0"> <feature>feature1</feature> <bundle>...</bundle> </feature></features>
Bye Bye Felix, Hello Karaf I #jahiaXDC 15
Apache Features, continued
Dependent features
means that when you install the “my-project” feature, the “other” feature will also get installed if it is not already there.
<feature name="my-project" version="1.0.0"> <feature>other</feature> <bundle start-level="80" start="false">mvn:com.mycompany.myproject/myproject-dao</bundle> <bundle start-level="85" start="false">mvn:com.mycompany.myproject/myproject-service</bundle> </feature>
Bye Bye Felix, Hello Karaf I #jahiaXDC 16
Building your own feature
<project xmlns=“http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=“http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd”> … <packaging>feature</packaging> <dependencies> <dependency> <groupId>org.jahia.modules</groupId> <artifactId>spam-filtering</artifactId> <version>2.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>org.jahia.modules</groupId> <artifactId>jahia-watcher-backend</artifactId> <version>1.0-SNAPSHOT</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.karaf.tooling</groupId> <artifactId>karaf-maven-plugin</artifactId> <version>4.0.3</version> <extensions>true</extensions> <configuration> <includeTransitiveDependency>false</includeTransitiveDependency> </configuration> </plugin> </plugins> </build> </project>
Bye Bye Felix, Hello Karaf I #jahiaXDC 17
Building your own feature
mvn clean install
karaf> feature:repo-add mvn:org.jahia.modules/jahia-watcher-backend-karaf-feature/1.0-SNAPSHOT/xml/features karaf> feature:install jahia-watcher-backend-karaf-feature
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0" name="jahia-watcher-backend-karaf-feature"> <feature name="jahia-watcher-backend-karaf-feature" description="Jahia Watcher DX module Apache Karaf Feature" version="1.0.0.SNAPSHOT"> <details>This project packages the backend for the Jahia Watcher mobile application as a Karaf Feature to be deployed in Jahia DX</details> <bundle>mvn:org.jahia.modules/spam-filtering/2.0.1-SNAPSHOT</bundle> <bundle>mvn:org.jahia.modules/jahia-watcher-backend/1.0-SNAPSHOT</bundle> </feature> </features>
Bye Bye Felix, Hello Karaf I #jahiaXDC 18
Apache Features, continued
Features can do a lot more: - Provide embedded configuration properties - Provide configuration files directly - Features repositories (i.e. a <features> XML file) URLs can be added or
removed at any time - Features may specify requirements (using OSGi capabilities) - Features may also be controlled through JMX - Features may be upgraded (by simply installing a new version) - Features also work with Karaf Cellar, making it possible to install features
over a cluster
Title of Presentation I Date of Presentation 19
Jahia DX Integration
Bye Bye Felix, Hello Karaf I #jahiaXDC 20
Features for Jahia Modules
• Features provide a more powerful way to package collection of bundles than our existing (<7.2) MegaJAR technology
• Dependency on other features makes it easier to install more complex applications
• Cluster compatibility (through Karaf Cellar) will also make installation complex installations on a cluster easier
• At Jahia we will probably deprecate MegaJARs at some point once customer have shifted to Features
• Jahia’s other applications (Marketing Factory, Form Factory, Commerce Factory, Workspace Factory), will probably be all delivered as features over time
Bye Bye Felix, Hello Karaf I #jahiaXDC 21
Jahia DX Integration
Migration • For most users, should be transparent, no change needed to modules or
configuration • If you performed modifications to the default felix-framework.properties file
those changes will need to be moved to another file (or removed)
Limitations • Existing features that depends on “web”, “pax-web” or “spring” features will
not work out of the box (because these technologies are exposed by DX’s core)
Title of Presentation I Date of Presentation 22
Karaf Sub-Projects
Bye Bye Felix, Hello Karaf I #jahiaXDC 23
Karaf Cellar
• Brings bundle clustering to Karaf instances
• Karaf itself provides HA (lock) • Karaf Cellar brings cluster:sync
provisioning between Karaf instances • Leverages Hazelcast • Easy to install and use • No single point of failure • Provide DOSGi support
(kind of RMI)
Karaf Node CELLAR
Karaf Node CELLAR
Karaf Node CELLAR
Bye Bye Felix, Hello Karaf I #jahiaXDC 24
Karaf Decanter
• Apache Karaf Decanter, complete monitoring platform for Karaf and related (Camel, ActiveMQ, ...)
• Collectors (JMX, log messages, ...) • Dispatched by OSGi EventAdmin • Appenders (Elasticsearch, log,
JDBC, ...) • Dashboards (Kibana) and SLA
Bye Bye Felix, Hello Karaf I #jahiaXDC 25
Other interesting Karaf projects
Karaf Cave • OSGi Repository implementation Karaf Boot • Get started quickly with a Karaf project, similar to Spring Boot but for OSGi
projects • Very early stages Karaf Maven Plugin • Helps built feature or KAR packages • Generates help for shell commands • Custom Karaf Distributions (for example Apache Unomi)
Title of Presentation I Date of Presentation 26
Demo
Title of Presentation I Date of Presentation 27
Q & A
Title of Presentation I Date of Presentation 28
Thank you !
Bye Bye Felix, Hello Karaf I #jahiaXDC 29
Resources
Jahia Digital Experience Manager http://www.jahia.com
Apache Karaf http://karaf.apache.org
Reach me at : [email protected], @sergehuber