Provides the capability to publish CCD message queue candidates to Azure Service Bus on a schedule.
Please note that this microservice is also available within ccd-docker.
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
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"}}}
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
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.
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.
To enable publishing to an Azure Service Bus destination:
- Comment the
SPRING_PROFILES_ACTIVE
environment variable in thedocker-compose.yml
- Set the Azure Service Bus connection string in the
SERVICE_BUS_CONNECTION_STRING
environment variable - Set the destination in the
CCD_CASE_EVENTS_DESTINATION
environment variable - this can be either a topic or a queue - Restart the application
To run all unit tests execute the following command:
./gradlew test
To run all integration tests execute the following command:
./gradlew integration
We use Checkstyle. To run all local checks execute the following command:
./gradlew check
Additionally, SonarQube analyses are performed on all remote code.
This project is licensed under the MIT License - see the LICENSE file for details