• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Accessing OSGI Bundles in Spring Boot

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have been writing some microservices  in Spring boot. We have an existing application running in an OSGI container and I need to some few of its components/bundles in spring boot. I know we cannot access the components running in an OSGI container directly however my main question is, can I take those bundle jars and add it to my Spring Boot dependency? Will Spring Boot be able to load the bundles as a regular jars and can I access the api's in it?

I tried referring these bundles already in my pom.xml of Spring Boot application, but no luck. Was wondering is this even possible?

Thanks
Mehul
 
Saloon Keeper
Posts: 22505
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spring Boot is basically a pre-packaged webapp server with deployed webapp.

OSGi is, as you know, quite a different sort of container.

You can use the same classes in both, but the webapp server doesn't automatically do the things that OSGi does, so you'd be sharing the class code and nothing else. Depending on your build system, it might be perfectly manageable to be building the same classes for inclusion of both targets. Doing it manually would be a bit messier, though.

You might want to consider an OSGi container that can act as a webapp server in its own right rather than using Spring Boot - get one container for the price of 2. For example, Apache ServiceMix.

Because the OSGi instances and webapp instances are going to be running in hermetic classpaths, however, directly sharing objects between your OSGi code and webapp code might still be a problem, but there are channels whereby an OSGi app and webapp can communicate between the 2, like web services do.
 
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic