Skip to content

sekhrivijay/ms-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ms-template

Here are the list of features provided in the library and the template show cases how to use these features with ease.

VIP management (local and global)

        <dependency>
            <groupId>com.services.micro.commons</groupId>
            <artifactId>commons-vip</artifactId>
            <version>1.0.0</version>
        </dependency>
service:
  vip:
    enabled: false

JSONP support

        <dependency>
            <groupId>com.services.micro.commons</groupId>
            <artifactId>commons-jsonp</artifactId>
            <version>1.0.0</version>
        </dependency>
service:
  jsonp:
    enabled: true

Memcache integration

       <dependency>
                  <groupId>com.services.micro.commons</groupId>
                  <artifactId>commons-memcache</artifactId>
                  <version>1.0.0</version>
              </dependency>
service:
  memcache:
    enabled: true
    configs:
      - ttl: 3600
        servers: localhost:11211
        name: default
      - ttl: 36000
        servers: localhost:11211
        name: autofill

Telemetry support OOB (metrics )

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>com.services.micro.commons</groupId>
            <artifactId>commons-metric</artifactId>
            <version>1.0.0</version>
        </dependency>
service:
  metrics:
    dropwizard:
      enabled: false
    prometheus:
      enabled: false
    jmx:
      enabled: true
    @Timed
    @ExceptionMetered
    @LogExecutionTime
    public ServiceResponse getResponse(String key) { .. }

CircuitBreaker for dependencies

       <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-hystrix</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>
        </dependency>

Service registration and discovery and load-balancing with Eureka .

Swagger integration for SDK generation and documentation

        <dependency>
            <groupId>com.services.micro.commons</groupId>
            <artifactId>commons-swagger</artifactId>
            <version>1.0.0</version>
        </dependency>
service:
  swagger:
    enabled: true
#    base-package: com.micro.services.search.resource
   @ApiOperation(
            value = "Get search results ",
            notes = "Pass q and other parameters to get relevant suggestions back ",
            response = SearchServiceResponse.class
    )
    public SearchServiceResponse test() throws Exception {...}

SCM (git) build status of the deployed service

        <dependency>
            <groupId>com.services.micro.commons</groupId>
            <artifactId>commons-git</artifactId>
            <version>1.0.0</version>
        </dependency>
service:
  git:
    enabled: true
pom.xml
            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <version>2.2.1</version>
                <configuration>
                    <failOnNoGitDirectory>false</failOnNoGitDirectory>
                </configuration>
            </plugin>

Auto configuration with GIT as backend server using spring cloud config server

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-config-server</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>

Distributed log tracing and analysis

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-zipkin</artifactId>
        </dependency>
spring:
  zipkin:
    base-url: http://localhost:8680/
    flush-interval: 15
    enabled: false

Performance Logging

            <dependency>
                    <groupId>com.services.micro.commons</groupId>
                    <artifactId>commons-logging</artifactId>
                    <version>1.0.0</version>
                </dependency>
service:
  logging:
    enabled: false
    @LogExecutionTime
    public ServiceResponse getMessage() { ..}

PMD integration

pom.xml
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.8</version>
                <configuration>
                    <printFailingErrors>true</printFailingErrors>
                    <!--<rulesets>-->
                    <!--<ruleset>example_pmd.xml</ruleset>-->
                    <!--</rulesets>-->
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                            <goal>cpd-check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Checkstyle integration

pom.xml
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.17</version>

                <executions>
                    <execution>
                        <id>check</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                            <!--<goal>checkstyle</goal>-->
                        </goals>
                        <configuration>
                            <configLocation>${basedir}/checkstyle.xml</configLocation>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>true</failsOnError>
                            <failOnViolation>true</failOnViolation>

                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Cobetura integration

pom.xml
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <check>
                        <haltOnFailure>true</haltOnFailure>
                        <!--<branchRate>95</branchRate>-->
                        <lineRate>0</lineRate>
                        <!--<totalBranchRate>5</totalBranchRate>-->
                        <totalLineRate>0</totalLineRate>
                    </check>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>clean</goal>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

API artifacts

pom.xml
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classifier>client</classifier>
                            <includes>
                                <include>**/demo/api/**</include>
                                <include>**/demo/config/**</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published