Apache Karaf in real life ApacheCon NA 2014



Similar documents
FUSE-ESB4 An open-source OSGi based platform for EAI and SOA

Building a Modular Server Platform with OSGi. Dileepa Jayakody Software Engineer SSWSO2 Inc.

Apache Sling A REST-based Web Application Framework Carsten Ziegeler cziegeler@apache.org ApacheCon NA 2014

CHAPTER 1 - JAVA EE OVERVIEW FOR ADMINISTRATORS

Course Description. Course Audience. Course Outline. Course Page - Page 1 of 5

MagDiSoft Web Solutions Office No. 102, Bramha Majestic, NIBM Road Kondhwa, Pune Tel: /

WEBLOGIC ADMINISTRATION

IKAN ALM Architecture. Closing the Gap Enterprise-wide Application Lifecycle Management

GlassFish v3. Building an ex tensible modular Java EE application server. Jerome Dochez and Ludovic Champenois Sun Microsystems, Inc.

Oracle WebLogic Server 11g Administration

Enterprise Service Bus

Server-side OSGi with Apache Sling. Felix Meschberger Day Management AG 124

Talend ESB. Getting Started Guide 5.5.1

New Features... 1 Installation... 3 Upgrade Changes... 3 Fixed Limitations... 4 Known Limitations... 5 Informatica Global Customer Support...

The future of middleware: enterprise application integration and Fuse

SOA-14: Continuous Integration in SOA Projects Andreas Gies

Enterprise Service Bus Evaluation as Integration Platform for Ocean Observatories

Operations and Monitoring with Spring

Automated performance testing using Maven & JMeter. George Barnett, Atlassian Software

IBM WebSphere Server Administration

Basic TCP/IP networking knowledge of client/server concepts Basic Linux commands and desktop navigation (if don't know we will cover it )

WebSphere Server Administration Course

SUBSYSTEMS IN THE WILD

WELCOME TO Open Source Enterprise Architecture

ITG Software Engineering

Software project management. and. Maven

No.1 IT Online training institute from Hyderabad URL: sriramtechnologies.com

Software project management. and. Maven

SOA Software: Troubleshooting Guide for Agents

Next Generation Open Source Messaging with Apache Apollo

Content. Development Tools 2(63)

Nexus Professional Whitepaper. Repository Management: Stages of Adoption

DEPLOYMENT GUIDE Version 1.2. Deploying F5 with Oracle E-Business Suite 12

Enterprise Manager 12c for Middleware

D5.4.4 Integrated SemaGrow Stack API components

Integration in the cloud - IPaaS with Fuse technology. Charles Moulliard Apache Committer

Building a Service Oriented Architecture with ServiceMix. Jeff Genender CTO Savoir Technologies, Inc

Talend Open Studio for ESB. Release Notes 5.2.1

Learning GlassFish for Tomcat Users

Load Testing with JMeter

NextRow - AEM Training Program Course Catalog

Oracle Fusion Middleware

Sonatype CLM Enforcement Points - Continuous Integration (CI) Sonatype CLM Enforcement Points - Continuous Integration (CI)

1. Introduction What is Slice? Background Why Slice? Purpose of this Document Intended Audience...

Converting Java EE Applications into OSGi Applications

Build management & Continuous integration. with Maven & Hudson

Swordfish SOA Runtime Framework

Builder User Guide. Version Visual Rules Suite - Builder. Bosch Software Innovations

RED HAT JBOSS FUSE. An open source enterprise service bus

Apache Traffic Server Extensible Host Resolution

SDK Code Examples Version 2.4.2

SAP HANA SPS 09 - What s New? SAP HANA Application Lifecycle Management

This document summarizes the steps of deploying ActiveVOS on the IBM WebSphere Platform.

SSO Plugin. Release notes. J System Solutions. Version 3.6

InfoSphere Master Data Management operational server v11.x OSGi best practices and troubleshooting guide

Builder User Guide. Version 5.4. Visual Rules Suite - Builder. Bosch Software Innovations

Managing your Red Hat Enterprise Linux guests with RHN Satellite

Oracle Exam 1z0-599 Oracle WebLogic Server 12c Essentials Version: 6.4 [ Total Questions: 91 ]

TIBCO Silver Fabric Continuity User s Guide

NetBeans IDE Field Guide

Running a Workflow on a PowerCenter Grid

TIBCO Spotfire Platform IT Brief

The Hitchhiker's Guide to Mobile Apps Test Automation Galaxy

Fuse MQ Enterprise Broker Administration Tutorials

Fuse ESB Enterprise Installation Guide

Jitterbit Technical Overview : Microsoft Dynamics CRM

How To Develop An Open Play Context Framework For Android (For Android)

Integrating your Maven Build and Tomcat Deployment

McAfee Web Gateway 7.4.1

User Guide. You will be presented with a login screen which will ask you for your username and password.

An Oracle White Paper October BI Publisher 11g Scheduling & Apache ActiveMQ as JMS Provider

A Talk ForApacheCon Europe 2008

Migrating Applications From IBM WebSphere to Apache Tomcat

Monitoring applications in multitier environment. Uroš Majcen A New View on Application Management.

Developing Service-Oriented Architecture Applications with OSGi

Introduction to Mobile Access Gateway Installation

Eclipse Summit Europe 2008

PUBLIC Secure Login for SAP Single Sign-On Implementation Guide

Glassfish Architecture.

Understanding class paths in Java EE projects with Rational Application Developer Version 8.0

Hudson configuration manual

Alliance Key Manager A Solution Brief for Technical Implementers

Sonatype CLM for Maven. Sonatype CLM for Maven

OpenESB Standalone Edition V3.0 Web admin console

}w!"#$%&'()+,-./012345<ya

Introduction to Sun ONE Application Server 7

WhatsUp Gold v16.3 Installation and Configuration Guide

Building a Reliable Messaging Infrastructure with Apache ActiveMQ

Continuous integration in OSGi projects using Maven (v:0.1) Sergio Blanco Diez

EMC Documentum Content Services for SAP Repository Manager

Repository Management with Nexus

Unlocking the Secrets of Alfresco Authentication. Mehdi BELMEKKI,! Consultancy Team! Alfresco!

Eclipse Exam Scripting

1 What is Cloud Computing? Cloud Infrastructures OpenStack Amazon EC CAMF Cloud Application Management

RESTful web applications with Apache Sling

Appendix A. Editing Profiles with the Built-In Text Editor

Presentation of Enterprise Service Bus(ESB) and. Apache ServiceMix. Håkon Sagehaug

: Test 217, WebSphere Commerce V6.0. Application Development

Installing and Administering VMware vsphere Update Manager

Transcription:

Apache Karaf in real life ApacheCon NA 2014

Agenda Very short history of Karaf Karaf basis A bit deeper dive into OSGi Modularity vs Extensibility DIY - Karaf based solution What we have learned New and noteworthly in Karaf 3.0

About me I m Pole Husband Open source commiter & consultant Traveller.. and Construction worker :)

Very short history of Apache Karaf

Karaf the beginning Born as ServiceMix 4 platform kernel in 2007 Moved to Apache Felix community in 2009 Top level project since June 2010

Karaf versions 1.x - legacy 2.1 - outdated 2.2.x - Based on OSGi 4.2 2.3.x - Based on OSGi 4.3 3.0 - Based on OSGi 5.0

Karaf versions cont. 2.4.x - might support OSGi 5.0 frameworks and features 3.1 - future release for things delaying 3.0 release

Karaf basis

What you already saw in most of presentations Source: http://felix.apache.org/

What was told to you Source: http://denise-theonepersonproject.blogspot.com/

That s what you can do Source: http://freefoto.com/

Karaf grown to be a platform foundation Might run multiple applications at same time Each app may use different technologies Keeps things separate Has support for full product life cycle Failover & load balancing features Powerful infrastructure for extensions

Bit deeper dive into OSGi

Source: http://osgi.org/ OSGi

In many cases OSGi is shown as worthless technology forcing you to have extra entries in manifest OSGi brings more problems than solutions Many libraries deny to support it because small user base

OSGi popularity by Maven Central Maven central is 426k JARs, assigned to 46k projects Just 10% of projects provides valid OSGi bundles OSGi core jar is at 36th position in download statistics 24k projects has transient OSGi dependencies Source: http://blog.osgi.org/ analysis done by Peter Kriens

OSGi lifecycle Bundle Activator call Source: http://docs.spring.io/

OSGi services are main source of dynamism in system

OSGi related design patterns Whiteboard Extender

Modularity vs Extensibility

Modular software Provides clear API and SPI contract Small set of dependencies Fine grained dependencies Lack of implementation specific depdenencies

Extensible software Provides plug in capabilities Does not lock extension to have its own extensions Extension registration should be as less verbose as possible

You can t build extensible solutions without making them modular first (C) Lukasz Dywicki

Your solution might be modular but not extensible at all (C) Lukasz Dywicki

Your software can be modular and extensible and still not run under OSGi (C) Lukasz Dywicki

Karaf based solution

Building solution on top of Karaf Make it OSGi friendly Make use of services Decide to use helpers like blueprint/spring/ declarative services Extend Karaf to support your domain Brand it, assemble as new product Ship it to customer

Making things OSGi friendly For maven users - use maven-bundle-plugin Take care about OSGification of your dependencies Push changes back to origin project if you can If fail - then wrap it If you do - then share results with community Keep naming convention strict & clear

Maven users <build> <parent> <plugins> <groupid>org.example</groupid> <plugin> <artifactid>parent</artifactid> <groupid>org.apache.felix</groupid> <version>2.0.0-snapshot</version> <artifactid>maven-bundle-plugin</artifactid> </parent> <extensions>true</extensions>! </plugin> <artifactid>api</artifactid> </plugins> <packaging>bundle</packaging> </build>

Dependency OSGification Quite simple if dependency uses Maven Best thing you can do is giving OSGi support back to project Exporting wrapped packages is bad practice If you wrap - then make separate bundle Submit patch for ServiceMix bundles gain karma

Extending Karaf Adopt default configuration to use own authentication source (or write new) Group your bundles into Karaf features Provide new set of commands supporting your product

Authentication sources Following authentication mechanisms are supported (JAAS login modules): JDBC LDAP OSGi configuration admin Property files Public key

Karaf features Simple descriptor with information which bundles from where should be installed Supports multiple protocols File HTTP / FTP etc mvn (pax-url-mvn) Supports transient dependencies, version ranges and custom resolvers

Karaf features cont. <features name="repository-name"> <repository>mvn:groupid/artifactid/version/xml/features</repository>! <feature name="my-solution" version="2.0"> <feature version="(1.1,1.1]">dependency-feature-name</feature> <bundle>mvn:groupid/artifactid/2.0</bundle> <bundle>mvn:groupid/another-artifactid/2.0</bundle> </feature> </features>

Karaf features cont. Install it: features:addurl mvn:groupid/artifactid/2.0/xml/ features features:install my-solution Add to default configuration etc/org.apache.karaf.features.cfg featuresrepositories += url featuresboot += my-solution

Implementing commands package org.apachecon.na;! import org.apache.felix.gogo.commands.command; import org.apache.karaf.shell.console.osgicommandsupport;! @Command(scope="example", name="do") public class SimpleCommand extends OsgiCommandSupport {! @Override protected Object doexecute() throws Exception { System.out.println("Something..."); return null; } }

Implementing commands Don t forget about few additional things: blueprint descriptor transient dependencies org.apache.felix.service.command org.apache.felix.gogo.commands org.apache.karaf.shell.console

Brand it create file branding.properties in org.apache.karaf.branding package Package as OSGi bundle and copy to lib/ directory

Use features-maven-plugin.. and assemble add-features-to-repo goal Most important configuration descriptors features repository => output directory

.. and assemble cont. At the end use assembly maven plugin to create ZIP/TAR archive! karaf-maven-plugin for Karaf 3.0 will create assembly with your features without any additional steps

What we have learned* * These things might be obvious..

Getting runtime metrics from couple Apache projects is hard

Common problems Developers not familiar with OSGi...NET developers using Java in first project.. Dependency upgrades Feature version ranges are hard to use By default shutdown timeout for Java Service Wrapper is just 30 seconds VM queues are danger when processing is very slow (OOME)

Common problems cont. Pre-defined assemlies are big Integration testing is slow Visual tools produces nice but useless artifacts Generated code Problematic testing Handling of KAR files Karaf feature URLs management

Standard OSGi problems Usage of legacy libraries not actively maintained Blueprint service caching in threads - they are blind for bundle/service upgrades Very hard to write perfect update scenario Impossible to determine change impact

Good things goes last Camel scales up very well ActiveMQ is good for having load balancing VM endpoints are damn fast Cassandra is damn fast too! Increase load by 300% just by enabling aggregation & batch processing

Few patterns which works pretty well ActiveMQ queue as central entry point Content based routing to glue components Very easy to track incoming load and spikes Messages are published via service call Separate destinations for OSGi services Uses Service Tracker to dynamically create camel routes VM endpoints everywhere, JMS where bottlenecks can occur

New and noteworthly in Karaf 3.0

Q&A

Stay in touch Twitter & skype: ldywicki luke@code-house.org https://github.com/splatch/apachecon