SlideShare a Scribd company logo
1 of 35
Download to read offline
Asynchronous Services - 
A promising future for OSGi 
Tim Ward http://www.paremus.com 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved. 
info@paremus.com
Who is Tim Ward? 
@TimothyWard 
• Senior Consulting Engineer, Trainer and Architect at Paremus 
• 5 years at IBM developing WebSphere Application Server 
• Container Implementations for Java EE and OSGi, including Blueprint, JPA, EJB and JTA 
• OSGi Specification lead for JPA, Weaving Hooks and Asynchronous Services 
• PMC member of the Apache Aries project 
• Previous speaker at Java One, EclipseCon, Devoxx, Jazoon, JAX London, 
OSGi Community Event... 
• Author of Manning’s Enterprise OSGi in Action 
• http://www.manning.com/cummins 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
What we’re going to cover 
• Why is the World Going Asynchronous? 
! 
• Async Programming Primitives 
! 
• Making Synchronous Services Asynchronous 
! 
• Optimising Calls into Asynchronous Services 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved. 
! 
• Demo
New OSGi Specifications 
The OSGi Core Release 6 Specification was released in June! 
! 
It’s available now at http://www.osgi.org/Specifications/HomePage! 
! 
! 
There is also a public draft of OSGi Enterprise Release 6! 
! 
Available at http://www.osgi.org/Specifications/Drafts! 
! 
This draft contains the specifications we’re going to be talking about!! 
! 
The Enterprise specification is being wrapped up for final release in Q4 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved. 
NEW
Why is the World Going Asynchronous? 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
Origins of Asynchronous Programming 
Many peopler think of Async Programming as “recently popular”… 
The terms “Promise” and “Future” originate 
from 1970s research papers 
Proposed as mechanisms to handle 
large-scale parallel execution 
Asynchronous Programming concepts have been with us for a long time! 
User Interface EventHandler callbacks 
“must not block the UI thread!” 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
Advantages of Asynchronous Programming 
• Asynchronous systems offer better performance 
• This does assume that there isn’t a single bottleneck! 
! 
• Asynchronous Distributed systems typically scale better 
• Less time spent waiting for high-latency calls 
• More reasonable failure characteristics 
! 
• Parallelism is easier to exploit 
! 
• Network Infrastructure is intrinsically asynchronous 
• Network Engineers have been working this way for decades 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved. 
100% 100%
Problems with Asynchronous Programming 
Human brains aren’t really designed to cope with asynchronous logic 
• Thought processes tend to be “do A”, then “do B” then “the result is C” 
• Asynchronous Programming is only useful if the benefits of using it 
outweigh the extra cognitive overhead 
! 
Synchronous calls offer a natural “brake” in RPC 
• Asynchronous “Event Storms” can overwhelm remote systems, even using 
a single client thread. 
! 
Deadlocks are still possible, and can be hard to diagnose 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
So what’s changed? 
The latest asynchronous revolution seems to be sticking! 
Multi-core is pervasive now, 
request-level parallelism isn’t always 
enough to max out hardware any 
more 
JavaScript has been a major 
driver in the last 5-10 years, in a 
single threaded environment. 
Async is a necessity! 
Commonly used OO languages are 
becoming more “functional” 
Java and C++ have added lambdas 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
Async Programming Primitives 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
Async Basics 
The Promise is the primitive of Asynchronous Programming 
A “Promise” represents a delayed value that will be “resolved” in the future 
“Resolving” a promise sets its value, or its failure 
OSGi Promises are based on JavaScript 
Promise concepts, but also significantly 
influenced by Scala 
Strictly, the OSGi (and most JavaScript) Promises are “Future” types as 
they have no methods for resolving themselves 
In both cases a Deferred type can create and resolve a default 
Promise implementation 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
The OSGi Promise 
The Promise Contract (based on JavaScript Promises) 
• The Promise is resolved or failed with a single value, at most once 
• Listener callbacks are called at most once 
• Promises remember their state (including their resolution / failure value) 
• Promises behave the same way regardless of whether they are already 
resolved or resolved in the future. 
! 
Promises can be treated as a shareable value type 
• Effectively immutable (unless you created it!) 
• Thread safe 
• No need to unwrap it… 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved. 
The Deferred 
OSGi provides a default Promise implementation for clients to use 
The Deferred is held by the provider of the Promise, and can be used to set 
its value or failure 
! 
! ! Deferred<Long> deferred = new Deferred<Long>();! ! 
! ! new Thread(() -> {! 
! ! ! ! try {! 
! ! ! ! ! Long total = service.calculateDifficultSum();! 
! ! ! ! ! deferred.resolve(total);! 
! ! ! ! } catch (Exception e) {! 
! ! ! ! ! deferred.fail(e);! 
! ! ! ! }! 
! ! ! }! 
! ! }).start();! ! 
! ! Promise<Long> promise = deferred.getPromise();
Promise Callbacks 
Promises do support “synchronous” usage similar to Java’s Future 
• isDone(), getValue(), getFailure() 
• The getXxx() methods block 
! 
It’s better to use Promises with callbacks (never block, remember?) 
• then(Success) or then(Success, Failure)! 
! 
Success and Failure are both SAM interfaces, suitable for Lambda usage 
then((p) -> success(p.getValue()), ! 
! (p) -> fail(p.getFailure()));! 
! 
Callbacks should be fast - Success can return a Promise for longer tasks 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
Chaining Promises 
Basic chaining uses then(…), a new Promise is created that resolves when: 
• the success callback returns null; or 
• the success callback throws an error; or 
• the Promise returned by the success callback resolves 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved. 
! 
Chaining allows you to compose sequences of events 
• Promises are Monads 
• Complex behaviours can be achieved without if/else branching 
! 
More complex functional chains are natively supported 
• Filtering/Mapping values, recovering failures…
The Promises utility class 
The Promises type provides number of common functions 
• Creating Promises that are already resolved or failed 
• Very useful when mapping / recovering promises 
! 
Another useful utility is Promises.all(Promise…) 
• It creates a “latch” Promise that resolves when all others are complete 
• Good for final clean up, or for notifying users about aggregate tasks 
! 
Remember that chains and latches work even if a Promise is already resolved! 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
A Chaining Example 
Download an XML file, preferably from a mirror URL, and parse it using JAXB 
! Promise<Library> promise = getMirror(libraryURL)! 
! ! ! ! .fallbackTo(Promises.resolved(libraryURL))! 
! ! ! ! .then((p) -> downloadFile(p.getValue()))! 
! ! ! ! .map((p) -> (Library) JAXB.unmarshal(p, Library.class)));! 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved. 
!!! 
! public Promise<URL> getMirror(URL url)! 
! ! throws Exception {! 
! ! . . .! 
! }! 
! ! 
! public Promise<File> downloadFile(URL url) ! 
! ! throws Exception {! 
! ! . . .! 
! }!
Making Synchronous Services 
Asynchronous 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
The OSGi service model 
The OSGi service model is useful and widely used 
! 
! 
Consumer 
! 
Provider 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved. 
! 
! 
! 
Service objects are obtained from the Service Registry and invoked 
• The call semantics depend upon the Service API 
• Most APIs are synchronous in operation 
! 
OSGi Services can be transparent local representations of a remote resource
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved. 
Question? 
As a service client, how do I make an asynchronous call to a service? 
• I can’t / don’t want to rewrite the service 
• I’d prefer not to start threads or manage a thread pool 
• I’d also like my code to stay as clean as possible 
! 
Ad-hoc solutions are messy, but have been the only choice up to now 
!
The Async Service - Requirements 
• Allow arbitrary OSGi services to be called asynchronously 
• The call must be transparent to the backing service, no opt-in required 
! 
• Must support methods that have a return value, as well as void 
! 
• Must not rely on generated source, client-local interfaces or reflection 
• Source gets out of sync, and is hard to maintain 
• Reflection is just ugly! 
! 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
Unit testing Mocks - Requirements 
• Allow arbitrary Objects to be called, remembering the calls that are made 
• The mocking must be transparent, no opt-in required 
! 
• Mocks must allow methods to return a specific value 
! 
• Must not rely on generated source, client-local interfaces or reflection 
• The test code is using the real interfaces/objects 
! 
! 
! 
Notice any similarities? 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
How to use the Async Service 
To make asynchronous calls on a service you need an Async Mediator 
! MyService mediated = async.mediate(myService, MyService.class);! 
! 
Services can be mediated from a ServiceReference or the service object 
• ServiceReference is better because the mediator can track availability 
! 
Clients then use the mediated object to make a normal method call 
• This records the call, just like a mock would in a test 
! 
To begin the asynchronous task you pass the return value to async.call(T) 
! Promise<Long> p = async.call(mediated.pianosInNYC());! 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
How to use the Async Service (2) 
Void methods can be slightly trickier 
• There’s a no-args version of call() which returns Promise<?> 
• Promises for void methods resolve with null when they complete 
! 
If you don’t need the return state, then consider fire-and-forget 
• The execute() method doesn’t return the value 
• Fire-and-forget can be much more efficient* 
! 
The Async Service is Thread Safe, but mediators may not be 
• Never share the Async object between Bundles, always get your own 
• Failure to do the above can lead to class space errors and security flaws! 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved. 
* More about this later!
Async Service Example 
Perform two long running calls in parallel, then aggregate the result 
! public void setAsync(Async async) {! 
! ! this.async = async;! 
! }! 
! ! 
! public void setMyService(ServiceReference<MyService> myService) {! 
! ! this.myService = myService;! 
! }! 
! 
! public Long getCombinedTotal() throws Exception {! 
! ! MyService mediated = async.mediate(myService, MyService.class);! 
! ! ! 
! ! Promise<Long> bars = async.call(mediated.barsInNYC());! 
! 
! ! return async.call(mediated.pianosInNYC())! 
! ! ! ! .flatMap((pVal) -> bars.map((bVal) -> pVal + bVal))! 
! ! ! ! .getValue();! 
! } 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
Optimising Calls into Asynchronous 
Services 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
What if we can do better? 
The AsyncDelegate interface allows services to provide their own 
asynchronous behaviours 
! 
Remote Services allows most OSGi services to be transparently remoted 
• The details of the distribution mechanism are hidden 
• If the distribution provider supports asynchronous communications then it 
can optimise calls that it knows to be asynchronous 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved. 
Distribution 
Provider 
Distribution 
Provider
Further optimising our calls 
Earlier we talked about fire-and-forget calls… 
! 
Fire and forget ignores return values, and offers no callback on completion 
• Sometimes this gives you exactly what you need 
• It can also be very heavily optimised by remote services! 
! 
! 
Distribution 
Provider 
Distribution 
Provider 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved. 
! 
! 
Removing the return flow decreases work at both the local and remote ends 
• It also significantly reduces the load on the network
Building a system from asynchronous 
microservices 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
Designing an Async-safe API 
• As we’ve seen, the service itself can have a standard synchronous API 
• No need to return a Promise/Future 
• No “duplicate interface” needed 
! 
• Arguments and return types should be thread safe and/or Immutable 
• You were doing this anyway right? 
! 
• It turns out that most remote APIs fit this model very well 
! 
• Any existing microservice is likely to work 
• Remote OSGi μServices will too 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
Building an application from Async services 
• Using a mixture of synchronous and asynchronous services is possible 
• Latch promises are a good way to wait for multiple results 
! 
• Hold on to the Promise, rather than the value 
• You can register failure callbacks after-the-fact! 
! 
• Where possible, split big calls into smaller ones and aggregate in callbacks 
• This lets load-balanced replicas work like a grid dispatch system 
! 
• Remember that retry/failure logic doesn’t have to be handled via try/catch 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
Demonstration: Building a system using 
the Async Service 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
The Demo Application 
A Simple JAX-RS app running in OSGi: 
• Angular JS + HTML5 canvas for display 
• REST service for Server-generated Fractal images 
• Server Sent Events to stream the data 
! 
OSGi services provide scalable workers for the back end 
Source code is available on GitHub: 
http://bit.ly/paremus-async 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved. 
!
Deploying to the Service Fabric 
• An OSGi Cloud runtime. 
• Highly modular and so highly evolvable 
• Transparent scaling and load balancing 
• Think Google ‘Kubernetes'++ 
• The Fabric dynamically deploys and 
maintains OSGi or Docker artefacts 
across a heterogenous environment. 
• Adaptive, Self Managing / Self 
Maintaining 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved.
• For more about OSGi... 
• Specifications at http://www.osgi.org 
• Enterprise OSGi in Action 
• http://www.manning.com/cummins 
! 
• For Service Fabric examples and docs 
• http://docs.paremus.com/ 
! 
• For more about the demo (including source code) 
• http://bit.ly/paremus-async 
Questions? 
Use ‘javaonecftw’ at 
http://www.manning.com 
for 44% off all Books 
Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. 
Oct 2014 
May not be reproduced by any means without express permission. All rights reserved. 
Thanks! 
http://www.paremus.com 
info@paremus.com

More Related Content

What's hot

Vert.x introduction
Vert.x introductionVert.x introduction
Vert.x introductionGR8Conf
 
Andrea Di Persio
Andrea Di PersioAndrea Di Persio
Andrea Di PersioCodeFest
 
Micro service architecture - building scalable web solutions - George James -...
Micro service architecture - building scalable web solutions - George James -...Micro service architecture - building scalable web solutions - George James -...
Micro service architecture - building scalable web solutions - George James -...Red Blue Blur Ideas
 
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...Matthew Groves
 
Serverless architecture: introduction & first steps
Serverless architecture: introduction & first stepsServerless architecture: introduction & first steps
Serverless architecture: introduction & first stepsThe Software House
 
Reflections On Serverless
Reflections On ServerlessReflections On Serverless
Reflections On ServerlessDiego Pacheco
 
WebUp Feb 2017 - How (not) to get lost in bigger Ruby on Rails project.
WebUp Feb 2017 - How (not) to get lost in bigger Ruby on Rails project.WebUp Feb 2017 - How (not) to get lost in bigger Ruby on Rails project.
WebUp Feb 2017 - How (not) to get lost in bigger Ruby on Rails project.Oliver Kriska
 
Developing Serverless Microservice in Rust
Developing Serverless Microservice in RustDeveloping Serverless Microservice in Rust
Developing Serverless Microservice in RustAdityo Pratomo
 
TDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDBTDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDBValeri Karpov
 
Reactive applications and microservices with Vert.x tool-kit
Reactive applications and microservices with Vert.x tool-kitReactive applications and microservices with Vert.x tool-kit
Reactive applications and microservices with Vert.x tool-kitVictor Hugo
 
Handling 1 Billion Requests/hr with Minimal Latency Using Docker
Handling 1 Billion Requests/hr with Minimal Latency Using DockerHandling 1 Billion Requests/hr with Minimal Latency Using Docker
Handling 1 Billion Requests/hr with Minimal Latency Using DockerMatomy
 
Introducing envoy-based service mesh at Booking.com
Introducing envoy-based service mesh at Booking.comIntroducing envoy-based service mesh at Booking.com
Introducing envoy-based service mesh at Booking.comIvan Kruglov
 
Introducing Vert.x 2.0 - Taking polyglot application development to the next ...
Introducing Vert.x 2.0 - Taking polyglot application development to the next ...Introducing Vert.x 2.0 - Taking polyglot application development to the next ...
Introducing Vert.x 2.0 - Taking polyglot application development to the next ...jaxLondonConference
 
Content-Centric Web Development with Apache Sling
Content-Centric Web Development with Apache SlingContent-Centric Web Development with Apache Sling
Content-Centric Web Development with Apache SlingKoen Van Eeghem
 
Best practises for HTML5 servers (Devaamo Summit 2012)
Best practises for HTML5 servers (Devaamo Summit 2012)Best practises for HTML5 servers (Devaamo Summit 2012)
Best practises for HTML5 servers (Devaamo Summit 2012)Otto Kekäläinen
 

What's hot (20)

Vert.x introduction
Vert.x introductionVert.x introduction
Vert.x introduction
 
Andrea Di Persio
Andrea Di PersioAndrea Di Persio
Andrea Di Persio
 
Micro service architecture - building scalable web solutions - George James -...
Micro service architecture - building scalable web solutions - George James -...Micro service architecture - building scalable web solutions - George James -...
Micro service architecture - building scalable web solutions - George James -...
 
Ansible E2E Testing
Ansible E2E TestingAnsible E2E Testing
Ansible E2E Testing
 
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...
5 Popular Choices for NoSQL on a Microsoft Platform - All Things Open - Octob...
 
Serverless architecture: introduction & first steps
Serverless architecture: introduction & first stepsServerless architecture: introduction & first steps
Serverless architecture: introduction & first steps
 
Reflections On Serverless
Reflections On ServerlessReflections On Serverless
Reflections On Serverless
 
WebUp Feb 2017 - How (not) to get lost in bigger Ruby on Rails project.
WebUp Feb 2017 - How (not) to get lost in bigger Ruby on Rails project.WebUp Feb 2017 - How (not) to get lost in bigger Ruby on Rails project.
WebUp Feb 2017 - How (not) to get lost in bigger Ruby on Rails project.
 
Developing Serverless Microservice in Rust
Developing Serverless Microservice in RustDeveloping Serverless Microservice in Rust
Developing Serverless Microservice in Rust
 
Nodejs
NodejsNodejs
Nodejs
 
TDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDBTDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDB
 
Reactive applications and microservices with Vert.x tool-kit
Reactive applications and microservices with Vert.x tool-kitReactive applications and microservices with Vert.x tool-kit
Reactive applications and microservices with Vert.x tool-kit
 
Handling 1 Billion Requests/hr with Minimal Latency Using Docker
Handling 1 Billion Requests/hr with Minimal Latency Using DockerHandling 1 Billion Requests/hr with Minimal Latency Using Docker
Handling 1 Billion Requests/hr with Minimal Latency Using Docker
 
Thrift
ThriftThrift
Thrift
 
Introducing envoy-based service mesh at Booking.com
Introducing envoy-based service mesh at Booking.comIntroducing envoy-based service mesh at Booking.com
Introducing envoy-based service mesh at Booking.com
 
Introducing Vert.x 2.0 - Taking polyglot application development to the next ...
Introducing Vert.x 2.0 - Taking polyglot application development to the next ...Introducing Vert.x 2.0 - Taking polyglot application development to the next ...
Introducing Vert.x 2.0 - Taking polyglot application development to the next ...
 
Content-Centric Web Development with Apache Sling
Content-Centric Web Development with Apache SlingContent-Centric Web Development with Apache Sling
Content-Centric Web Development with Apache Sling
 
Vert.x vs akka
Vert.x vs akkaVert.x vs akka
Vert.x vs akka
 
Best practises for HTML5 servers (Devaamo Summit 2012)
Best practises for HTML5 servers (Devaamo Summit 2012)Best practises for HTML5 servers (Devaamo Summit 2012)
Best practises for HTML5 servers (Devaamo Summit 2012)
 
Production ready Vert.x
Production ready Vert.xProduction ready Vert.x
Production ready Vert.x
 

Similar to Asynchronous Services – A promising future for OSGi - T Ward

Asynchronous OSGi – Promises for the Masses - T Ward
Asynchronous OSGi – Promises for the Masses - T WardAsynchronous OSGi – Promises for the Masses - T Ward
Asynchronous OSGi – Promises for the Masses - T Wardmfrancis
 
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...mfrancis
 
Transaction Control – a Functional Approach to Modular Transaction Management...
Transaction Control – a Functional Approach to Modular Transaction Management...Transaction Control – a Functional Approach to Modular Transaction Management...
Transaction Control – a Functional Approach to Modular Transaction Management...mfrancis
 
Zero Downtime Deployment
Zero Downtime DeploymentZero Downtime Deployment
Zero Downtime DeploymentJoel Dickson
 
JavaOne 2014: Java vs JavaScript
JavaOne 2014:   Java vs JavaScriptJavaOne 2014:   Java vs JavaScript
JavaOne 2014: Java vs JavaScriptChris Bailey
 
RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009Roland Tritsch
 
Dynamically assembled REST Microservices using JAX-RS and... Microservices? -...
Dynamically assembled REST Microservices using JAX-RS and... Microservices? -...Dynamically assembled REST Microservices using JAX-RS and... Microservices? -...
Dynamically assembled REST Microservices using JAX-RS and... Microservices? -...mfrancis
 
Oracle Code Online: Building a Serverless State Service for the Cloud
Oracle Code Online: Building a Serverless State Service for the CloudOracle Code Online: Building a Serverless State Service for the Cloud
Oracle Code Online: Building a Serverless State Service for the CloudEd Burns
 
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...mfrancis
 
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]David Buck
 
vBrownBag AWS Certified SysOps : Associate Domain 4
vBrownBag AWS Certified SysOps : Associate Domain 4vBrownBag AWS Certified SysOps : Associate Domain 4
vBrownBag AWS Certified SysOps : Associate Domain 4Eric Santelices
 
Modularity, Microservices and Containerisation - Neil Bartlett, Derek Baum
Modularity, Microservices and Containerisation - Neil Bartlett, Derek BaumModularity, Microservices and Containerisation - Neil Bartlett, Derek Baum
Modularity, Microservices and Containerisation - Neil Bartlett, Derek Baummfrancis
 
Dissecting and Attacking RMI Frameworks
Dissecting and Attacking RMI FrameworksDissecting and Attacking RMI Frameworks
Dissecting and Attacking RMI FrameworksOnapsis Inc.
 
StackStorm DevOps Automation Webinar
StackStorm DevOps Automation WebinarStackStorm DevOps Automation Webinar
StackStorm DevOps Automation WebinarStackStorm
 
Automated perf optimization - jQuery Conference
Automated perf optimization - jQuery ConferenceAutomated perf optimization - jQuery Conference
Automated perf optimization - jQuery ConferenceMatthew Lancaster
 
DevOps as a Pathway to AWS | AWS Public Sector Summit 2016
DevOps as a Pathway to AWS | AWS Public Sector Summit 2016DevOps as a Pathway to AWS | AWS Public Sector Summit 2016
DevOps as a Pathway to AWS | AWS Public Sector Summit 2016Amazon Web Services
 
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...Jeavon Leopold
 
Why you should choose Angular and why you should not
Why you should choose Angular and why you should notWhy you should choose Angular and why you should not
Why you should choose Angular and why you should notGeorge Georgiadis
 
Building a right sized, do-anything runtime using OSGi technologies: a case s...
Building a right sized, do-anything runtime using OSGi technologies: a case s...Building a right sized, do-anything runtime using OSGi technologies: a case s...
Building a right sized, do-anything runtime using OSGi technologies: a case s...mfrancis
 
Java @ Rio Meetup #1 - Java @ Oracle Cloud
Java @ Rio Meetup #1 - Java @ Oracle CloudJava @ Rio Meetup #1 - Java @ Oracle Cloud
Java @ Rio Meetup #1 - Java @ Oracle CloudPaulo Alberto Simoes ∴
 

Similar to Asynchronous Services – A promising future for OSGi - T Ward (20)

Asynchronous OSGi – Promises for the Masses - T Ward
Asynchronous OSGi – Promises for the Masses - T WardAsynchronous OSGi – Promises for the Masses - T Ward
Asynchronous OSGi – Promises for the Masses - T Ward
 
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
 
Transaction Control – a Functional Approach to Modular Transaction Management...
Transaction Control – a Functional Approach to Modular Transaction Management...Transaction Control – a Functional Approach to Modular Transaction Management...
Transaction Control – a Functional Approach to Modular Transaction Management...
 
Zero Downtime Deployment
Zero Downtime DeploymentZero Downtime Deployment
Zero Downtime Deployment
 
JavaOne 2014: Java vs JavaScript
JavaOne 2014:   Java vs JavaScriptJavaOne 2014:   Java vs JavaScript
JavaOne 2014: Java vs JavaScript
 
RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009
 
Dynamically assembled REST Microservices using JAX-RS and... Microservices? -...
Dynamically assembled REST Microservices using JAX-RS and... Microservices? -...Dynamically assembled REST Microservices using JAX-RS and... Microservices? -...
Dynamically assembled REST Microservices using JAX-RS and... Microservices? -...
 
Oracle Code Online: Building a Serverless State Service for the Cloud
Oracle Code Online: Building a Serverless State Service for the CloudOracle Code Online: Building a Serverless State Service for the Cloud
Oracle Code Online: Building a Serverless State Service for the Cloud
 
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
Creating an all-purpose REST API for Cloud services using OSGi and Sling - C ...
 
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
 
vBrownBag AWS Certified SysOps : Associate Domain 4
vBrownBag AWS Certified SysOps : Associate Domain 4vBrownBag AWS Certified SysOps : Associate Domain 4
vBrownBag AWS Certified SysOps : Associate Domain 4
 
Modularity, Microservices and Containerisation - Neil Bartlett, Derek Baum
Modularity, Microservices and Containerisation - Neil Bartlett, Derek BaumModularity, Microservices and Containerisation - Neil Bartlett, Derek Baum
Modularity, Microservices and Containerisation - Neil Bartlett, Derek Baum
 
Dissecting and Attacking RMI Frameworks
Dissecting and Attacking RMI FrameworksDissecting and Attacking RMI Frameworks
Dissecting and Attacking RMI Frameworks
 
StackStorm DevOps Automation Webinar
StackStorm DevOps Automation WebinarStackStorm DevOps Automation Webinar
StackStorm DevOps Automation Webinar
 
Automated perf optimization - jQuery Conference
Automated perf optimization - jQuery ConferenceAutomated perf optimization - jQuery Conference
Automated perf optimization - jQuery Conference
 
DevOps as a Pathway to AWS | AWS Public Sector Summit 2016
DevOps as a Pathway to AWS | AWS Public Sector Summit 2016DevOps as a Pathway to AWS | AWS Public Sector Summit 2016
DevOps as a Pathway to AWS | AWS Public Sector Summit 2016
 
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
J&Js adventures with agency best practice & the hybrid MVC framework - Umbrac...
 
Why you should choose Angular and why you should not
Why you should choose Angular and why you should notWhy you should choose Angular and why you should not
Why you should choose Angular and why you should not
 
Building a right sized, do-anything runtime using OSGi technologies: a case s...
Building a right sized, do-anything runtime using OSGi technologies: a case s...Building a right sized, do-anything runtime using OSGi technologies: a case s...
Building a right sized, do-anything runtime using OSGi technologies: a case s...
 
Java @ Rio Meetup #1 - Java @ Oracle Cloud
Java @ Rio Meetup #1 - Java @ Oracle CloudJava @ Rio Meetup #1 - Java @ Oracle Cloud
Java @ Rio Meetup #1 - Java @ Oracle Cloud
 

More from mfrancis

Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...mfrancis
 
OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)mfrancis
 
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)mfrancis
 
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank LyaruuOSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruumfrancis
 
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...mfrancis
 
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...mfrancis
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...mfrancis
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)mfrancis
 
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...mfrancis
 
OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)mfrancis
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...mfrancis
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...mfrancis
 
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...mfrancis
 
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)mfrancis
 
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)mfrancis
 
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)mfrancis
 
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...mfrancis
 
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)mfrancis
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...mfrancis
 
How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)mfrancis
 

More from mfrancis (20)

Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
 
OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)
 
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
 
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank LyaruuOSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
 
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
 
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
 
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
 
OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
 
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
 
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
 
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
 
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
 
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
 
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
 
How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)
 

Recently uploaded

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 

Recently uploaded (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 

Asynchronous Services – A promising future for OSGi - T Ward

  • 1. Asynchronous Services - A promising future for OSGi Tim Ward http://www.paremus.com Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved. info@paremus.com
  • 2. Who is Tim Ward? @TimothyWard • Senior Consulting Engineer, Trainer and Architect at Paremus • 5 years at IBM developing WebSphere Application Server • Container Implementations for Java EE and OSGi, including Blueprint, JPA, EJB and JTA • OSGi Specification lead for JPA, Weaving Hooks and Asynchronous Services • PMC member of the Apache Aries project • Previous speaker at Java One, EclipseCon, Devoxx, Jazoon, JAX London, OSGi Community Event... • Author of Manning’s Enterprise OSGi in Action • http://www.manning.com/cummins Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 3. What we’re going to cover • Why is the World Going Asynchronous? ! • Async Programming Primitives ! • Making Synchronous Services Asynchronous ! • Optimising Calls into Asynchronous Services Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved. ! • Demo
  • 4. New OSGi Specifications The OSGi Core Release 6 Specification was released in June! ! It’s available now at http://www.osgi.org/Specifications/HomePage! ! ! There is also a public draft of OSGi Enterprise Release 6! ! Available at http://www.osgi.org/Specifications/Drafts! ! This draft contains the specifications we’re going to be talking about!! ! The Enterprise specification is being wrapped up for final release in Q4 Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved. NEW
  • 5. Why is the World Going Asynchronous? Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 6. Origins of Asynchronous Programming Many peopler think of Async Programming as “recently popular”… The terms “Promise” and “Future” originate from 1970s research papers Proposed as mechanisms to handle large-scale parallel execution Asynchronous Programming concepts have been with us for a long time! User Interface EventHandler callbacks “must not block the UI thread!” Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 7. Advantages of Asynchronous Programming • Asynchronous systems offer better performance • This does assume that there isn’t a single bottleneck! ! • Asynchronous Distributed systems typically scale better • Less time spent waiting for high-latency calls • More reasonable failure characteristics ! • Parallelism is easier to exploit ! • Network Infrastructure is intrinsically asynchronous • Network Engineers have been working this way for decades Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved. 100% 100%
  • 8. Problems with Asynchronous Programming Human brains aren’t really designed to cope with asynchronous logic • Thought processes tend to be “do A”, then “do B” then “the result is C” • Asynchronous Programming is only useful if the benefits of using it outweigh the extra cognitive overhead ! Synchronous calls offer a natural “brake” in RPC • Asynchronous “Event Storms” can overwhelm remote systems, even using a single client thread. ! Deadlocks are still possible, and can be hard to diagnose Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 9. So what’s changed? The latest asynchronous revolution seems to be sticking! Multi-core is pervasive now, request-level parallelism isn’t always enough to max out hardware any more JavaScript has been a major driver in the last 5-10 years, in a single threaded environment. Async is a necessity! Commonly used OO languages are becoming more “functional” Java and C++ have added lambdas Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 10. Async Programming Primitives Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 11. Async Basics The Promise is the primitive of Asynchronous Programming A “Promise” represents a delayed value that will be “resolved” in the future “Resolving” a promise sets its value, or its failure OSGi Promises are based on JavaScript Promise concepts, but also significantly influenced by Scala Strictly, the OSGi (and most JavaScript) Promises are “Future” types as they have no methods for resolving themselves In both cases a Deferred type can create and resolve a default Promise implementation Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 12. The OSGi Promise The Promise Contract (based on JavaScript Promises) • The Promise is resolved or failed with a single value, at most once • Listener callbacks are called at most once • Promises remember their state (including their resolution / failure value) • Promises behave the same way regardless of whether they are already resolved or resolved in the future. ! Promises can be treated as a shareable value type • Effectively immutable (unless you created it!) • Thread safe • No need to unwrap it… Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 13. Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved. The Deferred OSGi provides a default Promise implementation for clients to use The Deferred is held by the provider of the Promise, and can be used to set its value or failure ! ! ! Deferred<Long> deferred = new Deferred<Long>();! ! ! ! new Thread(() -> {! ! ! ! ! try {! ! ! ! ! ! Long total = service.calculateDifficultSum();! ! ! ! ! ! deferred.resolve(total);! ! ! ! ! } catch (Exception e) {! ! ! ! ! ! deferred.fail(e);! ! ! ! ! }! ! ! ! }! ! ! }).start();! ! ! ! Promise<Long> promise = deferred.getPromise();
  • 14. Promise Callbacks Promises do support “synchronous” usage similar to Java’s Future • isDone(), getValue(), getFailure() • The getXxx() methods block ! It’s better to use Promises with callbacks (never block, remember?) • then(Success) or then(Success, Failure)! ! Success and Failure are both SAM interfaces, suitable for Lambda usage then((p) -> success(p.getValue()), ! ! (p) -> fail(p.getFailure()));! ! Callbacks should be fast - Success can return a Promise for longer tasks Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 15. Chaining Promises Basic chaining uses then(…), a new Promise is created that resolves when: • the success callback returns null; or • the success callback throws an error; or • the Promise returned by the success callback resolves Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved. ! Chaining allows you to compose sequences of events • Promises are Monads • Complex behaviours can be achieved without if/else branching ! More complex functional chains are natively supported • Filtering/Mapping values, recovering failures…
  • 16. The Promises utility class The Promises type provides number of common functions • Creating Promises that are already resolved or failed • Very useful when mapping / recovering promises ! Another useful utility is Promises.all(Promise…) • It creates a “latch” Promise that resolves when all others are complete • Good for final clean up, or for notifying users about aggregate tasks ! Remember that chains and latches work even if a Promise is already resolved! Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 17. A Chaining Example Download an XML file, preferably from a mirror URL, and parse it using JAXB ! Promise<Library> promise = getMirror(libraryURL)! ! ! ! ! .fallbackTo(Promises.resolved(libraryURL))! ! ! ! ! .then((p) -> downloadFile(p.getValue()))! ! ! ! ! .map((p) -> (Library) JAXB.unmarshal(p, Library.class)));! Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved. !!! ! public Promise<URL> getMirror(URL url)! ! ! throws Exception {! ! ! . . .! ! }! ! ! ! public Promise<File> downloadFile(URL url) ! ! ! throws Exception {! ! ! . . .! ! }!
  • 18. Making Synchronous Services Asynchronous Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 19. The OSGi service model The OSGi service model is useful and widely used ! ! Consumer ! Provider Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved. ! ! ! Service objects are obtained from the Service Registry and invoked • The call semantics depend upon the Service API • Most APIs are synchronous in operation ! OSGi Services can be transparent local representations of a remote resource
  • 20. Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved. Question? As a service client, how do I make an asynchronous call to a service? • I can’t / don’t want to rewrite the service • I’d prefer not to start threads or manage a thread pool • I’d also like my code to stay as clean as possible ! Ad-hoc solutions are messy, but have been the only choice up to now !
  • 21. The Async Service - Requirements • Allow arbitrary OSGi services to be called asynchronously • The call must be transparent to the backing service, no opt-in required ! • Must support methods that have a return value, as well as void ! • Must not rely on generated source, client-local interfaces or reflection • Source gets out of sync, and is hard to maintain • Reflection is just ugly! ! Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 22. Unit testing Mocks - Requirements • Allow arbitrary Objects to be called, remembering the calls that are made • The mocking must be transparent, no opt-in required ! • Mocks must allow methods to return a specific value ! • Must not rely on generated source, client-local interfaces or reflection • The test code is using the real interfaces/objects ! ! ! Notice any similarities? Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 23. How to use the Async Service To make asynchronous calls on a service you need an Async Mediator ! MyService mediated = async.mediate(myService, MyService.class);! ! Services can be mediated from a ServiceReference or the service object • ServiceReference is better because the mediator can track availability ! Clients then use the mediated object to make a normal method call • This records the call, just like a mock would in a test ! To begin the asynchronous task you pass the return value to async.call(T) ! Promise<Long> p = async.call(mediated.pianosInNYC());! Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 24. How to use the Async Service (2) Void methods can be slightly trickier • There’s a no-args version of call() which returns Promise<?> • Promises for void methods resolve with null when they complete ! If you don’t need the return state, then consider fire-and-forget • The execute() method doesn’t return the value • Fire-and-forget can be much more efficient* ! The Async Service is Thread Safe, but mediators may not be • Never share the Async object between Bundles, always get your own • Failure to do the above can lead to class space errors and security flaws! Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved. * More about this later!
  • 25. Async Service Example Perform two long running calls in parallel, then aggregate the result ! public void setAsync(Async async) {! ! ! this.async = async;! ! }! ! ! ! public void setMyService(ServiceReference<MyService> myService) {! ! ! this.myService = myService;! ! }! ! ! public Long getCombinedTotal() throws Exception {! ! ! MyService mediated = async.mediate(myService, MyService.class);! ! ! ! ! ! Promise<Long> bars = async.call(mediated.barsInNYC());! ! ! ! return async.call(mediated.pianosInNYC())! ! ! ! ! .flatMap((pVal) -> bars.map((bVal) -> pVal + bVal))! ! ! ! ! .getValue();! ! } Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 26. Optimising Calls into Asynchronous Services Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 27. What if we can do better? The AsyncDelegate interface allows services to provide their own asynchronous behaviours ! Remote Services allows most OSGi services to be transparently remoted • The details of the distribution mechanism are hidden • If the distribution provider supports asynchronous communications then it can optimise calls that it knows to be asynchronous Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved. Distribution Provider Distribution Provider
  • 28. Further optimising our calls Earlier we talked about fire-and-forget calls… ! Fire and forget ignores return values, and offers no callback on completion • Sometimes this gives you exactly what you need • It can also be very heavily optimised by remote services! ! ! Distribution Provider Distribution Provider Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved. ! ! Removing the return flow decreases work at both the local and remote ends • It also significantly reduces the load on the network
  • 29. Building a system from asynchronous microservices Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 30. Designing an Async-safe API • As we’ve seen, the service itself can have a standard synchronous API • No need to return a Promise/Future • No “duplicate interface” needed ! • Arguments and return types should be thread safe and/or Immutable • You were doing this anyway right? ! • It turns out that most remote APIs fit this model very well ! • Any existing microservice is likely to work • Remote OSGi μServices will too Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 31. Building an application from Async services • Using a mixture of synchronous and asynchronous services is possible • Latch promises are a good way to wait for multiple results ! • Hold on to the Promise, rather than the value • You can register failure callbacks after-the-fact! ! • Where possible, split big calls into smaller ones and aggregate in callbacks • This lets load-balanced replicas work like a grid dispatch system ! • Remember that retry/failure logic doesn’t have to be handled via try/catch Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 32. Demonstration: Building a system using the Async Service Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 33. The Demo Application A Simple JAX-RS app running in OSGi: • Angular JS + HTML5 canvas for display • REST service for Server-generated Fractal images • Server Sent Events to stream the data ! OSGi services provide scalable workers for the back end Source code is available on GitHub: http://bit.ly/paremus-async Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved. !
  • 34. Deploying to the Service Fabric • An OSGi Cloud runtime. • Highly modular and so highly evolvable • Transparent scaling and load balancing • Think Google ‘Kubernetes'++ • The Fabric dynamically deploys and maintains OSGi or Docker artefacts across a heterogenous environment. • Adaptive, Self Managing / Self Maintaining Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved.
  • 35. • For more about OSGi... • Specifications at http://www.osgi.org • Enterprise OSGi in Action • http://www.manning.com/cummins ! • For Service Fabric examples and docs • http://docs.paremus.com/ ! • For more about the demo (including source code) • http://bit.ly/paremus-async Questions? Use ‘javaonecftw’ at http://www.manning.com for 44% off all Books Asynchronous Services - A promising future for OSGi Copyright © 2005 - 2014 Paremus Ltd. Oct 2014 May not be reproduced by any means without express permission. All rights reserved. Thanks! http://www.paremus.com info@paremus.com