Giter Club home page Giter Club logo

ccd-message-publisher's Introduction

CCD Message Publisher

Quality Gate Status

Provides the capability to publish CCD message queue candidates to Azure Service Bus on a schedule.

Getting Started

Please note that this microservice is also available within ccd-docker.

Prerequisites

Building and deploying the application

Building the application

The project uses Gradle as a build tool. It already contains a ./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 the build/libs directory) by executing the following command:

  docker-compose up

This will start the API container exposing the application's port (4456).

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

  curl http://localhost:4456/health

You should get a response similar to this:

  {"status":"UP","components":{"db":{"status":"UP","details":{"database":"PostgreSQL","validationQuery":"isValid()"}},"diskSpace":{"status":"UP","details":{"total":47111729152,"free":3854127104,"threshold":10485760,"exists":true}},"jms":{"status":"UP","details":{"provider":"ActiveMQ"}},"ping":{"status":"UP"},"refreshScope":{"status":"UP"}}}

Alternative script to run application

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

  ./bin/run-in-docker.sh -c -i

For more information:

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

Azure Service Bus & Local Testing

There is currently no Azure Service Bus emulator available for local/offline testing, and therefore the CCD Message Publisher provides an alternative option through an embedded ActiveMQ instance. This is possible due to both Azure Service Bus and ActiveMQ support for the AMQP 1.0 protocol.

ActiveMQ

By default the CCD Message Publisher is configured to start in "dev" mode with ActiveMQ enabled when run locally.

ActiveMQ information, including details on published messages, can be accessed via the Hawtio Management Console UI at http://localhost:4456/hawtio.

Note that the ActiveMQ menu option on Hawtio will only show up once the first message has been published, and data will not persist across restarts. This is meant for dev/test purposes only and ActiveMQ and the Hawtio console are disabled in production.

Azure Service Bus

To enable publishing to an Azure Service Bus destination:

  1. Comment the SPRING_PROFILES_ACTIVE environment variable in the docker-compose.yml
  2. Set the Azure Service Bus connection string in the SERVICE_BUS_CONNECTION_STRING environment variable
  3. Set the destination in the CCD_CASE_EVENTS_DESTINATION environment variable - this can be either a topic or a queue
  4. Restart the application

Developing

Unit tests

To run all unit tests execute the following command:

  ./gradlew test

Integration tests

To run all integration tests execute the following command:

  ./gradlew integration

Code quality checks

We use Checkstyle. To run all local checks execute the following command:

  ./gradlew check

Additionally, SonarQube analyses are performed on all remote code.

License

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

ccd-message-publisher's People

Contributors

a-r05 avatar abhishekdangashiya avatar abi-laver avatar aktaskaan avatar chris-hodgson-hmcts avatar danlysiak avatar dinesh1patel avatar duranmf avatar hemantt avatar hmcts-jenkins-cdm[bot] avatar jamescollettcgi avatar kaanaktas avatar lang-ben avatar marvincudjoe avatar mikebrownccd avatar mokainos avatar msancaktutar avatar muhammad-umerji01 avatar nathan-clark avatar olawale-olanrewaju avatar owen-delaney-cgi avatar padmapriyanalam avatar paulridout avatar rebeccabaker avatar sgecici avatar shahir145 avatar simchandramouly-hmcts avatar skandala-cgi avatar tomxelliott avatar vamshirudrabhatlahmcts avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ccd-message-publisher's Issues

Dependency Dashboard

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

Pending Approval

These branches will be created by Renovate only once you click their checkbox below.

  • Update actions/cache action to v4
  • Update actions/checkout action to v4
  • Update actions/setup-java action to v4
  • Update dependency com.github.hmcts:befta-fw to v20
  • Update dependency com.github.hmcts:ccd-test-definitions to v8
  • Update dependency com.google.guava:guava to v33
  • Update dependency com.zaxxer:HikariCP to v5
  • Update dependency io.hawt:hawtio-springboot to v4
  • Update dependency org.apache.activemq:activemq-broker to v6
  • Update dependency org.apache.activemq:activemq-client to v6
  • Update dependency org.hibernate:hibernate-core to v6
  • Update dependency org.springframework.cloud:spring-cloud-dependencies to v2023
  • Update hmctspublic.azurecr.io/base/java Docker tag to v21
  • Update plugin org.sonarqube to v5
  • Update plugin org.springframework.boot to v3
  • Update slf4j monorepo to v2 (major) (org.slf4j:slf4j-simple, org.slf4j:slf4j-api)
  • Update stefanzweifel/git-auto-commit-action action to v5
  • Update tibdex/github-app-token action to v2
  • Update versions.tomcatVersion to v10 (major) (org.apache.tomcat.embed:tomcat-embed-websocket, org.apache.tomcat.embed:tomcat-embed-core)
  • ๐Ÿ” Create all pending approval PRs at once ๐Ÿ”

Open

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

  • Update All patch-minor dependencies (gradle, microsoft/ApplicationInsights-Java, com.github.hmcts:fortify-client, com.github.hmcts:befta-fw, com.github.hmcts:ccd-test-definitions, com.zaxxer:HikariCP, org.postgresql:postgresql, com.fasterxml.jackson.core:jackson-databind, commons-io:commons-io, net.minidev:json-smart, org.apache.activemq:activemq-broker, org.apache.activemq:activemq-client, org.apache.httpcomponents:httpclient, org.hibernate:hibernate-core, com.vladmihalcea:hibernate-types-52, io.hawt:hawtio-springboot, ch.qos.logback:logback-core, ch.qos.logback:logback-classic, org.glassfish:jakarta.el, org.apache.tomcat.embed:tomcat-embed-websocket, org.apache.tomcat.embed:tomcat-embed-core, 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, io.netty:netty-common, io.netty:netty-codec-http, io.netty:netty-codec, io.netty:netty-buffer, org.testcontainers:postgresql, org.testcontainers:junit-jupiter, org.testcontainers:testcontainers, org.junit.vintage:junit-vintage-engine, org.projectlombok:lombok, com.microsoft.azure:applicationinsights-spring-boot-starter, com.microsoft.azure:applicationinsights-logging-logback, com.github.hmcts.java-logging:logging, org.junit.platform:junit-platform-engine, org.junit.platform:junit-platform-commons, org.junit.jupiter:junit-jupiter-params, org.junit.jupiter:junit-jupiter-engine, org.junit.jupiter:junit-jupiter-api, com.google.guava:guava, org.bouncycastle:bcpkix-jdk15to18, org.springframework.cloud:spring-cloud-dependencies, org.slf4j:slf4j-simple, org.slf4j:slf4j-api, com.github.spacialcircumstances.gradle-cucumber-reporting, com.azure:azure-messaging-servicebus, uk.gov.hmcts.java, org.sonarqube, com.github.ben-manes.versions, org.springframework.boot, io.spring.dependency-management)
  • Update dependency gradle to v8

Detected dependencies

docker-compose
docker-compose.yml
dockerfile
Dockerfile
  • hmctspublic.azurecr.io/base/java 17-distroless
github-actions
.github/workflows/dependency-check.yml
  • tibdex/github-app-token v1
  • actions/checkout v3
  • actions/cache v3
  • actions/setup-java v3
  • stefanzweifel/git-auto-commit-action v4
gradle
build.gradle
  • io.spring.dependency-management 1.0.13.RELEASE
  • org.springframework.boot 2.5.15
  • com.github.ben-manes.versions 0.36.0
  • org.sonarqube 4.3.0.3225
  • uk.gov.hmcts.java 0.12.43
  • com.github.spacialcircumstances.gradle-cucumber-reporting 0.1.23
  • org.springframework.cloud:spring-cloud-dependencies 2020.0.5
  • org.bouncycastle:bcpkix-jdk15to18 1.77
  • com.google.guava:guava 32.1.2-jre
  • org.junit.jupiter:junit-jupiter-api 5.7.0
  • org.junit.jupiter:junit-jupiter-engine 5.7.0
  • org.junit.jupiter:junit-jupiter-params 5.7.0
  • org.junit.platform:junit-platform-commons 1.7.0
  • org.junit.platform:junit-platform-engine 1.7.0
  • org.junit.vintage:junit-vintage-engine 5.7.0
  • com.microsoft.azure:azure-servicebus-jms-spring-boot-starter 2.3.5
  • io.netty:netty-buffer 4.1.107.Final
  • io.netty:netty-codec 4.1.107.Final
  • io.netty:netty-codec-http 4.1.107.Final
  • io.netty:netty-common 4.1.107.Final
  • io.netty:netty-handler 4.1.107.Final
  • io.netty:netty-resolver 4.1.107.Final
  • io.netty:netty-transport 4.1.107.Final
  • io.netty:netty-transport-native-epoll 4.1.107.Final
  • io.netty:netty-transport-native-kqueue 4.1.107.Final
  • io.netty:netty-transport-native-unix-common 4.1.107.Final
  • org.glassfish:jakarta.el 4.0.1
  • ch.qos.logback:logback-classic 1.2.10
  • ch.qos.logback:logback-core 1.2.10
  • io.hawt:hawtio-springboot 2.12.0
  • io.springfox:springfox-swagger2 3.0.0
  • com.github.hmcts.java-logging:logging 6.0.1
  • com.microsoft.azure:applicationinsights-logging-logback 2.4.1
  • com.microsoft.azure:applicationinsights-spring-boot-starter 2.4.1
  • com.vladmihalcea:hibernate-types-52 2.10.0
  • org.projectlombok:lombok 1.18.28
  • org.hibernate:hibernate-core 5.4.25.Final
  • org.apache.httpcomponents:httpclient 4.5.13
  • org.apache.activemq:activemq-client 5.16.7
  • org.apache.activemq:activemq-broker 5.16.7
  • net.minidev:json-smart 2.4.7
  • commons-io:commons-io 2.14.0
  • commons-fileupload:commons-fileupload 1.5
  • org.apache.tomcat.embed:tomcat-embed-core 9.0.82
  • org.apache.tomcat.embed:tomcat-embed-websocket 9.0.82
  • com.fasterxml.jackson.core:jackson-databind 2.16.0
  • org.postgresql:postgresql 42.5.5
  • com.zaxxer:HikariCP 4.0.2
  • com.github.hmcts:ccd-test-definitions 7.22.2
  • com.github.hmcts:befta-fw 9.0.2
  • org.apache.poi:poi-ooxml-schemas 4.1.2
  • commons-lang:commons-lang 2.6
  • org.testcontainers:testcontainers 1.18.3
  • org.testcontainers:junit-jupiter 1.18.3
  • org.testcontainers:postgresql 1.18.3
  • com.github.hmcts:fortify-client 1.4.3
gradle/suppress.gradle
topic-reader-util/build.gradle
  • com.azure:azure-messaging-servicebus 7.0.1
  • org.slf4j:slf4j-api 1.7.5
  • org.slf4j:slf4j-simple 1.7.5
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.7
topic-reader-util/gradle/wrapper/gradle-wrapper.properties
  • gradle 6.7.1
helm-values
charts/ccd-message-publisher/values.yaml
helmv3
charts/ccd-message-publisher/Chart.yaml
  • java 5.2.1
  • servicebus 1.0.7
regex
Dockerfile
  • microsoft/ApplicationInsights-Java 3.4.13

  • 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.