0

OSGi for Enterprises

2,035

Published on

OSGi for Enterprises by Holger Hoffstätte & Robert Dunne (Paremus) at OSGi Users Forum UK, 23rd Nov 2010.

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,035
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
43
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "OSGi for Enterprises"

  1. 1. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 OSGi For Enterprises Holger Hoffstätte holger.hoffstatte@paremus.com Robert Dunne robert.dunne@paremus.com The new Nimble Distribution with RSA Available in December 








http://nimble.paremus.com/distribution Video Podcast available - http://skillsmatter.com/podcast/java-jee/osgi-for-enterprises/rl-311
  2. 2. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Agenda • Demo Technology Overview • Local Demo Walkthrough • OSGi Remote Services (Holger)
  3. 3. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Technologies • OSGi • Scala + Lift • HTML + CSS + Javascript (JQuery)
  4. 4. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Build Tools • Bnd • Eclipse PDE • Apache Sigil • Tycho • Bndtools
  5. 5. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Nimble • OSGi Distribution • Posh: Bash like shell for OSGi based on Apache Gogo • Nimble Resolver: APT like installation system for OSGi
  6. 6. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Declarative Services • Dynamic Dependency Injection & Service Publication • Reduce Accidental Temporal Dependencies • Increase Resilience
  7. 7. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Configuration Admin • Modular, Dynamic Configuration & Reconfiguration • PIDs: Named Property lists • Integrates with Declarative Services
  8. 8. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 OSGi Remote Services A Flexible Foundation for Composite Applications
  9. 9. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Who am I? • Holger Hoffstätte (aka @asynchronaut) Living & working in Germany, near Cologne • Consulting Engineer for Paremus Ltd. Working on next-generation Service Fabric product line • >20 years experience with concurrent/distributed systems, incl.Agile/ Process coaching,AOP, B2B, Enterprise Integration etc.
  10. 10. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 What's this about? • OSGi & Remote Services: Motivation & History • Overview of Remote Services/RSA Specifications • Applicability & Use Cases → little to no code!
  11. 11. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 OSGi = SOA! • Physical and logical isolation of Bundles • Bundle Wiring with dynamic behaviour • Service registration, discovery & matching • Lifecycle control • In R4.2: scoped visibility of services & events
  12. 12. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Systems Hygiene: simply a good idea “The ability of OSGi to handle complex systems as a set of interdependent modules is kind of like toilet paper: Sooner or later, you're going to want to use it.” – Hal Hildebrand
  13. 13. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 ..but what about Distributed Systems?
  14. 14. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 ..hmm..why not.. “Just use RMI or EJB! It's built-in and Standard!” – your local Architecture Astronaut ...ooomphh →
  15. 15. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 /** * Implementation of ICustomRemote Interface. */ public class CustomRemoteImpl extends UnicastRemoteObject implements ICustomRemote { /** * Necessary because Super-Class constructor throws RemoteException. * @throws java.rmi.RemoteException Will be thrown if there are some network * errors. */ public CustomRemoteImpl() throws RemoteException { } /** * Returns a string which say 'Hello World with RMI.' * @return the string which holds the value. * @throws java.rmi.RemoteException Will be thrown if there are some network * problems. */ public String sayHello() throws RemoteException { return "Hello World with RMI."; } } :-(
  16. 16. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 ..hmm..why not.. “We should just use JMS or our Enterprisey 'Service Bus' for everything!” – probably someone on your team ..alrighty then.. →
  17. 17. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 ..hmm..why not.. “I know!We can simply write our own RPC library over sockets! It's so easy! I did that back in Uni!” – your “Rock Star” intern ..oh noes! →
  18. 18. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Sad Reality • Any kind of distribution often still hardwired into “stuff” (and nobody really understands how it works..or wants to) • System evolution often burdened with architectural decisions at the wrong time of the development cycle: • Distribution features added either “too early” or “too late” • Negatively impacts time-to-feature & subsystem/integration testing • Iterations increasingly resemble wading through mud that keeps getting deeper
  19. 19. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Silver Lining? • Previous attempts: Tuscany SCA, R-OSGi, Newton.. • All have more or less similar ideas: composite applications, distributed wiring.. • All more or less incompatible with each other and/or “standard” OSGi
  20. 20. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Key Realizations • Distributed systems need adaptability for ALL aspects: development, testing, deployment, runtime, maintenance • No Silver Bullet/Golden Hammer possible: too many contradicting requirements like availability, cost, licensing, interop, latency, knowledge, security..
  21. 21. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Standardize interaction, not features! • Allow multiple implementations using different technologies side-by-side • Prevent “Golden Hammer Syndrome”: don't force choice of one technology for every kind of interaction, even when inappropriate
  22. 22. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Consequences • Almost-transparent extension of the OSGi service model: no explicit infrastructure API in “user code”! • No mandated use of SOAP/RMI/HTTP/JMS/etc.: choice of technology can be driven by requirements • anything that moves bytes from A to B should be usable as transport!
  23. 23. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 OSGi EEG to the Rescue! • Definition of Remote Services in OSGi R4.2 • Two minimalistic specs that accommodate each other: • Remote Services: the “mechanics” of transports • Remote Service Admin: standardized discovery & import/export visibility control
  24. 24. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Remote Services
  25. 25. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Remote Services • Standardized Service Properties define the interaction between participants • Abstract “Intents” specify context-dependent “required vs. provided” capabilities; matched by standard OSGi filters • Flexible configuration: properties, code, vendor-specific..
  26. 26. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Remote Services Easier cross-platform integration for OSGi! ProtocolBuffers,Thrift, JSON-RPC,Avro..
  27. 27. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Remote Service Admin
  28. 28. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Remote Service Admin • RSA itself merely an abstract control interface for implementors, usually the vendor of a distribution provider • Discovery providers discover/announce services on the network • “Topology Manager” controls import/export visibility; specifics left to implementation → innovation!
  29. 29. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Discovery • Discovery providers are simply “EndpointListeners” that map a specific service announcement to & from a standardized “EndpointDescription” • Can use any mechanism that can store & update service state/visibility • Obvious candidates: SLP, DNS-SD, Data Distribution Service, Apache Zookeeper, RDBMS, Data Grids, P2P Systems, DHTs..
  30. 30. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Sounds awesome!
  31. 31. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 ..but not so fast! • Service interactions defined by Java interface – well-understood :-) – not very flexible :-( • Fundamental limits to what can be expressed with a synchronous RPC model • Fallacies of Distributed Computing etc.
  32. 32. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Problems with RPC • Lack of reliability necessitates Fault Detection (active & passive) • Call-by-reference vs. Call-by-value: impact on interaction semantics that cannot be ignored • Latency spikes will introduce strong variance in perceived behaviour • Variance adds up if remote services are chained
  33. 33. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 OSGi helps! • Can't fix the network, but does help with „unexpected“ faults: org.osgi.framework.ServiceException extends RuntimeException • Service are expected to be dynamic – no change! :-) • What changes is the scope of a disappearing service - ...but does that really matter? Gone is gone!
  34. 34. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Actual Benefits (1) • Isolate that special third-party native code that keeps crashing your entire JVM • Operational isolation through service visibility policies → smaller/faster test cycles → faster time-to-feature → no accidental crosstalk between development teams → runtime: security, confidentiality..
  35. 35. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Actual Benefits (2) • Ops teams usually more open to dynamic updates of isolated services in separate processes – much easier now • Service Migration on host downtime → switching services much faster than host recovery/reboot • Service selection based on cost/performance/latency.. → finally a good reason to do proper end-to-end system design :)
  36. 36. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Implementations RSA Reference Implementation using Apache CXF and Zookeeper Built on Eclipse Communication Framework Based on RI but rewritten for correctness, extensibility, RSA compliance. Basis for commercial product.Built with Tuscany/SCA?
  37. 37. www.paremus.comwww.paremus.com Transforming the Way the World Runs Applications Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved. Paremus Nov 2010 Thank You Holger Hoffstätte holger.hoffstatte@paremus.com Robert Dunne robert.dunne@paremus.com The new Nimble Distribution with RSA Available in December 








http://nimble.paremus.com/distribution
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×