Giter Club home page Giter Club logo

hmcts.sscs-case-loader's Introduction

SSCS Case Loader Application

Build Status codecov Codacy Badge Codacy Badge

Purpose

The purpose of this App is to take cases coming from the legacy Gaps2 and create/update them in the CCD app.

What's inside

It contains:

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

Plugins

The project contains the following plugins:

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

Run the application by executing:

  ./gradlew bootRun

Running the application in Docker

Dockerisation is a work in progress.

Setting up a Dockerised SFTP server for developing purpose

This setup is required if files need to be processed via sftp server

  • To simply build the SFTP server
docker-compose rm -f && docker-compose -f docker-compose-sftp.yml build && docker-compose -f docker-compose-sftp.yml up
  • To login into a container which is currently running on your system and view transferred files

Place file to be transferred under docker/sftp/data/incoming then:

To connect into sftp container from sscs-case-loader container use:
```bash
sftp -P 22 -o StrictHostKeyChecking=no -i /home/webapp/sscs-sftp-key sftp@sscs-sftp:incoming

To connect into sftp container from host (your computer): Before first use

chmod 600 ./docker/sftp-docker

and put some files in here

./docker/sftp/data/incoming/

finally

sftp -P 2222 -o StrictHostKeyChecking=no -i ./docker/sftp-docker sftp@localhost:incoming
Connected to sscs-sftp.
Changing to: /incoming
sftp> dir
SSCS_Extract_Reference_2017-06-30-09-01-31.xml

Running e2e locally

  • Bring up the upstream systems using sscs-docker (https://github.com/hmcts/sscs-docker) project. Please follow the instructions given in the README document.

  • Run the application using the "local" profile:

SPRING_PROFILES_ACTIVE=local ./gradlew bootRun
  • Turn on debugging by editing sscs-case-loader/src/main/resources/application.yaml
logging.level:
    org.springframework.web: ${LOG_LEVEL_SPRING_WEB:debug}
    uk.gov.hmcts.reform.sscs: ${LOG_LEVEL_SSCS:debug}
  • Bring up the SFTP server
docker-compose rm -f && docker-compose -f docker-compose-sftp.yml build && docker-compose -f docker-compose-sftp.yml up
  • Open IntelliJ and import the Lombok plugin and enable annotation processing
  • Run this test within IntelliJ
https://github.com/hmcts/sscs-case-loader/blob/master/src/e2e/java/uk.gov.hmcts.reform.sscs/olde2e/ProcessFileAndSaveIntoCcd.java#L20
  • Refresh the browser to view the cases in CCD
http://localhost:3451
  • Running Functional test locally
  1. Make sure you bring up local SFTP and run sscs-docker dependencies
  2. Run
 SPRING_PROFILES_ACTIVE=local ./gradlew functionalPreDeploy
 SPRING_PROFILES_ACTIVE=local ./gradlew bootRun
 SPRING_PROFILES_ACTIVE=local ./gradlew functionalPostDeploy

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.

Hystrix dashboard

When this API is running, you can monitor Hystrix metrics in real time using Hystrix Dashboard. In order to do this, visit http://localhost:4550/hystrix and provide http://localhost:4550/hystrix.stream as the Hystrix event stream URL. Keep in mind that you'll only see data once some of your Hystrix commands have been executed. Otherwise 'Loading...' message will be displayed on the monitoring page.

Other

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

Troubleshooting

IDE Settings

Project Lombok Plugin

When building the project in your IDE (eclipse or IntelliJ), Lombok plugin will be required to compile.

For IntelliJ IDEA, please add the Lombok IntelliJ plugin:

  • Go to File > Settings > Plugins
  • Click on Browse repositories...
  • Search for Lombok Plugin
  • Click on Install plugin
  • Restart IntelliJ IDEA

Plugin setup for other IDE's are available on [https://projectlombok.org/setup/overview]

License

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

hmcts.sscs-case-loader's People

Contributors

aaronrs avatar adusumillipraveen avatar arcotc avatar asouthwell avatar bartlabno avatar bkpatel81 avatar chris-moreton avatar chrisdavecm avatar chrisgrimble avatar danhamilton avatar danielepolencic avatar dependabot-preview[bot] avatar dependabot-support avatar fantasticjamieburns avatar gokul-sol avatar hmcts-jenkins-sscs[bot] avatar iguannago avatar michaellavelle avatar mosinloye avatar paulvm avatar rasikasri avatar renovate-bot avatar renovate[bot] avatar rob-doherty avatar ryandac avatar sathishbabuj avatar satyachundur avatar savirneni avatar srochani avatar yashikno avatar

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.