Skip to content

amitbhoraniya/spring-boot-osgi-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot OSGi Demo

This is demo application that shows how to use OSGi with Spring Boot.

Build Application

Execute below maven command, which will create a bundle in target/deploy directory and can be deployed in Apache Karaf Container.

mvn clean install

calc-core

Here, calc-core bundle is providing service of Calculator and itself implementing Addition Service.

After deploying only calc-core bundle if we call below Rest API.

http://localhost:8013/calculator

Then, its response would be like

["Addition"]

calc-plugin

Here, calc-plugin is implementing Calculator Service and providing support for Subtraction also. This plugin is dependent on calc-core plugin.

After deploying calc-core, if we again call same Rest API.

http://localhost:8013/calculator

Then, its response would be like

["Addition","Subtraction"]

To perform calculator operation, call below RestAPI.

http://localhost:8013/calculator/{operation}?n1={n1}&n2={n2}

For Example,

http://localhost:8013/calculator/addition?n1=12&n2=12

About

Simple Calculator API using Spring Boot OSGi.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published