Microstarter CLI 0.2.5 #10
hashimati
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
To install it, copy the "mc.bat," "mc," and "mc.jar" files to your Micronaut Project or configure their files in your environment. Then, the "mc" command will be ready to use.
Pre-Requisite
Java 11+
New Features:
This is a significant release that supports Microservices configuration. MicrostarterCLI introduces the following Microservices features:
1. configure command:
The "configure command includes the following configuration:
a. Is Monolithic : This flag informs MicrostarterCLI that the configured Micronaut service is monolithic or microservice.
b. Discovery Client: if the application is "microservice", the MicrostarterCLI will ask the user to configure the Discovery service client. The configuration includes the Discovery Service type, server, and port. The supported discovery services are Eureka and Consul.
c. Configuration Server: Spring Cloud Config and Consul are supported configuration server types.
d. Service Id: this configuration will be used in registering the microservice in the "gateway register" command.
2. eureka command
The "eureka" command bootstraps a "Eureka" server from https://start.spring.io.
Example
> mc eureka -version 2.7.7 --javaVersion 11
3. config Command:
The "config" command bootstraps a "Spring Cloud Config" server from https://start.spring.io.
Example
> mc config -version 2.7.7 --javaVersion 11
4. gateway Command:
The "gateway" command bootstraps a "Spring Cloud Gateway" server from https://start.spring.io.
Example
> mc gateway -version 2.7.7 --javaVersion 11
register Subcommand:
You can use this command to configure a microservice's routes by Application name and service id in the Gateway instance.
Example:
> mc gateway register
5. security Command.
The "security" command supports JWT propagation for microservices.
6. New Banner
Bootstrapping Microservice Example:
This is a simple Micronaut Microservices configured using MicrostarterCLI 0.2.5.
The Microservices consists of:
How to generate the example:
1. Generating Eureka Server
run
> mc eureka -version 2.7.7 --javaVersion 11
2. Generate Fruit Service.
First run
> mc init --name FruitService
Then, run:
Note: Ensure to select "No" in "Is Monolithic?" question, and configure "eureka" as localhost.
3. Generate Vegetable Service.
First run
> mc init --name VegetableService
Then, run:
Note: Ensure to select "No" in "Is Monolithic?" question, and configure "eureka" as localhost.
4. Generate Spring Cloud Gateway & Configure the Routes
First, run:
Second, Enter the Gateway directory:
Run the following command twice to configure the routes of FruitService, and VegetableService
> mc gateway register
Example Repository: https://github.com/hashimati/Micostartercli-Microservice
This discussion was created from the release Microstarter CLI 0.2.5.
Beta Was this translation helpful? Give feedback.
All reactions