I'm new to OSGi topic, but try to learn something about this technology.
After some resarch, I can't find answer to the question: What is the real difference between Eclipse Virgo and Apache ServiceMix?
What I've done to reveal this mystery myself. I've looked at both and first I thought that Virgo seems to be something like a web server for OSGi while ServiceMix more like a bus. But then I saw that ServiceMix attached jetty and I can even add a web console feature to manage ServiceMix from the browser, so I got totally confused. Now I don't know, mayby Virgo and ServiceMix are the same kind of software, but with diffrent bundles and producer (similar to e.g. jetty and tomcat)?
Virgo and Apache Karaf are OSGi Runtime Containers both containing also the feature of deploying web applications which are deployed to an underlying web-container. Apache ServiceMix does provide an ESB on top of Karaf so ServiceMix actually does more than Virgo.
Related
ESB experts, need some help. I am stuck in apache servicemix(v 4.5.3). The scenario is the communication between our enterprise applications including one is web application already executing on tomcat. Two applications are main applications, and last one is Vert.x server(used for push notification). They all are executing on different machines.
The problem is how to configure servicemix, that I can use as a ESB and let applications to communicate.
What I have done till now:
1. Deployed(war) web application as a bundle in servicemix in deploy folder.
Is this the right approach for communication b/w independent applications? What I am thinking is don't deploy any war/jar in servicemix, just use as a esb. I mean, is this the necessity to deploy applications in servicemix to let communication?If yes, than how will I achieve this, I mean I am using distributed environment and servicemix is running on separate machine ?
Please guide me. I am novice in esb world.Feel free to ask if any query.
Yes you need to deploy applications in ServiceMix that has the logic how to integrate and your business logic.
ServiceMix is using Apache Karaf as the container, so its basically just an application server (OSGi based).
To build applications that integrate you very often should use Apache Camel as its comes out of the box with ServiceMix. So I suggest to take a look at and learn more about Apache Camel, and how to use that to integrate.
There is another question here on stackoverflow that can help your get started learning about Apache Camel: What exactly is Apache Camel?
Apache ServiceMix / Karaf supports deploying WAR files, and also OSGi bundles. The latter is more often used. And there is some WAR files which may not work, if they use some libraries that do not work well in an OSGi environment.
Our new project has Apache CXF based Producer SOAP web services.Now we are planning to move the Web Services to production.We are looking for a suitable Open Source container(Web Server or App Server) for deploying CXF Based Java Web Service.First option came to mind was Tomcat 7 .Just needed expert advice on
1. Whether combination of CXF and Tomcat based WebServices are currently used in production for other projects ?And is this solution scalable & Reliable ?
2. Are there other options to deploy CXF based webServices other than Tomcat in production ?
Thanks!
1 . Whether combination of CXF and Tomcat based WebServices are currently used in production for other projects ? And is this solution scalable & Reliable
It shouldn't give you any issue since it is compatible with a wide variety of application server. We are using Tomcat7 and Tomcat6 to deploy our CXF web services and they are in production for quite some time now without any issue.
2 . Are there other options to deploy CXF based webServices other than Tomcat in production ?
There are multiple options to deploy cxf based web-services
From the docs
Lightweight containers: deploy services in Jetty, Tomcat or Spring-based containers
JBI integration: deploy as a service engine in a JBI container such as ServiceMix, OpenESB or Petals
Java EE integration: deploy services in Java EE application servers such as Apache Geronimo, JOnAS, Redhat JBoss, OC4J, Oracle WebLogic,
and IBM WebSphere
Standalone Java client/server
Is it possible to deploy ear (Jersey and Metro) archive in embedded Jetty? Google shows articles and manuals only about Jetty + JBoss.
As far as I understand, Jetty shouldn't have such a functionality.
That's because jetty was designed to be a web container only for Servlets and JSPs.
You can see the jetty as an alternative to the Tomcat web server.
So Jetty is able to process only web based stuff (read WARs).
JBoss on the other hand is a full fledged Java EE container, so it can handle ears as well.
What you've seen is probably embedding the jetty inside the jboss.
I know that Jboss has used tomcat for dealing with servlets and jsps internally, so it might be possible to switch the underlying implementation from tomcat to jetty.
Hope this helps
I'll add that many people deploying into things like JBoss or other full Java EE stacks really don't need the full stack and can often get away with a servlet engine plus a handful of components. I know folks that have gone with aggregated solutions of things like jetty + open ejb to achieve a lightweight stack that does what they need without all the added Java EE bells and whistles. For example, if you intend to have an embedded scenario then you don't need to deploy an ear you can deploy the application bit by bit, handling servlets with jetty and ejb's with openejb or whatever *bean solution you like.
If you need the full Java EE container then by all means use one...but if you are using a minor subset of those Java EE features there are other ways to assemble your application.
In researching OSGi and OSGi containers, I stumbled across this SO question mentioning GlassFish as an OSGi container, and I have to say I'm quite baffled.
How is this possible?!?!
My understanding was that OGS - a Java-compliant app server - has 2 containers:
Web Container: where you deploy WAR files for web apps and services
App Container: where you deploy EJBs for business logic
Where do OSGi bundles fit into this paradigm?!? Does OGS allow you to deploy an OSGi bundle to the app container and treat it like an EJB or something? And if I'm mistaken about how OGS works please correct me! Thanks in advance!
Hmm, a rather total misunderstanding of what OSGi is ...
OSGi is a framework that allows you to organize your code so that you can built it from reusable components that can then collaborate through the service layer (no more Class.forName or XML!).
OSGi frameworks can run standalone, they run inside an application, the can run in a WAR file, and they can run inside an application server. And you can even run OSGi inside OSGi inside OSGi since it does not rely on statics anywhere.
The OSGi Alliance specifies a format for the modules (bundles) so that modules can specify their dependencies. The Alliance also specifies an API to install and manage modules. And last, it specifies a large number of interfaces that are useful when you develop applications.
Websphere, Glassfish, JBoss, Jonas, all support deploying OSGi bundles.
OSGi is a module system that allows to add/remove/upgrade different bundles, handles dependencies, provides runtime information on the status, etc.
When it comes to GlassFish (which has an Apache Felix OSGi container in it), the different features of the application server (eg HTTP server, JMS server, etc.) are implemented as bundles. There is console and web based interface for the OSGi container where you can start, install, remove services (see the PDF below)
As far as Java EE applications go, they can interact with the OSGI container too. For example, an EJB can be exported as an OSGi service and also the EJB can consume an OSGi service itself.
For more info, see http://glassfish.java.net/public/GF-OSGi-Features.pdf
Glassfish internally uses OSGi to provide the features you mentioned. Besides that you can deploy your own OSGi bundles on it. See https://wikis.oracle.com/display/GlassFish/OSGi
There is no real connection between OSGi and Java EE though. You can not yet use JavaEE in OSGi bundles on Glassfish. For this case there are first initiatives like Weld on OSGi: http://www.slideshare.net/TrevorReznik/weldosgi-injecting-easiness-in-osgi
They are not really production ready though.
Working on a project that runs an embedded Jetty web server withing its infrastructure. We are looking at addings a new web application that would benefit greatly from allowing views to be plugged in using OSGi. Vaadin is our web framework of choice.
There is a great tutorial on creating an OSGi pluggable Vaadin application in GlassFish where the web container and OSGi container are bridged. That is, the web container is not running in the OSGi container. Here is the tutorial: https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20Modular%20Vaadin%20Application%20with%20OSGi
My question is. Would it be possible to bridge an embedded Jetty web container and OSGi container in the same way as described in this tutorial.
Running jetty in an OSGi container is simply not an option for us as we have to work with existing deployment.
You should be able to embed any 4.2 compliant framework via the org.osgi.framework.launch.FrameworkFactory class. There's a few good examples if you google, two good ones are on the Felix site, and Neil Barlett's blog.
Configuring it will be far more work - you'll need to export all the Jetty and servlet packages via a system property org.osgi.framework.system.packages.extra and use something like Felix fileinstall or a console and pax-url to un/deploy bundles.
While your Vaadin app will be dynamic - nothing from Jetty or the embedding application will be (i.e. domain entities, services etc).
Could you embed a different container? Eclipse Virgo and JBoss AS are both OSGi and J2EE containers.
http://www.eclipse.org/virgo/
http://www.jboss.org/as7