We are currently developing a new software for which we decided OSGi modularity would be quite useful, as the software itself can be pretty well decomposed into modular structure in order to avoid code mess in the future and be able to easily add new features and hook into existing ones.
I have been playing with two (probably most popular) OSGi platforms, Eclipse Equinox (with Gemini Blueprint) and Apache Felix (with Aries). Basically I am now at the point of making a decision, which one we should use.
We have pretty much experience with Spring, so we would like to continue using that, along with annotations (such as @Autowired
for autowiring beans WITHIN the SAME bundle, @ServiceReference
for autowiring across bundles), some particular Spring addons (such as Data JPA), Hibernate as a JPA provider (so far, we have experience only with Hibernate as an JPA implementation, it has all features we need so we want to avoid having to switch to something else), JMS messaging (with ActiveMQ client) and few other features.
Later on, we also want to be able to implement our own security manager (to control access to certain bundles, based on e.g. their digital signatures, certificates with Permissions embedded in them)
So far, I have been able to make two testing bundles (one was using a service from the other) and treat them as Spring Beans on Equinox with Gemini BP. However, I've had some problems with annotations, though (and I don't really like wiring beans in XMLs, especially with not so complicated architecture - most of them are Singletons).
I've tried Aries as well (but not succeeded with enabling Spring there; probably just haven't spent enough time on that yet :) ).
Which OSGi platform do you recommend for such use case?
This one will be probably not the best answer but I think it is useful for you if I share my experiences. A couple of years ago I had exactly the same situation. I was experienced with Spring, JPA (Hibernate and EclipseLink). I found OSGi modularity useful so we started projects based on OSGi.
As I had used Spring before, it was obvious to use Blueprint (we ended up using Apache Aries as it was more stable than Gemini Blueprint). We did that for two years. However, we had many issues so I started to implement a new Blueprint container based on the specification. I heard many times that OSGi DS is better but as I had been a Spring fan before, the tutorials did not make me change my mind. I had the feeling that ConfigAdmin would have been really nice to use but with Blueprint it was not really possible to write nice code (I know that there is the cm namespace but it did not work well for us).
At the EclipseCon I talked to Peter Kriens and he convinced me to try out DS on a project. I did so and now I feel really sad about the time I used Blueprint (I did not mean to hurt you, Aries guys :)). Declarative Services together with ConfigurationAdmin is designed to work within the OSGi modularized world. I am pretty sure I know well your current feelings but if I really suggest to you not to make the same mistakes I did. Try to create two bundles with DS components, getting the Configuration from felix-configadmin and feel the power.
As of JPA, we used first EclipseLink. As it was too buggy, we switched to Hibernate. I wrote an adapter to be able to use it (available on GitHub). As much as I know, Hibernate has now more support in this topic, I have never tried it. In the end, we decided to leave JPA. We are on the end of replacing our infrastructure from JPA to Liquibase+QueryDSL. The components are more or less ready at https://github.com/everit-org, we need to work on documentation. If you are interested, why we switched from JPA, read the comments under the this blog post: http://blog.osgi.org/2013/12/attributes-attributes-and-attributes.html
My answer in short:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With