Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Run Your Project Using Conductr Sandbox

DZone's Guide to

Run Your Project Using Conductr Sandbox

Learn how to use Conductr to run your microservices in a cluster, and use Conductr's sandbox to test your project locally.

· Microservices Zone ·
Free Resource

Learn how modern cloud architectures use of microservices has many advantages and enables developers to deliver business software in a CI/CD way.

ConductR is a solution for managing Lightbend Reactive Platform applications across a cluster of machines. It is reactive from the ground up thus enabling operations to provide the resiliency required to unleash the full benefits of the Lightbend Reactive Platform in their organization.

Conductr is suitable for running microservices in a cluster. Conductr comes with a sandbox where we can test our project locally.

Now we will see how to run your project in the conduct sandbox.

Prerequisites

Install conduct-cli which is used to communicate with the ConductR cluster:

sudo pip3 install conductr-cli

Adding the sbt-conductr Plugin

To use sbt-conductr for your project add the plugin to your project/plugins.sbt:

 addSbtPlugin("com.lightbend.conductr" % "sbt-conductr" % "2.3.0") 

Create and Run Your Bundle on Conductr Sandbox

Enter the sbt command terminal and then follow these steps:

Step 1) Start Conductr sandbox:

 sandbox run 2.1.12 -n 3 --feature visualization 

The above command will start a virtual sandbox environment in the local system.

 conduct info 

conduct info will give you the Conductr cluster info.

Step 2) Move to your project.

Step 3) Create the bundle for the project:

 bundle:dist 

This will create the bundle (in zip format) that will be later loaded to the Conductr sandbox.

Step 4) Load your bundle.

 conduct load <click tab>  

Step 5) Run your project.

 conduct run <project-impl>  

Check your Conductr to see the running services:

 conduct info 

Step 6) See the project's log:

 conduct logs -n 100 <bundle-id> 

Step 7) Stop and unload the running service:

 conduct stop <project-impl>  

 conduct unload <project-impl>  

Step 8) Stop the sandbox completely:

 sandbox stop 

Conductr also provides pre-configured bundles for Cassandra, Elasticsearch, Zookeeper, etc. so that we can use it directly if needed.

It also provides a visualization tool that we can use to see all running services. It looks like this:

Image title

Thanks for reading!

References:

Lightbend ConductR - Lagom Doc

Lightbend ConductR

Discover how to deploy pre-built sample microservices OR create simple microservices from scratch.

Topics:
microservices ,tutorial ,conductr ,java ,distributed systems

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}