Showing posts with label Enterprise OSGi. Show all posts
Showing posts with label Enterprise OSGi. Show all posts

Monday, August 3, 2009

Purity or Compromise?

Update August 7: David Bosschaert has started a new OSGi blog for topics related to the EEG direction etc. I recommend every reader of this blog to check it for updates on what's happening at the EEG from here on.

Also a colleague pointed out that my diagram and text below is a bit optimistic about the availability of the Blueprint Container as a development model for Web apps in the near future. The current version of the design (documented in RFC 66) does not actually address this, although a future version is definitely expected to. The current version of the design simply standardizes the deployment of a WAR file onto an OSGi framework, which is a good first step but not the end goal.


This is my last blog as co-chair of the OSGi EEG. In fact as of last Friday David Bosschaert has officially taken over the position. But I was co-chair for last week's face to face meeting in Dublin, so I'll write a bit about what happened.

We have completed the R4.2 Core and Compendium specifications, which were submitted to the 45-day member review July 14. Assuming the vote goes well, publication will be early September. The Compendium includes the new Remote Services and Blueprint Container specifications, and the Core includes several enhancements and extensions resulting primarily from requirements gathered at the enterprise workshop.

That leaves the R4.2 Enterprise Profile, scheduled for release in December, for the EEG to work on. The major part of this work will be mapping various Java EE specifications to OSGi, such as JTA, JMX, JDBC, JNDI, JPA, and last but certainly not least Web apps. The profile will likely also include (by reference) the Blueprint Container and Remote Services parts of the R4.2 compendium.

Enterprise Profile Summary Diagram

I created the diagram to illustrate what we're trying to achieve, and presented it last week to help facilitate the planning part of the meeting to provide context around prioritizing the remaining work (it is not part of any formal OSGi document). Time is getting tight ;-) The OBR continuation is for example looking more like an R5 item at this point.

The main point is that defining a mapping for Web apps (.WAR files) using the Blueprint Container as the development environment and JDBC/JPA for persistence would seem to meet the requirements for a large number of enterprise applications, and represent a good starting point for the initial release of the Java EE mapping work.

What I call "system services" on the side represents the optional use of additional Java EE components (such as transactions, security, directory, and management) that such a Web application might choose to use if it needs them, along with Remote Services for invoking OSGi services deployed in other frameworks.

Because the Java EE components were not designed for OSGi, they depend on mechanisms such as context classloaders and file URLs to instantiate required classes and resources. Which of course breaks fundamental OSGi abstractions, since the framework is responsible for loading classes and managing the access to required resources. We had a very lively debate on the subject of how much the Java EE components should be required to change vs how much the OSGi specification should have to change. We did not reach consensus.

I think the solution may be found in a kind of mapping layer or adapter mechanism (conceptually similar to JCA), like the one in SpringSource dm Server, or in the ServiceMix Kernel (which has been moved to a separate project called Apache Karaf). But all I can really say at this point is that I will be very interested in hearing the results of the ongoing discussion.

Next Monday I start my job as an integration architect for Credit Suisse in New York. And they are not members of the OSGi Alliance - at least not yet ;-)

Thanks to everyone who followed the posts on this blog, and who participated in the discussion. Please keep it going! And support David and Tim and the rest of the EEG members...

Wednesday, July 22, 2009

R4.2: Next release of OSGi, and what's next

Alex Blewitt posted a great write up to InfoQ of Peter Kriens' recent presentation on the next release of OSGi, which is called R4.2.

This release started in September 2006 with the OSGi Enterprise Workshop. When I volunteered to co-chair the EEG in December I remember being told it would take about two years to get the release out. Pretty close I guess...

The presentation is kind of long (112 minutes), but well worth watching if you're interested in OSGi, or in hearing Peter's view of what's gone wrong with the Java Modularity initiative as currently defined in the JSR 294 community (of which he is a member) and how to fix it.

The new features in R4.2 are spread across the Core and Compendium parts of the , but the major changes in R4.2 are being driven by enterprise requirements, primarily represented in the Remote Services (formerly RFC 119) and Blueprint Container (formerly RFC 124) additions to the Compendium. The new service registry hooks in the core were similarly based on enterprise requirements (specifically from the Remote Services work).

But of course not done with the enterprise requirements. The EEG is meeting again next week, primarily to continue working on the Java EE component mappings Peter briefly references, which we hope to publish at the end of the year in an "Enterprise Profile" document, and start thinking about what's going to be in R5, scheduled for June 2010.

And we need to continue working on application metadata and the OSGi Bundle Repository definitions (despite the fact that Peter doesn't want to define an application ;-). The main reason for this is to provide a better foundation for the kind of development lifecycle tooling commonly used for enterprise application development.

We have made a good start, but there's lots more to do. Meanwhile the debate continues about whether or not it's a good idea to use OSGi for developing enterprise applications directly, or only indirectly through its incorporation in products.

R4.2 represents a significant step in this direction, but we still have a lot to do.

Tuesday, April 14, 2009

Questions from today's Webinar on Enterprise OSGi

4/21 Update: The archived Webinar has been posted, and a Webinar on Distributed OSGi scheduled for April 28 with David Bosschaert (one of the design's authors and a developer of the RI at Apache CXF). David is also a good presenter, and I've seen an early draft of the presentation. It looks like it will be very good.

Also a correction to one of the answers below, thanks to Neil Bartlett for that (and apologies for the delay posting the fix).

Eric

----correction---

In this answer, I said that JSR 291 makes OSGi part of Java SE. It does not. The approval of JSR 291 makes OSGi officially part of Java, but not part of Java SE. It would also need to be included in the platform JSR for Java SE for that to be the case. Sorry for the mistake, and thanks again for the correction.

Q: I understand Java 7 includes the osgi f/w, referencing it directly. does that mean that equinox will be part of java 7 SE?
A: First of all, Equinox is the framework implementation, not the specification. Normally the specification is what gets included into a Java edition. But this actually brings up the overall relationship between the JCP and OSGi Alliance. OSGi was started within the JCP as JSR 8 and later the participants decided to split out into an independent activity and formed the Alliance. However, the Alliance retained the rights to evolve JSR8 (OSGi) and propose it back into the JCP, which was done for example in JSR 291, which formally incorporates OSGi R4.1 into Java SE. It's a bit hard to predict what will happen in the future, since things are not completely aligned, but JSR 294 for example is being worked on in close cooperation with the OSGi community. A larger issue exists around this space, for example the controversy over Apache Harmony and their ability to obtain TCKs for certification. Sun has apparently decided to work on Java 7 outside the JCP in the OpenJDK project, which it controls. They have also started something there called Project Jigsaw, and so far that is not good coordination between that modularization effort and the OSGi community. But Sun used OSGi in Glassfish and some other projects, and did a good job of it, too - so perhaps there will be incentive enough over time to bring everything together and ensure the right thing is done for everyone.

----------------original answers-------------

Here are the answers to all the questions we received during today's Webinar on Enterprise OSGi. Thanks to everyone for attending! If anyone has more questions, post them here.

Eric

Several Qs: will the slide set be made available at the end of the presentation ?
A: A recording of the webinar will be posted on the Progress FUSE Web site. Those who requested a copy of the ppt during the presentation will receive a copy directly. Anyone else wishing to receive a copy directly post your email address.

Q: what work is being done to provide support for management tooling?
A: At this point the major activity is mapping JMX to the OSGi framework - this is scheduled to be part of the Java EE mapping profile published in Q4. Otherwise the OSGi framework includes its own management tooling, both command line and API, for installing bundles, starting, stopping bundles etc.

Q: Does Progress want to implement Blueprint based on Felix iPojo?
A: As an integration software supplier, Progress is unlikely to develop its own Blueprint service. However we expect that other vendors will supply an implementation of this specification in addition to SpringSource, who has already announced the intention to implement it. Other alternatives for help in developing OSGi services include OSGi Declarative Services, iPOJO, and Peaberry.

Q: I think that DS should also be part of Enterprise OSGi: It is on par with Spring DM!
A: Yes, thanks for mentioning that, the specifications certainly still include DS as an option.

Q: Is OSGI only for Java based applications? Can it be used for web applications with java based services on the server and javascript based clients?
A: Yes. Here's an example.

Q: Do the core enterprise revisions include work to make RMI work under OSGi frameworks?
A: Basically, yes. The enterprise edition does not require RMI but it is one of the supported distribution software types.

Q: Does the service registry have any relationship to UDDI or any other registry standard?
A: Basically, no. The OSGi service registry is specific to the OSGi framework. However the distributed OSGi design includes a "discovery service" that is intended to allow access to UDDI and other external registry standards such as LDAP and SLP.

Q: When we talk about the OSGI "registry", how does this integrate with runtime endpoint management (distinct from uddi based registries which are yet another topic)"
A: I'm not sure I completely understand the question, but perhaps I can explain the OSGi registry in a way that will help. Every service deployed to the OSGi framework is required to register with OSGi registry - that is how other services find it. The registry was designed for single-JVM use only - as per the previous question we have added extensions for discovering services in the remote case. The OSGi registry is therefore part of every OSGi framework deployment, but extensions were required for it to support remote service invocations using existing distribution software types.

Q: Can this be leveraged for RIA/Ajax web applications to discover services. Especially REST based services.
A: Yes, absolutely. See this example for more information . Regarding REST specifically this is a bit of a work in progress. The background to this topic is the fact that an OSGi service interface is a Java interface today, which implies a synchronous call/return semantic, and is an easier fit with RPC-style distribution software systems. However there has been some work in the area of mapping OSGi to REST-style communication patterns and I actually think this is a better fit for the dynamic environment of an OSGi framework than a communication system that depends on persistent sessions (since a persistent session could be broken by a dynamic service deploy/undeploy operation). I think you will be seeing much more work in this area in the future. Including discovery.

Q: What scripting language(s) are supported?
A: None, directly. The OSGi specification (today at least) is specific to the Java language. However we expect some scripting & dynamic languages & DSLs capable of running in a JVM to support OSGi, for example Scala and Groovy (which SpringSource has said they are already mapping to OSGi).

Q: what are the major pain points of using OSGi technology in the enterprise apps that we need to be aware of?
A: We have talked about some of these, such as the difficulty in migrating existing code (which typically uses different classpath assumptions) and the lack of tooling for the complete development lifecycle. However one of the biggest issues people report back from their experiences is conceptual - that using OSGi requires a different way of thinking about developing applications, and this takes some getting used to.

Q: Can you contrast Distributed OSGi and Jini?
A: Well, first of all we expect Jini to be one of the distribution software systems that will be mapped into OSGi, and there's an example already of Jini used with OSGi in the Paremus Infiniflow product. However, the EEG decided not to standardize on Jini or any other single distribution software type. So while we expect people to use Jini and OSGi together, it is not required. One key difference between Jini and the design of distributed OSGi is that distributed OSGi does not support serializing executable code (which I think is a bad idea anyway because there are some complex problems that I don't think you can really solve - but this is another discussion, I know a lot of people like to do it).

Q: Can we have Eric's email address?
A: You can post yours here and I'll reply or follow me on Twitter ("enewc") to get in touch. (I apologize but I don't like posting the address publicly due to spam.)

Q: Will the distributed connectivity model maintain support for other service binding specifications (namely Declarative Services)?
A: Yes, absolutely. Anything that works with OSGi services is supported since the design extends the OSGi service model itself.

Q: Is remote invocation over HTTP or RMI supported?
A: Yes

Q: Can the transport protocol be customized - e.g. to use ActiveMQ or other MQ?
A: Yes. The design specifically allows for the use of multiple protocols and data formats. One current constraint is the use of the Java interface to invoke a service, which implies a synchronous semantic to the communication. MQ systems can be used currently to implement the request/response message pattern and over time we will be working to create a design to more explicitly support asynchronous messaging.

Q: You mentioned that performance tests will be in place in order the check validity of the implementation. Will performance metrics be part of the upcoming spec and does an implementation have to meet those performance requirements to get certified?
A: Sorry about this misunderstanding - the conformance tests only test conformance to the specifications, they do not measure performance.

Q: Will Progress make available a simple Distributed OSGi Example as a learning start point?
A: Yes, see this example.

Q: How does Distributed OSGI compare to SCA- Service Component Architecture?
A: We reused parts of SCA in the distributed OSGi design since the SCA metadata is abstract from distribution software type, and here we found the two to be very compatible. SCA defines a static component model while OSGi defines a dynamic component model, and here is where the two diverge. But SCA has been successfully mapped onto OSGi frameworks, for example the Apache Tuscany project and Paramus have done this. I expect applications developed using SCA can be deployed onto OSGi without problem - the difference becomes an issue only when using the different programming models.

Q: Are there benefits in using the distributed api across cores on a multi-core machine?
A: I have to say this is a bit of an unknown at the moment. No doubt multi-core architectures are going to have a huge impact on software systems across the board, and on enterprise designs as well, but it's too soon to try to predict how they might impact distributed OSGi (most likely this will occur through the various distribution software types mapped to distributed OSGi though).

Q: How does the Blueprint Service/Component Model relate to the Service Component Architecture (SCA) concept?
A: I actually think they are similar, but the design of SCA includes more of Web services and languages other than Java. SCA is intended to be used for very large, heterogeneous SOA-style applications while the Blueprint Service is specific to the OSGi framework at the moment. Also the Blueprint Service allows explicit development of OSGi services, which SCA does not.

Q: isn't the Distributed OSGi some sort of IIOP/RMI mix that made EJB such a problem in the first place?
A: No, distributed OSGi does not define any particular distribution software type, and has nothing to do with EJBs. In fact the EEG does not include EJB mapping on the current list of Java EE components we're working on. RMI/IIOP is an example of a distribution software system that could be used with distributed OSGi, but distributed OSGi does not require it, or any other specific type of distribution software.

Q: Given that ServiceMix wraps its OSGI runtime and allows for distributed services this way, is there still a need for a distributed OSGI standard?
A: The distributed OSGi standard is not intended as a replacement for an existing solutions. If you're using ServiceMix today for distributed application functionality you don't have to change anything. Distributed OSGi is intended for use with the OSGi service model, so it really only applies to developers interested in using the OSGi service programming model directly (as opposed to indirectly using OSGi through a product) to communicate with other OSGi services in other JVMs, or to external services outside of the OSGi environment. The starting point for distributed OSGi is always an OSGi service.

Q: Which OSGi framework is being used?
A: Any. The OSGi specifications are defined independently of any framework implementation. We expect all of the framework implementations to implement the new versions of the specifications, perhaps not every part, and perhaps not all at the same time, but nothing we do in the EEG is specific to any framework implementation.

Q: Can I deploy more than one module which implements the same service interface ?
A: Yes.

Q: I heard Equinox - would this also be available as part of APache Felix?
A: Yes. I mentioned Equinox several times because it's the reference implementation for the core framework (including for the new R4.2 release) and therefore it will be available at the same time the specifications are published. However we have had the participation of the Apache Felix project lead (Richard Hall) in the EEG since the beginning and I expect Apache Felix to implement the new specifications as well, I just am not aware of the timing.

Q: I understand Java 7 includes the osgi f/w, referencing it directly. does that mean that equinox will be part of java 7 SE?
A: First of all, Equinox is the framework implementation, not the specification. Normally the specification is what gets included into a Java edition. But this actually brings up the overall relationship between the JCP and OSGi Alliance. OSGi was started within the JCP as JSR 8 and later the participants decided to split out into an independent activity and formed the Alliance. However, the Alliance retained the rights to evolve JSR8 (OSGi) and propose it back into the JCP, which was done for example in JSR 291, which formally incorporates OSGi R4.1 into Java SE. It's a bit hard to predict what will happen in the future, since things are not completely aligned, but JSR 294 for example is being worked on in close cooperation with the OSGi community. A larger issue exists around this space, for example the controversy over Apache Harmony and their ability to obtain TCKs for certification. Sun has apparently decided to work on Java 7 outside the JCP in the OpenJDK project, which it controls. They have also started something there called Project Jigsaw, and so far that is not good coordination between that modularization effort and the OSGi community. But Sun used OSGi in Glassfish and some other projects, and did a good job of it, too - so perhaps there will be incentive enough over time to bring everything together and ensure the right thing is done for everyone.

Q: What about standardization? Currently one can provide a certified R4 framework with just the core features. Will there be a certification for the EE features? Are there plans to make this a JSR?
A: No, the plan is to rely upon existing certification for Java EE features, and develop TCKs for OSGi that apply only to the mapping part of the design. In other words, OSGi has no intention to certify Java EE APIs that already have a certification process in place.

Q: Is there any publically available information about JMX integration? (Is that RFC 139? Is *that* available?)
A: Yes, it's in the early draft released last month along with designs for JTA, JNDI, Web apps, distributed OSGi, JDBC, and the Blueprint service.

Q: For web/war support, is there a link to preliminary spec and is work being done on a reference implementation.
A: See the early draft and yes, work is being done by EEG members on a reference implementation, which should be ready later in the year (and no later than publication of the Java EE spec in Q4).

Q: How can I convince our operators to go the extra mile and using a much more complex deployment. Are there any benefits for them?
A: The main benefit for IT operations is the dynamic deployment and management of services and bundles in the OSGi framework. The benefit of using OSGi for service development and deployment is reduced downtime for maintenance updates and upgrades.

Q: Could Spring DM server replace Apache Felix as the OSGi container in FUSE?
A: The answer is no because Spring DM is not a framework - it uses Eclipse Equinox. FUSE works with both Apache Felix and Eclipse Equinox. As far as I know the Spring dm Server works only with the Equinox framework.

Q: Do the connections between OSGi services perform better than JBI connections?
A: This is a little bit of an apples-to-oranges situation and difficult to answer this for sure. Local connections between OSGi services perform very well since they were designed for operation within a single JVM (i.e. no network stack, no serialization of data etc). On the other hand JBI was specifically designed for remote invocation using a normalized message router. When distributed OSGi uses JBI/NMR as a distribution software type (as is basically the
case in SMX/FUSE ESB) I would expect the performance to be exactly the same, or so close it would be hard to tell the difference.

Q: Can you please post the full set of questions with answers at some point?
A: I'm glad you asked (whew)! Yes.

Thursday, April 2, 2009

Tooling Related Challenges for OSGi EEG

During EclipseCon last week there was a BOF about tools for OSGi, and the day after an OSGi Tool Summit (Chris Aniszczyk posted a good summary).

Two significant challenges for the EEG emerged from these excellent discussions: complete the OBR design and define the term "application" as it relates to a collection of OSGi bundles and the resources they depend on. The OBR design work was partially completed in 2006, before the EEG started, and we had initially hoped to pick up the work from where it was left off.

At the main OSGi BOF it quickly became apparent that the Eclipse/OSGi community had diverged somewhat in this area, with Eclipse P2 taking a different approach. Among the attendees, Jason van Zyl probably put it best when he said (basically) "I don't care which one I have to follow, I just want a single standard" to support build, provisioning, and deployment lifecycle activities for OSGi. (Jason's company, Sonatype, is developing Maven based tooling for OSGi application development that promises to address a lot of these challenges.)

The challenge for Tim and me will be getting the OBR and P2 folks together and hashing out something agreeable to all. Unfortunately for Hal, he was the one to volunteer to drive this effort ;-) (The EEG work depends on volunteers to drive requirements and design docs.)

To be fair, none of us in the EEG really knew much about what was going on with P2, so it's important to take a step back and essentially reset the discussion. Unfortunately, during the January EEG F2F we identified progressing OBR as the highest priority work item...and with the strident calls for address the tooling challenges, we are going to continue to strongly focus on it.

A related topic for the EEG is the definition of an application as it relates to a deployment on an OSGi framework. A simple answer to this question is that an application is the same as a bundle, or anyway a bundle that references or includes all the other bundles it needs. But for enterprise applications, a strong requirement has been given to ensure consistency across the develop-test-deploy into production cycle.

The dynamic nature of the OSGi framework, usually one of its most attractive benefits, can be a liability in this area. So it seems there needs to be some way to formalize some metadata for what it means for a collection of bundles and associated resources to be used for a specific application. We have just started on the requirements document for this, but this is strongly related to the bundle repository/provisioning standard - the application definition is something that could be stored in and retrieved from the repository, and used to filter the collection of bundles and resources that need to be resolved and provisioned...

Should be fun!

Saturday, March 28, 2009

Enterprise OSGi - "Not List"

I spend a lot of time talking about what enterprise OSGi is, but I always get a lot of questions, particularly about distributed OSGi. I thought it might help to put out a list of what enterprise OSGi is not.

Enterprise OSGi is not:
  • Java EE - but EE components are being mapped to OSGi
  • A new distributed computing stack - but it defines how to use existing ones
  • Spring - but it has a "Spring-inspired" Blueprint service that does something similar
  • Something a bunch of vendors dreamed up and decided to standardize - it's a grass roots effort started because people were already using OSGi for enterprise applications and needed help
  • Done - the release of the specification is scheduled for June/July (part 1) and December (Part 2)
  • Simply a deployment standard - the real power and ultimate benefits of OSGi are in its service programming model
  • Untested - the OSGi Framework has been successfully used in enterprise scale deployments
Many of you who have been following the OSGi specification for a while are familiar with its trajectory - starting with its adoption as the platform for Eclipse, the OSGi Framework is used underneath most enterprise products based on Java, including market leading application servers, development tools, portals, and ESBs.

The question that stirs the most debate is not this aspect of OSGi but whether enterprise Java application developers will embrace it in addition to, or in place of, Java EE APIs. Those of us working on the enterprise OSGi release do understand that it is currently too hard to use, and that it's best to develop OSGi bundles and services using the Spring Framework/Blueprint service or another programming abstraction technology such as iPOJO or Peaberry. But we fully expect the benefits OSGi provides for improved modularity and dynamic deployment and update are benefits enterprise developers need.

Wednesday, March 25, 2009

Good information, bad conclusion

Kirk has written an interesting blog post about OSGi for the Enterprise. He may have done a good job at finding a controversial point to pursue, but unfortunately does not get it right. It is true there is currently no migration path, and tooling is an issue, but neither is to the point of enterprise adoption.

I'm currently sitting in the OSGi tools BOF at EclipseCon, and I can strongly validate the lack of tooling as a big issue. Kirk is pretty much on the money with his technical analysis, but the conclusion he draws is incorrect. This is a common trap people fall into when comparing a new, disruptive technology against an established, mature technology.

I remember clearly in the late '90s when most people in the TP monitor community said that Java application servers would never be used in the enterprise. Before that the conventional wisdom in the database world was that relational database would never be fast enough for update intensive applications.

The question is not how OSGi compares to Java EE application servers, but how it meets enterprise application requirements in its own right. If you compare a new, disruptive technology directly to a mature, established technology you cannot possibly reach the right conclusion. This phenomenon well documented in the "Innovator's Dilemma" for example. It is not the technology that's important but the requirements it's designed to address.

The enterprise is not a monolithic environment. One size does not fit all and many application requirements are better met by OSGi than Java EE, and many applications are less demanding than others. Kirk does a good job understanding and presenting OSGi technology and its benefits, but he does not ask the right questions about how well its features and functions match application requirements. The fact that something exists in the enterprise does not necessarily or predictably indicate what is needed next.

The issue is not whether OSGi can replace Java EE application servers but whether enterprise applications, and which ones, can benefit from using OSGi. Furthermore the enterprise development process is often a long term effort, and although features may be missing today for using OSGi in some applications, many of these things will be solved soon.

The people in this room complaining strongly about the lack of tooling are equally passionate about the benefits of OSGi, and are intent on using it to solve problems that application servers can't, and won't. They would not be here if they thought it wasn't ready.