Tuesday, October 4, 2016

Build MSF4J with WSO2 Carbon Kernel 5.1.0

MSF4J supports standalone mode as well as the OSGi mode. Unlike other WSO2 products, MSF4J is not released as a typical server. But you can build up your own server by installing the MSF4J feature in to the Carbon Kernel.
You can used the pom based approach to install the MSF4J feature into the Kernel 5.1.0

Steps

Copy the following pom.xml and carbon.product file to a some directory
Run “mvn clean install” inside the directory.
If the build is success, you can find the build product inside the target folder. You can run the server by executing the wso2carbon-kernel-5.1.0/bin/carbon.sh file in the target directory.

Add a Microservice to the Server

You can build the stockquote bundle sample as mentioned inhttps://github.com/wso2/msf4j/tree/master/samples/stockquote/bundleThen copy the bundle to wso2carbon-kernel-5.1.0/osgi/dropins directory and start the server.
To invoke the deployed service use below curl command
curl http://localhost:9090/stockquote/IBM

MSF4J will Support JAX-RS Sub-Resource and Running Multiple Microservice Runners


WSO2 MSF4J will will support JAX-RS sub resources and running multiple microservice runners in its’ next release along with some great features.

JAX-RS Sub-Resource

You can try out the sub-resources with the latest MSF4J snapshot version. https://github.com/wso2/msf4j/tree/master/samples/subresource is the MSF4J Sub resource sample that demonstrate how to use sub-resource with MSF4J.

Running Multiple MicroservicesRunners

In previous MSF4J versions we only support running a single MicroservicesRunner in a single JVM. With the next release you can run several MicroservicesRunners in a single JVM.
Following code segment shows a simple sample of the usage.
Tryout the new features in the MSF4J and provide your feedback. Also please do raise issues in JIRA/Github if you encounter anything.