Apache Tamaya Configuring your Containers...

Similar documents
Pimping up Industry Devices with Rasperry Pi, Vert.x und Java 8

Service discovery in Kubernetes with Fabric8

ConfigJSR and Friends. Mark Struberg, RISE GmbH, Apache Software Foundation, INSO TU Wien

Configuration for Microprofile. Mark Struberg, Emily Jiang, John D. Ament 1.1,

Configuration for Microprofile. Mark Struberg, Emily Jiang 0.3,

Configuration for Microprofile. Mark Struberg, Emily Jiang, John D. Ament

Apache OpenWebBeans and DeltaSpike Deep Dive Mark Struberg Gerhard Petracek

Bloom Filters DOAG Webinar, 12 August 2016 Christian Antognini Senior Principal Consultant

Keep Learning with Oracle University

Oracle Access Management

MicroProfile - New and Noteworthy

Oracle In-Memory & Data Warehouse: The Perfect Combination?

Java Lounge. Integration Solutions madeeasy ComparisonofJava Integration Frameworks. Mario Goller

REALTIME WEB APPLICATIONS WITH ORACLE APEX

Best Practices for Testing SOA Suite 11g based systems

Scripting OBIEE Is UDML and XML all you need?

CON Apache Kafka

Get Groovy with ODI Trivadis

Designing for Performance: Database Related Worst Practices ITOUG Tech Day, 11 November 2016, Milano (I) Christian Antognini

JSR 365 (CDI 2.0) Review

Breaking Apart the Monolith with Modularity and Microservices CON3127

Query Optimizer MySQL vs. PostgreSQL

Domain Services Clusters Centralized Management & Storage for an Oracle Cluster Environment Markus Flechtner

Patterns and Best Practices for dynamic OSGi Applications

JSR 311: JAX-RS: The Java API for RESTful Web Services

1 25/07/2017 Big-Data- and Data-Science-Day 2017

Query Optimizer MySQL vs. PostgreSQL

Oracle Database Failover Cluster with Grid Infrastructure 11g Release 2

Microservices with Kafka Ecosystem. Guido Schmutz

Managing Installations and Provisioning of OSGi Applications. Carsten Ziegeler

Packaging and Deploying Java Based Solutions to WebSphere Message Broker V7

Welcome. Oracle SOA Suite meets Java The best of both worlds. Guido Schmutz DOAG Konferenz 2013 Nürnberg,

Automated Web Tests withselenium2

Identifying Performance Problems in a Multitenant Environment

IntelliJ IDEA Static Code Analysis Hamlet D'Arcy

Eclipse MicroProfile with Thorntail (formerly WildFly Swarm)

Cheat Sheet: Wildfly Swarm

From Java EE to Jakarta EE. A user experience

Online Operations in Oracle 12.2

Empfehlungen vom BigData Admin

Containers, Serverless and Functions in a nutshell. Eugene Fedorenko

About me. Jesper Pedersen. Project lead for. Chairman for Boston JBoss User Group. Core developer, JBoss by Red Hat

Integration of Oracle VM 3 in Enterprise Manager 12c

RESTful Microservices

JBoss Users & Developers Conference. Boston:2010

Welcome to the OWASP TOP 10

Eclipse MicroProfile: Accelerating the adoption of Java Microservices

Backup Methods from Practice

Sichere Software vom Java-Entwickler

Pitfalls & Surprises with DBMS_STATS: How to Solve Them

Scripting Languages in OSGi. Thursday, November 8, 12

Meet. Brian Stansberry Principal Software Engineer, Red Hat, Inc. June 10, Friday, June 14, 13

Big Data Big Mess? Ein Versuch einer Positionierung

Partitionierungsstrategien für Data Vault. Dani Schnider, Trivadis AG DOAG Konferenz, 23. November 2017

Using the new javax.cache Caching Standard

Oracle Database New Performance Features

Oracle Database 18c New Performance Features

Database Rolling Upgrade with Transient Logical Standby Database DOAG Day High Availability Robert Bialek Principal Consultant

Oracle Fusion Middleware 12c

Agenda Time (PT) 8:45 a.m. Event Platform Opening 9:00 a.m. Keynote - Java: Present and Future Java EE 7 Java SE 8 Java Embedded

Demystifying Microservices for Java EE Developers

JakartaEE and the road ahead An ASF View. Mark Struberg, RISE GmbH, Apache Software Foundation, INSO TU Wien

Mischa Kölliker. JavaLounge Zürich, 23. Juni 2009

GlassFish V3. Jerome Dochez. Sun Microsystems, Inc. hk2.dev.java.net, glassfish.dev.java.net. Session ID YOUR LOGO HERE

Liberty Right Fit for MicroProfile

Agenda. Why OSGi. What is OSGi. How OSGi Works. Apache projects related to OSGi Progress Software Corporation. All rights reserved.

MicroProfile: Optimizing Java EE For a Microservices Architecture

Oracle - Developing Applications for the Java EE 7 Platform Ed 1 (Training On Demand)

Application Containers an Introduction

GAVIN KING RED HAT CEYLON SWARM

IBM. IBM WebSphere Application Server Migration Toolkit. WebSphere Application Server. Version 9.0 Release

Nothing to see here...

Rest Client for MicroProfile. John D. Ament

Java EE 6: Develop Web Applications with JSF

I Got My Mojo Workin'

Shale and the Java Persistence Architecture. Craig McClanahan Gary Van Matre. ApacheCon US 2006 Austin, TX

Seam 3. Pete Muir JBoss, a Division of Red Hat

OSGi. Building and Managing Pluggable Applications

Developing Applications with Java EE 6 on WebLogic Server 12c

Docker and Oracle Everything You Wanted To Know

Optimizing Enterprise Java for a Microservices Architecture Otávio

Data Vault Partitioning Strategies. Dani Schnider, Trivadis AG DOAG Conference, 23 November 2017

Red Hat Developer Studio 12.0

Adaptive

Migrating traditional Java EE applications to mobile

PATTERNS & BEST PRACTICES FOR CDI


Oracle Audit in a Nutshell - Database Audit but how?

Recovery without Backup. All Data Lost?

JavaServer Faces Technology, AJAX, and Portlets: It s Easy if You Know How!

What s up with JMS 2.1?

The Next Generation. Prabhat Jha Principal Engineer

Oracle WebLogic Devcast Series: JMX for DevOps. Dr. Frank Munz ORACLE PRODUCT LOGO

Community Participation in the JCP Program: a winning combination November 2012

<Insert Picture Here> Java Virtual Developer Day

Analytic Views: Use Cases in Data Warehouse. Dani Schnider, Trivadis AG DOAG Conference, 21 November 2017

Spring Framework 2.5: New and Notable. Ben Alex, Principal Software Engineer, SpringSource

JSR 367 (JSON Binding) Review

Portlet Standard JSR 168 / JSR 286

Die Wundertüte DBMS_STATS: Überraschungen in der Praxis

Transcription:

Apache Tamaya Configuring your Containers... BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENF HAMBURG KOPENHAGEN LAUSANNE MÜNCHEN STUTTGART WIEN ZÜRICH

About Me Anatole Tresch Principal Consultant, Trivadis AG (Switzerland) Star Spec Lead Technical Architect, Lead Engineer PPMC Member Apache Tamaya @atsticks anatole@apache.org anatole.tresch@trivadis.com 2

Agenda Motivation Containers, Config and Java Apache Tamaya The API Demo & Outlook 3

Motivation 4

What is Configuration? Key/value pairs? Typed values? 5

When is Configuration useful? 6

How is it stored? Remote or locally? Classpath or file? Format? Multiple Sources? 7

When to configure? Build time? Deployment time? Dynamic? 8

Configuration Lifecycle? Static? Dynamic? Refreshing? Changes triggered? 9

Do I need a runtime? Java SE? Java EE? OSGI? 10

Common approaches? Hardcode everything Configure everything Use a monolithic configuration system Let each project/team decide (and implement!) 11

Microservices and Configuration

Using Java SE Environment Properties System Properties CLI arguments Properties, xml-properties Proprietary solutions (Spring, Archaia etc) 13

Using Java EE Well known and established Deployment Config only CDI for Application Configuration! New Config JSR for EE 8 in preparation! Mostly everything is XML 14

Using Something else... Files REST APIs 15

Java Based Solutions BYO (build your own) Spring Configuration Netflix Archaia Apache Tamaya Many more 16

? 17

Microservices run in Docker Configuration on deployment by environment properties: docker run e stage prod d n MyApp user/image Configuration with Dockerfile/Docker Image: FROM java:8 jre ADD /hello drop 1.0.jar // ADD /hello config.yml // EXPOSE 8090 8091 ENV stage prod ENTRYPOINT ["java", " jar", "/hello drop 1.0.jar",\ "server", "/hello config.yml"] 18

Problem Scope Multiple sources Multiple formats Multiple lifecycles Multiple priorities Configuration Context, e.g. application name, stage Environment Properties 19

What do we need? 20

An Abstraction. 21

An API. 22

Apache Tamaya 23

History of Apache Tamaya 2012: Configuration was voted an important aspect for Java EE 8 2013: Setup of Java EE Configuration JSR failed Standardization on SE Level did not have enough momentum 2016 Concepts and API are clear Release 0.2-incubating, 0.3-incubating until end of September ca. New Config EE JSR in preparation by Oracle 24

The Objectives of Apache Tamaya Common API for configuration Minimalistic Flexible, pluggable and extendible Compatible with Java 7 and beyond Provide a reference implementation Provide Extension Modules for additional features Build up a community Create a Standard! 25

Decouple your code from... Format Storage Lifecycle and versioning Security Distribution Consistency 26

Injection API @ConfigDefaultSections( com.mycomp.tenantadress ) public final class MyTenant{ } private String name; @Config(defaultValue= 2000 ) private long customerid; @Config({ private, business, [company.adress] }) private String address;... MyTenant t = new MyTenant(); ConfigurationInjection.getConfigurationInjector().configure(t); @RequestScoped public class MyClass{ @Inject private MyTenant t; } 27

Programmatic API Add dependency Configuration org.apache.tamaya:core: config = 0.2-incubating ConfigurationProvider.getConfiguration(); Add Config to META-INF/javaconfiguration.properties String name = config.getordefault("name", "John"); GO! int ChildNum = config.get("childnum", int.class); Map<String,String> properties = config.getproperties(); 28

Programmatic API Add dependency Configuration org.apache.tamaya:core: config = 0.2-incubating ConfigurationProvider.getConfiguration(); Add Config to META-INF/javaconfiguration.properties String name = config.getordefault("name", "John"); GO! int ChildNum = config.get("childnum", int.class); Map<String,String> properties = config.getproperties(); 29

What else do we need? 30

An abstraction for configuration sources and their ordening = PropertySource + Ordinals 31

PropertySource public interface PropertySource { Add dependency org.apache.tamaya:core: PropertyValue get(string key); 0.2-incubating Map<String,String> getproperties(); Add boolean Config isscannable(); to META-INF/java Map<String,String> getname(); getproperties();configuration.properties GO! int getordinal(); } public final class PropertyValue{ public String getkey(); public String getvalue(); public String get(string key); public Map<String,String> getconfigentries();... } 32

An abstraction for configuration sources = PropertySource 33

Tamaya Design in 120 Seconds... 1.Configuration = ordered list of PropertySources 2.Properties found are combined using a CombinationPolicy 3. Raw properties are filtered by PropertyFilter 4.For typed access PropertyConverters have to do work 5.Extensions add more features (discussed later) 6.Component Lifecycle is controlled by the ServiceContextManager Configuration ConfigurationContext PropertyConverter PropertyFilters PropertyProviders <provides> PropertySource PropertySource PropertySource PropertySource CombinationPolicy 34

Configuration Overriding #default ordinal = 0 name=benjamin childnum=0 family=tresch #override ordinal tamaya.ordinal=10 name=anatole childnum=3 tamaya.ordinal=10 name=anatole childnum=3 family=tresch 35

Upcoming Features? Configuration Description and Validation Meta-Configuration: META-INF/configuration-sources.xml Integrations DEMO 36

Demo 1 Microservice Running on Java EE 7 (Wildfly) Multiple Configuration Sources: DEMO Environment Properties System Properties Classpath Files Etcd Server 37

There is more! - Tamaya Extension Modules 38

Extensions: a topic on its own! Tamaya-spi-support: Some handy base classes to implement SPIs Tamaya-functions: Functional extension points (e.g. remapping, scoping) Tamaya-events: Detect and publish ConfigChangeEvents Tamaya-optional: Minimal access layer with optional Tamaya support Tamaya-filter: Thread local filtering Tamaya-inject-api: Tamaya Configuration Injection Annotations Tamaya-inject: Configuration Injection and Templates SE Implementation (lean, no CDI) Tamaya-resolver: Expression resolution, placeholders, dynamic values Tamaya-resources: Ant styled resource resolution Format Extensions: yaml, json, ini, including formats-spi Integrations with CDI, Spring, OSGI*, Camel, etcd Tamaya-mutable-config*: Writable ConfigChangeRequests Tamaya-model*: Configuration Model and Auto Documentation Tamaya-collections*: Collection Support... * experimental 39

Summarizing... A Complete thread- and type-safe Configuration API Compatible with all major runtimes Simple, but extendible design Extensible Small footprint Base for current Java EE 8 spec? 40

You like it? 41

It is your turn! Use it Evangelize Join the force 42

Links Project Page: http://tamaya.incubator.apache.org Twitter: @tamayaconfig Blog: http://javaeeconfig.blogspot.com Presentation by Mike Keith on JavaOne 2013: https://oracleus.activeevents.com/2013/connect/sessiondetail.ww?session_id=7755 Apache Deltaspike: http://deltaspike.apache.org Java Config Builder: https://github.com/tng/config-builder Apache Commons Configuration: http://commons.apache.org/proper/commons-configuration/ Jfig: http://jfig.sourceforge.net/ Carbon Configuration: http://carbon.sourceforge.net/modules/core/docs/config/usage.html Comparison on Carbon and Others: http://www.mail-archive.com/commons-dev@jakarta.apache.org/msg37597.html Spring Framework: http://projects.spring.io/spring-framework/ Owner: http://owner.aeonbits.org/ 43

Q&A Thank you! Anatole Tresch Trivadis AG Principal Consultant Twitter/Google+: @atsticks anatole@apache.org anatole.tresch@trivadis.com 44