Application Identity
Application Name
Every service must define its application name, which is used for service discovery and identification:Unique identifier for the service in the microservices ecosystem. Used by Eureka for service registration and discovery.
The application name should follow the
sgivu-{service} naming convention for consistency across the platform.Server Configuration
Port Configuration
Services use environment-driven port configuration with sensible defaults:The HTTP port the service listens on. Uses the
PORT environment variable with service-specific defaults.Auth Service
Default:
9000Gateway Service
Default:
8080User Service
Default:
8081Client Service
Default:
8082Vehicle Service
Default:
8083Purchase-Sale Service
Default:
8084Discovery Service
Default:
8761Forward Headers Strategy
Services behind proxies use the forward headers strategy to properly handle proxy headers:Configures how the server handles forwarded headers (X-Forwarded-*). Set to
framework to let Spring handle them automatically.This setting is critical for services behind the gateway or load balancers to correctly identify client IP addresses and original request URLs.
JPA Configuration
Open In View
All data-access services disable the Open Session In View pattern:Controls whether JPA sessions remain open during view rendering. Set to
false in all SGIVU services to prevent lazy loading issues and improve performance.JPA Properties (Profile-Specific)
Development environments enable SQL logging:Session Management
Session Store Types
SGIVU uses two session storage strategies depending on service requirements:Redis Sessions (Stateless Services)
The Gateway uses Redis for distributed session management:Session storage mechanism. Use
redis for distributed sessions across gateway instances.Redis key prefix for session data. Prevents key collisions when multiple services share the same Redis instance.
JDBC Sessions (Stateful Services)
The Auth Service uses database-backed sessions:Controls session table creation. Set to
never since Flyway manages the schema.Cron expression for expired session cleanup. Runs every 15 minutes by default.
Session Storage Decision Guide
Session Storage Decision Guide
Use Redis when:
- Service requires horizontal scaling
- Sessions are lightweight and temporary
- Service is stateless (like the gateway)
- Service already has database access
- Sessions contain critical data
- Service requires session persistence across restarts
API Documentation (SpringDoc)
All services use SpringDoc OpenAPI 3 with centralized documentation routing:Location of the OpenAPI JSON specification for this service.
Location of the Swagger UI configuration.
Service-Specific Configurations
All API documentation is accessible through the gateway at
/docs/{service}/v3/api-docs. This provides a centralized location for API exploration.Related Configuration
Eureka Settings
Service discovery and registration configuration
Database Config
Database connection and migration settings
Observability
Monitoring, tracing, and logging configuration
Environment Variables
Required and optional environment variables