The Open Data Mesh Platform's Marketplace service server is a Spring Boot application that provides marketplace functionality for the Open Data Mesh Platform.
This service is part of the Open Data Mesh Platform initiative, providing marketplace capabilities for data products and services.
- Submit new access requests to the marketplace
- Handle executor responses for access requests
- Java 11 or higher
- Maven 3.6 or higher
- PostgreSQL (for production) or H2 (for development)
# application.properties
spring.datasource.url=jdbc:postgresql://localhost:5432/marketplace
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect# application.properties
spring.datasource.url=jdbc:h2:mem:marketplace
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect# Clone the repository
git clone https://github.com/opendatamesh-initiative/odm-platform-pp-marketplace-server.git
# Navigate to project directory
cd odm-platform-pp-marketplace-server
# Build the project
mvn clean install# Run with default configuration
mvn spring-boot:run
# Run with specific profile
mvn spring-boot:run -Dspring-boot.run.profiles=dev# Build the Docker image
docker build -t odm-marketplace-server .
# Run the container
docker run -p 8080:8080 \
-e SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/marketplace \
-e SPRING_DATASOURCE_USERNAME=your_username \
-e SPRING_DATASOURCE_PASSWORD=your_password \
odm-marketplace-serverThe application can be configured using the following properties in application.yml or application.properties:
server:
port: 8080 # The port on which the application will runspring:
application:
name: odm-platform-pp-marketplace-server
banner:
charset: UTF-8
mode: consolespring:
datasource:
url: jdbc:postgresql://localhost:5432/marketplace # Database connection URL
username: your_username # Database username
password: your_password # Database password
jpa:
properties:
hibernate:
default_schema: marketplace_data # Default schema for database tablesspring:
flyway:
baselineOnMigrate: true # Allow baseline migrations
locations: classpath:db/migration/postgresql # Location of migration scripts
schemas: public # Target schema for migrations
validateOnMigrate: false # Skip validation during migration
outOfOrder: true # Allow out-of-order migrationsodm:
product-plane:
notification-service:
address: http://localhost:8083 # Notification service URL
active: true # Enable/disable notification service
utility-plane:
marketplace-executors: # List of marketplace executors
- name: EXEC-001 # Executor name
address: http://localhost:8080 # Executor URL
active: true # Enable/disable executorlogging:
pattern:
console: "%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wEx"
file: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
level:
org.springframework.web.filter.CommonsRequestLoggingFilter: DEBUGThese properties can be overridden using environment variables or command-line arguments when running the application.
When running the application in Docker, you can pass the Spring configuration as a JSON string using the SPRING_PROPS environment variable. Here's an example:
docker run -p 8080:8080 \
-e SPRING_PROPS='{"spring":{"datasource":{"url":"jdbc:postgresql://db:5432/marketplace","username":"your_username","password":"your_password"},"jpa":{"properties":{"hibernate":{"default_schema":"marketplace_data"}}}},"odm":{"product-plane":{"notification-service":{"address":"http://notification-service:8083","active":true}},"utility-plane":{"marketplace-executors":[{"name":"EXEC-001","address":"http://executor:8080","active":true}]}}}' \
odm-marketplace-serverThe JSON structure follows the same hierarchy as the YAML configuration:
{
"spring": {
"datasource": {
"url": "jdbc:postgresql://db:5432/marketplace",
"username": "your_username",
"password": "your_password"
},
"jpa": {
"properties": {
"hibernate": {
"default_schema": "marketplace_data"
}
}
}
},
"odm": {
"product-plane": {
"notification-service": {
"address": "http://notification-service:8083",
"active": true
}
},
"utility-plane": {
"marketplace-executors": [
{
"name": "EXEC-001",
"address": "http://executor:8080",
"active": true
}
]
}
}
}This approach is particularly useful when you need to configure multiple properties at once in a Docker environment, as it allows you to pass all configuration in a single environment variable.
The application can be configured using environment variables:
SPRING_PROFILES_ACTIVE: Set active profile (dev, prod)SPRING_DATASOURCE_URL: Database connection URLSPRING_DATASOURCE_USERNAME: Database usernameSPRING_DATASOURCE_PASSWORD: Database passwordSERVER_PORT: Application portSERVER_SERVLET_CONTEXT_PATH: API context path
Once the application is running, you can access:
- Swagger UI:
http://localhost:8080/swagger-ui.html - OpenAPI Specification:
http://localhost:8080/api-docs
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
For support, please open an issue in the GitHub repository.
- Open Data Mesh Initiative
- All contributors to this project