Skip to content

Spring Boot application that replicates vendor and route master data from SAP web services to SQL Server

Notifications You must be signed in to change notification settings

TorbenMerrald/nomecointegration

Repository files navigation

Nomeco Integration

A Spring Boot application that replicates vendor and route (initials) master data from SAP web services to a local SQL Server database.

Overview

This integration service periodically polls SAP RFC web services to fetch vendor and route master data, then stores the data locally for downstream systems. It supports multi-company configurations and uses Apache Camel for orchestration and scheduling.

Features

  • Vendor Replication: Syncs vendor master data including company info, addresses, bank details, and VAT information
  • Initials/Route Replication: Syncs route IDs and dispatcher assignments
  • Multi-Company Support: Configure multiple company codes for parallel replication
  • Cron Scheduling: Configurable polling schedules per data type
  • Transactional Updates: Full refresh with rollback support on failures

Tech Stack

  • Language: Groovy 4.x
  • Framework: Spring Boot 3.2
  • Integration: Apache Camel 4.4
  • Database: Microsoft SQL Server
  • Build: Gradle
  • Java: 17+

Project Structure

src/main/groovy/dk/bpas/nomeco/integration/nomecointegration/
├── NomecointegrationApplication.groovy    # Application entry point
├── entity/
│   ├── Vendor.groovy                      # Vendor JPA entity
│   └── Initials.groovy                    # Route/Initials JPA entity
├── repository/
│   ├── VendorRepository.groovy            # Vendor data access
│   └── InitialsRepository.groovy          # Initials data access
└── routes/
    ├── StartRoutes.groovy                 # Route initialization
    ├── RouteReplicateVendors.groovy       # Vendor sync Camel route
    └── RouteReplicateInitials.groovy      # Initials sync Camel route

Configuration

Copy the example configuration file and update with your values:

cp src/main/resources/application-prod.properties.example src/main/resources/application-prod.properties

Key Configuration Options

Property Description
spring.datasource.url SQL Server JDBC connection string
spring.datasource.username Database username
spring.datasource.password Database password
nomeco.vendor.companies Comma-separated company codes for vendor sync
nomeco.vendor.url SAP vendor web service URL
nomeco.vendor.token Bearer token for vendor API
nomeco.vendor.scheduler.cron Cron expression for vendor polling
nomeco.initials.companies Comma-separated company codes for initials sync
nomeco.initials.url SAP initials web service URL
nomeco.initials.token Bearer token for initials API
nomeco.initials.scheduler.cron Cron expression for initials polling

Cron Schedule Examples

# Every 5 minutes (development)
nomeco.vendor.scheduler.cron=* 0/5 * * * ?

# Every 2 hours between 6-18, Monday to Friday (production)
nomeco.vendor.scheduler.cron=0 0 6-18/2 ? * MON-FRI

Building

# Build the application
./gradlew build

# Build executable JAR
./gradlew bootJar

Running

# Run with production profile
java -jar build/libs/nomecointegration.jar --spring.profiles.active=prod

# Or using Gradle
./gradlew bootRun --args='--spring.profiles.active=prod'

Available Profiles

  • prod - Production configuration (port 8081)
  • qa - QA/Staging configuration (port 8082)
  • test - Test configuration (port 8083)

Database

The application uses Hibernate's ddl-auto=update to automatically create and update database tables. Two tables are created:

  • Vendors - Stores vendor master data
  • Initials - Stores route/initials data

API Authentication

The application authenticates to SAP web services using Bearer tokens configured in the properties file. Ensure tokens are kept secure and rotated according to your security policies.

License

Proprietary - BPA Solutions A/S

About

Spring Boot application that replicates vendor and route master data from SAP web services to SQL Server

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published