SlideShare a Scribd company logo
Service Discovery
in OSGi
Beyond the JVM using Docker and Consul
About me
CTO @ Dexels
Architect at Sendrato Wearables
OSGi tinkerer
NoSQL advocate
Service Discovery
• As old as distributed systems
• Find system components
• Prevent hard-coding network addresses
• Important for micro service architectures
Service Discovery
• Finding services by exploring systems
• Use a well-known central registry where every
service registers
Service Repository
• Watch out for a single point of failure
• Distributed key-value stores
• Low volume
• Resilience and availability are most important
Service Discovery (SOA)
• Can change providers at will
• Access to many 3rd party services
• Services go shopping for other services
• Services can respond to ‘markets’
Docker containers
• Light-weight virtual machine
• Process with a filesystem and a network
• Universal, polyglot application deployment
mechanism
• DockerHub image store
Mini demo
Docker from a service
perspective
• An image
• An id
• Exposed ports
• ENV variables (& labels since Docker 1.6)
Docker
• Makes reasoning about services much easier
Docker
• Restful HTTP daemon on each host
• CLI tools use the HTTP interface to the daemon
Service discovery
So how do we ‘discover’ these services?
We ask the Docker daemon
What’s missing?
HostIp: 192.168.59.103
HostPort: 49212
ContainerPort: 3306
Protocol: TCP
… we need more metadata
Metadata
• Which service is this (name, tags)
• What protocol? How do I consume the service?
We can add them as environment parameters
Monitor the Docker Daemon
• Completely generic
• No need for a registry
• Only require a few ‘annotations’
This was the easy part
Dynamic Services
• Any service can just appear
• Multiple instances can appear
• Instances can disappear without warning
• Service cascades
OSGi
• Java based dynamic service framework
• Since 1999
• Initially for embedded systems
• Now very popular in cloud deployments
OSGi
• Central ‘Service Bus’
• Any Java object can be registered as a service
• Code can redeploy on the fly
• Services can come and go dynamically
• Services can depend on other services
Docker & OSGi
• Monitor the Docker daemon
• Inject into OSGi
Docker & OSGi
• Mismatch between Java objects and Docker
connection data
• The Docker ‘monitor’ won’t know what a service
is really about
Configuration Admin
• Create Configuration objects based on docker
data
• Leave the actual interpretation to ‘driver bundles’
Docker
Container
Container
OSGi Environment
Config
Config
Bridge
Factory
Instance
Instance
Another demo!
Limitations
• Single host*
• Docker API Security
• Scalability
Consul
• Distributed Key/Value configuration store
• Like Etcd or Zookeeper
• Very robust for node failure
• But specifically built for Service Discovery
• Nice web UI
Consul
Docker
Container
Container
Container
OSGi
Environment
Config
Config
Config
Consul Bridge
Consul
Cluster
Node
Node
Node
Host Bridge
Final demo!
Future work
• Conventions on metadata would be nice
• Better security model for Docker
• Use other sources of configuration like
Kubernetes
Thank you!
frank@dexels.com
Twitter @lyaruu
Tasman: https://github.com/flyaruu/tasman
Blog: http://www.codemonkey.nl/

More Related Content

What's hot (20)

PPT
Spring Boot. Boot up your development. JEEConf 2015
Strannik_2013
 
PDF
Introduction to the Nancy Framework
Tim Bourguignon
 
PPTX
Signal rity1
Yaniv Rodenski
 
PDF
Microservices with Spring Cloud, Netflix OSS and Kubernetes
Christian Posta
 
PPTX
Node ts1
Yaniv Rodenski
 
PPTX
Express yourself
Yaniv Rodenski
 
PPTX
Expose BizTalk to the world (ACSUG)
Wagner Silveira
 
PPTX
ASP.NET: Present and future
Hrvoje Hudoletnjak
 
PDF
angular-wakanda ngParis meetup 15 at 42
Alexandre Morgaut
 
PDF
Understanding MicroSERVICE Architecture with Java & Spring Boot
Kashif Ali Siddiqui
 
PDF
Cloud, Security and opensource 2012-12-28 at SSU
LINE株式会社
 
PDF
Writing Java EE microservices using WildFly Swarm
Comsysto Reply GmbH
 
PDF
JavaOne 2016 - Reactive Microservices with Java and Java EE
Rodrigo Cândido da Silva
 
PPTX
High performance java ee with j cache and cdi
Payara
 
PPTX
Debugging Microservices - key challenges and techniques - Microservices Odesa...
Lohika_Odessa_TechTalks
 
PDF
WSO2 Enterprise Service Bus - Product Overview
WSO2
 
PPTX
Microservices: Yes or not?
Eduard Tomàs
 
PPTX
.Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 20...
Javier García Magna
 
PPTX
Biztalk 2013 Launch Briefing
Nikolai Blackie
 
PDF
ESB integration for node.js
SÎNICĂ Alboaie
 
Spring Boot. Boot up your development. JEEConf 2015
Strannik_2013
 
Introduction to the Nancy Framework
Tim Bourguignon
 
Signal rity1
Yaniv Rodenski
 
Microservices with Spring Cloud, Netflix OSS and Kubernetes
Christian Posta
 
Node ts1
Yaniv Rodenski
 
Express yourself
Yaniv Rodenski
 
Expose BizTalk to the world (ACSUG)
Wagner Silveira
 
ASP.NET: Present and future
Hrvoje Hudoletnjak
 
angular-wakanda ngParis meetup 15 at 42
Alexandre Morgaut
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Kashif Ali Siddiqui
 
Cloud, Security and opensource 2012-12-28 at SSU
LINE株式会社
 
Writing Java EE microservices using WildFly Swarm
Comsysto Reply GmbH
 
JavaOne 2016 - Reactive Microservices with Java and Java EE
Rodrigo Cândido da Silva
 
High performance java ee with j cache and cdi
Payara
 
Debugging Microservices - key challenges and techniques - Microservices Odesa...
Lohika_Odessa_TechTalks
 
WSO2 Enterprise Service Bus - Product Overview
WSO2
 
Microservices: Yes or not?
Eduard Tomàs
 
.Net Microservices with Event Sourcing, CQRS, Docker and... Windows Server 20...
Javier García Magna
 
Biztalk 2013 Launch Briefing
Nikolai Blackie
 
ESB integration for node.js
SÎNICĂ Alboaie
 

Similar to JavaCro'15 - Service Discovery in OSGi Beyond the JVM using Docker and Consul - Frank Lyaruu (20)

PDF
ApacheCon Core: Service Discovery in OSGi: Beyond the JVM using Docker and Co...
Frank Lyaruu
 
PDF
Docker in production service discovery with consul - road to opscon 2015
Giovanni Toraldo
 
PPTX
Cont0519
Samuel Dratwa
 
PPTX
DockerFinder: Multi-attribute search of Docker images
Davide Neri
 
PDF
Common primitives in Docker environments
alexandru giurgiu
 
PPTX
A docker love story
Brian de Heus
 
PDF
OSGi and Cloud Computing - David Bosschaert
mfrancis
 
PPTX
Dockers and containers basics
Sourabh Saxena
 
PDF
Docker-v3.pdf
Bruno Cornec
 
PDF
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
mfrancis
 
PDF
Best Practices for Developing & Deploying Java Applications with Docker
Eric Smalling
 
PPTX
Docker-N-Beyond
santosh007
 
PDF
OpenNebulaConf 2014 - Cloud Automation for OpenNebula - Kishorekumar Neelamegam
OpenNebula Project
 
PDF
OpenNebula Conf 2014 | Cloud Automation for OpenNebula by Kishorekumar Neelam...
NETWAYS
 
PDF
Microservices Docker @Bonn Agile
Timo Derstappen
 
PPTX
Ben keynote 5
Ben Golub
 
PDF
Scaling and Orchestrating Microservices with OSGi - N Bartlett
mfrancis
 
PDF
OSGi Cloud Ecosystems - David Bosschaert
mfrancis
 
PDF
presentation @ docker meetup
Daniël van Gils
 
PPTX
Lectre # 11 (VS&S). virtualization .pptx
farheengul004
 
ApacheCon Core: Service Discovery in OSGi: Beyond the JVM using Docker and Co...
Frank Lyaruu
 
Docker in production service discovery with consul - road to opscon 2015
Giovanni Toraldo
 
Cont0519
Samuel Dratwa
 
DockerFinder: Multi-attribute search of Docker images
Davide Neri
 
Common primitives in Docker environments
alexandru giurgiu
 
A docker love story
Brian de Heus
 
OSGi and Cloud Computing - David Bosschaert
mfrancis
 
Dockers and containers basics
Sourabh Saxena
 
Docker-v3.pdf
Bruno Cornec
 
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
mfrancis
 
Best Practices for Developing & Deploying Java Applications with Docker
Eric Smalling
 
Docker-N-Beyond
santosh007
 
OpenNebulaConf 2014 - Cloud Automation for OpenNebula - Kishorekumar Neelamegam
OpenNebula Project
 
OpenNebula Conf 2014 | Cloud Automation for OpenNebula by Kishorekumar Neelam...
NETWAYS
 
Microservices Docker @Bonn Agile
Timo Derstappen
 
Ben keynote 5
Ben Golub
 
Scaling and Orchestrating Microservices with OSGi - N Bartlett
mfrancis
 
OSGi Cloud Ecosystems - David Bosschaert
mfrancis
 
presentation @ docker meetup
Daniël van Gils
 
Lectre # 11 (VS&S). virtualization .pptx
farheengul004
 
Ad

More from HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association (20)

PDF
Java cro'21 the best tools for java developers in 2021 - hujak
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
JavaCro'21 - Java is Here To Stay - HUJAK Keynote
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Javantura v7 - Behaviour Driven Development with Cucumber - Ivan Lozić
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PPTX
Javantura v7 - The State of Java - Today and Tomowwow - HUJAK's Community Key...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PPTX
Javantura v7 - Learning to Scale Yourself: The Journey from Coder to Leader -...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Javantura v6 - Java in Croatia and HUJAK - Branko Mihaljević, Aleksander Radovan
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Javantura v6 - On the Aspects of Polyglot Programming and Memory Management i...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PPTX
Javantura v6 - Case Study: Marketplace App with Java and Hyperledger Fabric -...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Javantura v6 - How to help customers report bugs accurately - Miroslav Čerkez...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Javantura v6 - When remote work really works - the secrets behind successful ...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Javantura v6 - Kotlin-Java Interop - Matej Vidaković
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Javantura v6 - Spring HATEOAS hypermedia-driven web services, and clients tha...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Javantura v6 - End to End Continuous Delivery of Microservices for Kubernetes...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PPTX
Javantura v6 - Istio Service Mesh - The magic between your microservices - Ma...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Javantura v6 - How can you improve the quality of your application - Ioannis ...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Javantura v6 - Automation of web apps testing - Hrvoje Ruhek
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Javantura v6 - Building IoT Middleware with Microservices - Mario Kusek
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
PDF
Javantura v6 - JDK 11 & JDK 12 - Dalibor Topic
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Java cro'21 the best tools for java developers in 2021 - hujak
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
JavaCro'21 - Java is Here To Stay - HUJAK Keynote
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Javantura v7 - Behaviour Driven Development with Cucumber - Ivan Lozić
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Javantura v7 - The State of Java - Today and Tomowwow - HUJAK's Community Key...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Javantura v7 - Learning to Scale Yourself: The Journey from Coder to Leader -...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
JavaCro'19 - The State of Java and Software Development in Croatia - Communit...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Javantura v6 - Java in Croatia and HUJAK - Branko Mihaljević, Aleksander Radovan
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Javantura v6 - On the Aspects of Polyglot Programming and Memory Management i...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Javantura v6 - Case Study: Marketplace App with Java and Hyperledger Fabric -...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Javantura v6 - How to help customers report bugs accurately - Miroslav Čerkez...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Javantura v6 - When remote work really works - the secrets behind successful ...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Javantura v6 - Kotlin-Java Interop - Matej Vidaković
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Javantura v6 - Spring HATEOAS hypermedia-driven web services, and clients tha...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Javantura v6 - End to End Continuous Delivery of Microservices for Kubernetes...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Javantura v6 - Istio Service Mesh - The magic between your microservices - Ma...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Javantura v6 - How can you improve the quality of your application - Ioannis ...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Javantura v6 - Automation of web apps testing - Hrvoje Ruhek
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Javantura v6 - Master the Concepts Behind the Java 10 Challenges and Eliminat...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Javantura v6 - Building IoT Middleware with Microservices - Mario Kusek
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Javantura v6 - JDK 11 & JDK 12 - Dalibor Topic
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Ad

JavaCro'15 - Service Discovery in OSGi Beyond the JVM using Docker and Consul - Frank Lyaruu