• Save
Distributed Services - OSGi 4.2 and possible future enhancements
Upcoming SlideShare
Loading in...5
×
 

Distributed Services - OSGi 4.2 and possible future enhancements

on

  • 4,246 views

In the first part of this talk David Bosschaert will explain the Distributed OSGi specification, which is new in OSGi 4.2. The talk will outline the design principles and also show how to distribute ...

In the first part of this talk David Bosschaert will explain the Distributed OSGi specification, which is new in OSGi 4.2. The talk will outline the design principles and also show how to distribute OSGi services in practise by a short demo. In the second part of this talk Marc Schaaf will present some preliminary results regarding research on how asynchronous messaging could be integrated into OSGi. The talk will discuss some possible integration approaches and will outline the current approach taken in this research project. A short demo is included showing how developers could use it.

Statistics

Views

Total Views
4,246
Views on SlideShare
4,154
Embed Views
92

Actions

Likes
9
Downloads
0
Comments
1

3 Embeds 92

http://osgilook.wordpress.com 51
http://osgilook.com 29
http://www.slideshare.net 12

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • yes , i like...
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Distributed Services - OSGi 4.2 and possible future enhancements Distributed Services - OSGi 4.2 and possible future enhancements Presentation Transcript

  • Distributed OSGi and Possible Future Enhancements David Bosschaert Marc Schaaf david.bosschaert@gmail.com marc@marc-schaaf.de OSGi DevCon Europe 2009 - Zürich
  • About Us ● David Bosschaert ● Works at Progress Software in Dublin (previously IONA Technologies) ● Member of the OSGi Enterprise Expert Group ● Coding Open Source projects ● Marc Schaaf ● Student of computer science at the University of Applied Science in Hannover, Germany ● Currently writing his masters thesis on a possible integration of asynchronous messaging into OSGi
  • Distributed OSGi (Remote Services)
  • Remote Services New OSGi Specifications, based on the Distributed OSGi RFC 119. 1. Remote Services, which specifies the standardized properties for service remoting. Will be released this summer as part of OSGi 4.2 2. Distribution Service Admin API’s. Contains standard API’s for interacting with the Distribution Provider and Discovery Providers. Will be released before the end of the year.
  • Demo of Remote Services Client Side OSGi container Server Side OSGi container (Felix) (Equinox) Core OSGi Bundles Core OSGi Bundles Library Bundles Library Bundles DOSGi Bundles DOSGi Bundles (Apache CXF) (Apache CXF) My App Interfaces Bundle My App Interfaces Bundle ook My App Consumer Bundle My App Service Bundle egistry H Service R red by invokes creates provides trigge publishes svc OSGi proxy svc remote service metadata remote remote endpoint publishes Discovery invocation service
  • Asynchronous Messaging in OSGi An integration approach
  • Project Lightsabre – Aims OSGi Container OSGi Container OSGi Container OSGi Container “Normal” Bundle “Normal” Bundle Mediation Component Mediation Component Queue or Messaging System Messaging System Topic Already existing / /Legacy Already existing Legacy Application Application
  • The OSGi EventAdmin ● EventAdmin ● OSGi internal mechanism for (asynchronous) event based communication with topic semantic EventAdmin Service Push Events SendingBundle EventAdmin Impl. Receive Events Deliver Events ReceivingBundle EventHandler Service ● Events consist of a topic and an arbitrary number of key:value pairs ● An EventHandler can provide a filter to select the events he wants to receive
  • EventAdmin Based Integration Idea: Introduce an “Event Distribution System” (EDS) which mediates between the EventAdmin and the MoM OSGi Container OSGi Container Events Messages EventHandling Service EventAdmin Configuration Receiving Bundle Service EventAdmin EDS MoM Sending Bundle EventAdmin EventHandling Service Service Events Messages
  • EventAdmin Based Integration ● Basic messaging functionality with existing API ● Seamless integration ● Usage of MoM without any knowledge about it ● Drawbacks ● No guaranteed delivery → No reliability ● No error handling, ..... ● Possible solutions ● Use another (new) API ● Extend the existing API (next slide)
  • “Extended” EventAdmin ● Idea: Introduce an extended EventAdmin API ● The additional API could provide guaranteed delivery and could be implemented directly by the EDS ● The old API still enables legacy bundles to use messaging with limited features OSGi Container OSGi Container Extended EventAdmin Service EventHandling Service EventAdmin Service Receiving Bundle EventAdmin EDS MoM Sending Bundle EventAdmin EventHandling Service Service
  • Demo Sending OSGi Container Sending OSGi Container Receiving OSGi Container Receiving OSGi Container Message Producing Bundle Message Consuming Bundle EventAdmin Events EventAdmin EDS EDS ActiveMQWrapper ActiveMQWrapper ActiveMQ Topic ActiveMQ
  • How to Send Messages ServiceTracker st = new ServiceTracker(bctx, EventAdmin.class.getName(), null) { @Override public Object addingService(ServiceReference reference) { eventAdmin = (EventAdmin) bctx.getService(reference); jbSend.setEnabled(true); return super.addingService(reference); } }; Sending an Event Dictionary<String, Object> props = new Hashtable<String, Object>(); props.put("message", jtMessage.getText()); Event ev = new Event("demo", props); eventAdmin.sendEvent(ev); Configuration org.fusesource.lightsabre.name=DemoActiveMqForwarding org.fusesource.lightsabre.direction=send org.fusesource.lightsabre.event.topic=demo org.fusesource.lightsabre.messaging.binding=org.apache.activemq org.fusesource.lightsabre.messaging.url=tcp://localhost:61616 org.fusesource.lightsabre.messaging.subject=DemoActivemqTopic [...]
  • How to Receive Messages Bundle Activator public void start(BundleContext context) throws Exception { Dictionary props = new Hashtable(); props.put(EventConstants.EVENT_TOPIC, "demo"); context.registerService(EventHandler.class.getName(),new DemoMessageReceiver(), props); } Event Handler public class DemoMessageReceiver implements EventHandler { public void handleEvent(Event event) { System.out.println("DemoMessageReceiver: " + event.getProperty("message")); } } Configuration org.fusesource.lightsabre.name=DemoActiveMqForwarding org.fusesource.lightsabre.direction=receive org.fusesource.lightsabre.messaging.binding=org.apache.activemq org.fusesource.lightsabre.messaging.url=tcp://localhost:61616 org.fusesource.lightsabre.messaging.subject=DemoActivemqTopic [...]
  • Conclusion ● Distributed OSGi ● A standardized way to use the OSGi Services model with Remote Service Distribution ● Asynchronous Messaging ● Promising approach as a basis for further research found ● Lightsabre provides a first implementation
  • Thank you for your kind attention OSGi Remote Services Project Lightsabre OSGi Asynchronous Messaging OSGi 4.2 Draft ➔ http://www.osgi.org/Specifications/Drafts ➔ http://lightsabre.fusesource.org Reference Implementation ➔ http://cxf.apache.org/distributed-osgi.html