Giter Club home page Giter Club logo

ecm-consumer's Introduction

ECM Consumer

Build Status

Purpose

The purpose of this template is to speed up the creation of new Spring applications within HMCTS and help keep the same standards across multiple teams. If you need to create a new app, you can simply use this one as a starting point and build on top of it.

What's inside

The template is a working application with a minimal setup. It contains:

  • application skeleton
  • setup script to prepare project
  • common plugins and libraries
  • docker setup
  • swagger configuration for api documentation (see how to publish your api documentation to shared repository)
  • code quality tools already set up
  • integration with Travis CI
  • Hystrix circuit breaker enabled
  • MIT license and contribution information
  • Helm chart using chart-java.

The application exposes health endpoint (http://localhost:8085/health) and metrics endpoint (http://localhost:8085/metrics).

Plugins

The template contains the following plugins:

Setup

Located in ./bin/init.sh. Simply run and follow the explanation how to execute it.

Notes

Since Spring Boot 2.1 bean overriding is disabled. If you want to enable it you will need to set spring.main.allow-bean-definition-overriding to true.

JUnit 5 is now enabled by default in the project. Please refrain from using JUnit4 and use the next generation

Building and deploying the application

Building the application

The project uses Gradle as a build tool. It already contains ./gradlew wrapper script, so there's no need to install gradle.

To build the project execute the following command:

  ./gradlew build

Running the application

Create the image of the application by executing the following command:

  ./gradlew assemble

Create docker image:

  docker-compose build

Run the distribution (created in build/install/spring-boot-template directory) by executing the following command:

  docker-compose up

This will start the API container exposing the application's port (set to 8085 in this template app).

In order to test if the application is up, you can call its health endpoint:

  curl http://localhost:8085/health

You should get a response similar to this:

  {"status":"UP","diskSpace":{"status":"UP","total":249644974080,"free":137188298752,"threshold":10485760}}

Alternative script to run application

To skip all the setting up and building, just execute the following command:

./bin/run-in-docker.sh

For more information:

./bin/run-in-docker.sh -h

Script includes bare minimum environment variables necessary to start api instance. Whenever any variable is changed or any other script regarding docker image/container build, the suggested way to ensure all is cleaned up properly is by this command:

docker-compose rm

It clears stopped containers correctly. Might consider removing clutter of images too, especially the ones fiddled with:

docker images

docker image rm <image-id>

There is no need to remove postgres and java or similar core images.

Hystrix

Hystrix is a library that helps you control the interactions between your application and other services by adding latency tolerance and fault tolerance logic. It does this by isolating points of access between the services, stopping cascading failures across them, and providing fallback options. We recommend you to use Hystrix in your application if it calls any services.

Hystrix circuit breaker

This template API has Hystrix Circuit Breaker already enabled. It monitors and manages all the@HystrixCommand or HystrixObservableCommand annotated methods inside @Component or @Service annotated classes.

Other

Hystrix offers much more than Circuit Breaker pattern implementation or command monitoring. Here are some other functionalities it provides:

License

This project is licensed under the MIT License - see the LICENSE file for details

docker build . -t hmcts/ecm-consumer:latest

ecm-consumer's People

Contributors

angela-lw avatar btensay avatar cindychmcts avatar dependabot-preview[bot] avatar dependabot[bot] avatar furnivall avatar gauravchawlamoj avatar hmcts-jenkins-d-to-i[bot] avatar hsjhita avatar jacarrete avatar jthmcts avatar justmehmet avatar mokainos avatar renovate-bot avatar renovate[bot] avatar timja avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ecm-consumer's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update Helm release java to v5.2.1
  • Update dependency com.github.hmcts.java-logging:logging to v6.1.5
  • Update dependency com.github.hmcts:ecm-common to v2.0.9
  • Update dependency com.github.hmcts:ecm-data-model to v1.3.4
  • Update dependency com.github.hmcts:fortify-client to v1.4.3
  • Update dependency commons-io:commons-io to v2.16.1
  • Update netty monorepo to v4.1.111.Final (io.netty:netty-transport-classes-kqueue, io.netty:netty-transport-classes-epoll, io.netty:netty-transport-native-unix-common, io.netty:netty-transport-native-kqueue, io.netty:netty-transport-native-epoll, io.netty:netty-transport, io.netty:netty-resolver, io.netty:netty-handler-proxy, io.netty:netty-handler, io.netty:netty-common, io.netty:netty-codec-socks, io.netty:netty-codec-http, io.netty:netty-codec, io.netty:netty-buffer)
  • Update plugin io.spring.dependency-management to v1.1.5
  • Update dependency checkstyle to v10.17.0
  • Update dependency com.fasterxml.woodstox:woodstox-core to v6.7.0
  • Update dependency com.google.code.gson:gson to v2.11.0
  • Update dependency com.nimbusds:nimbus-jose-jwt to v9.40
  • Update dependency commons-net:commons-net to v3.11.1
  • Update dependency gradle to v8.8
  • Update dependency hashicorp/terraform to v1.8.5
  • Update dependency net.javacrumbs.shedlock:shedlock-spring to v5.13.0
  • Update dependency org.apache.commons:commons-compress to v1.26.2
  • Update dependency org.springdoc:springdoc-openapi-ui to v1.8.0
  • Update dependency org.testng:testng to v7.10.2
  • Update feign monorepo to v13.3 (io.github.openfeign:feign-core, io.github.openfeign:feign-httpclient)
  • Update log4j2 monorepo to v2.23.1 (org.apache.logging.log4j:log4j-to-slf4j, org.apache.logging.log4j:log4j-api)
  • Update dependency com.fasterxml.woodstox:woodstox-core to v7
  • Update dependency com.google.guava:guava to v33
  • Update dependency org.springframework.cloud:spring-cloud-starter-openfeign to v4
  • Update dependency uk.gov.service.notify:notifications-java-client to v5
  • Update plugin org.sonarqube to v5
  • Update plugin org.springframework.boot to v3
  • Update tomcatEmbedVersion to v10 (major) (org.apache.tomcat.embed:tomcat-embed-websocket, org.apache.tomcat.embed:tomcat-embed-core)
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose.yml
dockerfile
Dockerfile
  • hmctspublic.azurecr.io/base/java 21-distroless
gradle
build.gradle
  • io.spring.dependency-management 1.1.4
  • org.springframework.boot 2.7.18
  • org.owasp.dependencycheck 9.0.6
  • com.github.ben-manes.versions 0.51.0
  • org.sonarqube 4.4.1.3373
  • checkstyle 10.15.0
  • com.github.hmcts:ecm-common 2.0.8
  • com.github.hmcts:ecm-data-model 1.3.3
  • com.github.hmcts:et-data-model 4.0.0
  • io.netty:netty-buffer 4.1.108.Final
  • io.netty:netty-codec 4.1.108.Final
  • io.netty:netty-codec-http 4.1.108.Final
  • io.netty:netty-codec-socks 4.1.108.Final
  • io.netty:netty-common 4.1.108.Final
  • io.netty:netty-handler 4.1.108.Final
  • io.netty:netty-handler-proxy 4.1.108.Final
  • io.netty:netty-resolver 4.1.108.Final
  • io.netty:netty-transport 4.1.108.Final
  • io.netty:netty-transport-native-epoll 4.1.108.Final
  • io.netty:netty-transport-native-kqueue 4.1.108.Final
  • io.netty:netty-transport-native-unix-common 4.1.108.Final
  • io.netty:netty-transport-classes-epoll 4.1.108.Final
  • io.netty:netty-transport-classes-kqueue 4.1.108.Final
  • org.bouncycastle:bcpkix-jdk15on 1.70
  • com.google.guava:guava 32.0.1-jre
  • com.github.hmcts.java-logging:logging 6.1.4
  • com.google.code.gson:gson 2.10.1
  • com.fasterxml.jackson.core:jackson-core 2.16.0
  • ch.qos.logback:logback-core 1.2.11
  • ch.qos.logback:logback-classic 1.2.11
  • com.nimbusds:nimbus-jose-jwt 9.37.3
  • io.github.openfeign:feign-httpclient 13.1
  • io.github.openfeign:feign-core 13.1
  • net.minidev:accessors-smart 2.5.1
  • net.logstash.logback:logstash-logback-encoder 7.4
  • junit:junit 4.13.2
  • net.javacrumbs.shedlock:shedlock-spring 5.10.2
  • org.apache.commons:commons-compress 1.25.0
  • org.apache.commons:commons-lang3 3.14.0
  • org.apache.httpcomponents:httpclient 4.5.14
  • org.apache.logging.log4j:log4j-api 2.22.0
  • org.apache.logging.log4j:log4j-to-slf4j 2.22.0
  • org.apache.pdfbox:pdfbox 3.0.2
  • org.apache.santuario:xmlsec 4.0.2
  • org.apache.tomcat.embed:tomcat-embed-core 9.0.83
  • org.apache.tomcat.embed:tomcat-embed-websocket 9.0.83
  • org.apache.xmlgraphics:batik-all 1.17
  • org.apache.xmlgraphics:xmlgraphics-commons 2.9
  • commons-net:commons-net 3.10.0
  • com.fasterxml.woodstox:woodstox-core 6.6.2
  • net.logstash.logback:logstash-logback-encoder 7.4
  • net.minidev:accessors-smart 2.5.1
  • org.springframework.security:spring-security-crypto 6.2.0
  • commons-io:commons-io 2.16.0
  • com.squareup.okio:okio 3.9.0
  • org.postgresql:postgresql 42.7.3
  • org.yaml:snakeyaml 2.2
  • org.springdoc:springdoc-openapi-ui 1.7.0
  • commons-fileupload:commons-fileupload 1.5
  • com.microsoft.azure:adal4j 1.6.7
  • org.springframework.cloud:spring-cloud-starter-openfeign 3.1.8
  • org.testng:testng 7.8.0
  • uk.gov.service.notify:notifications-java-client 4.1.1-RELEASE
  • com.auth0:java-jwt 4.4.0
  • com.github.hmcts:fortify-client 1.4.1
  • com.warrenstrange:googleauth 1.5.0
  • javax.xml.bind:jaxb-api 2.3.1
  • net.serenity-bdd:serenity-core 4.0.24
  • net.serenity-bdd:serenity-junit 4.0.24
  • net.serenity-bdd:serenity-rest-assured 4.0.24
  • net.serenity-bdd:serenity-spring 4.0.24
  • org.docx4j:docx4j 6.1.2
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.7
helm-values
charts/ethos-ecm-consumer/values.yaml
helmv3
charts/ethos-ecm-consumer/Chart.yaml
  • java 5.2.0
regex
Dockerfile
  • microsoft/ApplicationInsights-Java 3.4.18
terraform
infrastructure/flexi_db.tf
infrastructure/main.tf
infrastructure/state.tf
  • azurerm ~> 3.76
infrastructure/versions.tf
  • hashicorp/terraform >= 0.13
terraform-version
infrastructure/.terraform-version
  • hashicorp/terraform 1.6.6

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.