Watch
1
0
Fork
You've already forked jme-message-exchange-example
0
mirror of https://github.com/jme-admin-ch/jme-message-exchange-example.git synced 2026-08-17 13:05:00 +00:00
Read-only mirror of https://github.com/jme-admin-ch/jme-message-exchange-example — Bundesamt für Informatik und Telekommunikation. Issues & pull requests at the source. Catalog: https://www.opensource.admin.ch/en/softwares/3wza3w https://www.opensource.admin.ch/en/softwares/3wza3w
  • Java 96.8%
  • Shell 3.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-17 01:25:07 +02:00
.github/workflows JEAP-7322: Update maven arguments to skip pact provider tests 2026-07-30 13:58:28 +02:00
.mvn JEAP-6505: OSS preparation 2026-07-15 09:08:08 +02:00
.run JEAP-6505: OSS preparation 2026-07-15 09:08:08 +02:00
docker chore(deps): update repo.bit.admin.ch:8444/amazon/aws-cli docker tag to v2.36.24 2026-08-15 23:02:43 +00:00
jme-message-exchange-auth-scs fix(deps): update all dependencies 2026-08-16 23:04:06 +00:00
jme-message-exchange-client-service fix(deps): update all dependencies 2026-08-16 23:04:06 +00:00
jme-message-exchange-service fix(deps): update all dependencies 2026-08-16 23:04:06 +00:00
jme-message-exchange-test fix(deps): update all dependencies 2026-08-16 23:04:06 +00:00
scripts JEAP-6505: OSS preparation 2026-07-15 09:08:08 +02:00
.gitignore JEAP-6505: OSS preparation 2026-07-15 09:08:08 +02:00
CHANGELOG.md fix(deps): update all dependencies 2026-08-16 23:04:06 +00:00
CONTRIBUTING.md JEAP-6505: OSS preparation 2026-07-15 09:08:08 +02:00
exclude-patterns.txt JEAP-6505: OSS preparation 2026-07-15 09:08:08 +02:00
LICENSE JEAP-6505: OSS preparation 2026-07-15 09:08:08 +02:00
mvnw JEAP-6505: OSS preparation 2026-07-15 09:08:08 +02:00
pom.xml fix(deps): update all dependencies 2026-08-16 23:04:06 +00:00
publiccode.yml Update version/date in publiccode.yml 2026-08-17 01:25:07 +02:00
README.md JEAP-6505: OSS preparation 2026-07-15 09:08:08 +02:00
SECURITY.md JEAP-6505: OSS preparation 2026-07-15 09:08:08 +02:00
setPomVersions.sh JEAP-6505: Republish the project with version 1.0.1 2026-07-15 10:49:17 +02:00
THIRD-PARTY-LICENSES.md Updating THIRD-PARTY-LICENSES.md 2026-08-14 10:15:45 +02:00

JME Message Exchange Service Example

This example shows how to use the jEAP Message Exchange Service locally. It contains the following modules:

  • jme-message-exchange-auth-scs: An instance of the OAuth mock server to authenticate against the jEAP Message Exchange Service.
  • jme-message-exchange-client-service: A mock for application using the Message Exchange service. This app will call the rest endpoints of the Message Exchange service to simulate a real application.
  • jme-message-exchange-client-service: An instance of the Message Exchange service.

This example project show how to use the jeap-message-exchange-service library. The library contains all the necessary components to set up a Message Exchange service instance.

Changes

This library is versioned using Semantic Versioning and all changes are documented in CHANGELOG.md following the format defined in Keep a Changelog.

Prerequisites

To use this project, ensure you have the following installed:

  1. Java Development Kit (JDK): Version 25.
  2. Docker: For running the required infrastructure.

Note: Use the provided maven wrapper to build and run the project.

Getting started

Infrastructure

Before the examples can be started the infrastructure has to be started using docker

docker-compose -f docker/docker-compose.yml up

Build

The project itself can be built with a simple

./mvnw install

Start

Then the individual subprojects can be started using

./mvnw --projects jme-message-exchange-auth-scs spring-boot:run -Dspring-boot.run.profiles=local
./mvnw --projects jme-message-exchange-service spring-boot:run -Dspring-boot.run.profiles=local
./mvnw --projects jme-message-exchange-client-service spring-boot:run -Dspring-boot.run.profiles=local

Testing the Message Exchange Service API

To test the API of the Message Exchange service, use the Swagger UI at

Testing the Message Exchange Service Client API

To test the API via the client service, use the Swagger UI at http://localhost:8082/message-exchange-client/swagger-ui/index.html?urls.primaryName=Message+Exchange+Service+Client+API

The token obtained from the OAuth mock server will contain a business partner ID (bpId) with the value '123'.

Testing the API with the malware scan enabled

If the malware scan is enabled, the following steps can be used to test the API:

  • Send a new message to the Message Exchange service using the Partner API. The message will be stored in the S3 bucket and a message will be sent to the SQS queue for malware scanning.
  • Simulate a malware scan result by sending a message to the SQS queue for malware scan results. The message should contain the object key of the message in the S3 bucket, the bucket name, and the scan result (e.g., "NO_THREATS_FOUND" or "THREAT_FOUND").
  • Use the following command to simulate a malware scan result:
AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test \
  aws --endpoint-url=http://localhost:4566 --region eu-central-1 \
  sqs send-message \
  --queue-url http://localhost:4566/000000000000/malware-scan-results \
  --message-body '{
    "objectKey": "cc7d5097-4d3f-4fff-af91-fd2680191544",
    "bucketName": "bazg-jme-messageexchange-partner-obs-dev",
    "scanResult": "NO_THREATS_FOUND"
  }'
  • Retrieve the message from the Message Exchange service using the Internal API. The message should now have the scan result updated and can be retrieved successfully.

Note

This repository is part of the open source distribution of JME. See github.com/jme-admin-ch/jme for more information.

License

This repository is Open Source Software licensed under the Apache License 2.0.