In this article, Java J2ee development experts are sharing the concept of Spring Cloud. You will get to know about its feature also. Read this post to know the function and major components of Spring Cloud Data flow.
Technology: Spring Cloud Data Flow is a cloud-native orchestration service for compostable microservice applications on modern runtimes. With Spring Cloud Data Flow, developers can create and orchestrate data pipelines for common use cases such as data ingest, real-time analytics and data import/export. It is deployment/ hosting tool for java based micro services and also dashboard/monitor for java based applications to control behavior and health check of java based micro services and also it provides multiple instances of the same applications and also it provides the full details of the executions triggered by user either from UI or from shell.
Running Data flow server locally:
Data flow server depends redis server, you can download redis server from http://download.redis.io/releases/redis-3.2.5.tar.gzM
You need to extract the zip and you can start the redis server using below command:redis-server.exe redis.windows.conf
You can download the spring dataflow server local jar file from maven repository http://repo.spring.io/release/org/springframework/cloud/spring-cloud-dataflow-server-local/1.1.0.RELEASE/spring-cloud-dataflow-server-local-1.1.0.RELEASE.jar
You can start the server locally using java – jar spring-cloud-dataflow-server-local-1.1.0.RELEASE.jar by default spring dataflow server will run on 9393 port, after the successful start, open http://localhost:9393/dashboard in your favorite browser, you can see the similar to below screen.
We can write custom microservices of type source, task, sink, processor and we can register with data flow server.
We will get know how to develop this type of applications in later blogs.
If we register any task type of application we will get alert below shown in image.
Go to TASKS menu, apps tab then you will find the registered app.
Then click create definition on registered app, then you will find the below screen.
Definition name: we can supply any text which will be identity the task.
Parameters sections contains what are the parameters are required to run the task, if those parameters are mandatory then we can click on Include checkbox and submit.
Then we can launch the task using launch button.
The log folder path we can observe in the server console for debugging purpose.
Spring Data flow Shell: we can also connect dataflow server using spring shell provided by spring data flow shell. We can download the spring dataflow shell from spring repo using the URL:
http://repo.spring.io/release/org/springframework/cloud/spring-cloud-dataflow-shell/1.1.0.RELEASE/spring-cloud-dataflow-shell-1.1.0.RELEASE.jar We can launch the spring data flow shell using java –jar spring-cloud-dataflow-shell-1.1.0.RELEASE.jar
Then you can observe the below image,
If the data flow server is up and running on port 9393 the shell automatically connect, otherwise we can also connect to data flow server explicitly using below command:
dataflow config server http://localhost:9393
You can observe the successful message:
Successfully targeted http://localhost:9393
After successful connection we can create an app using below command:
app register --name unzip --type task --uri file://C:/tmp/unzip-task1.jar
task create mytask --definition "taskdef"
task execution list:
task execution list --name unzip1
to get full details of the execution task display --id
Spring cloud data flow is providing server with easily deployable microservices dynamically, we can easily integrate the microservices using piping with middleware message brokers. We can monitor the metrics, health, memory of the each of the deployed microservices .dataflow will also providing shell to managing the same from command prompt.
Java web development have shared the concept of Spring Cloud in this post. You can follow the guidelines they have shared here to understand the Spring Cloud and its features. For further queries, write to experts in comments.