Skip to Content
Configuration

Configuration

This document describes all configuration options available in Eventara.

Application Configuration

Configuration is managed through src/main/resources/application.properties.

Database Configuration

# Database Connection spring.datasource.url=jdbc:postgresql://localhost:5432/eventara spring.datasource.username=postgres spring.datasource.password=mysecretpassword spring.datasource.driver-class-name=org.postgresql.Driver # Hibernate/JPA spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect spring.jpa.hibernate.ddl-auto=none spring.jpa.show-sql=true spring.jpa.properties.hibernate.format_sql=true

Configuration Options

PropertyDescriptionDefaultProduction Value
spring.datasource.urlPostgreSQL connection URLlocalhost:5432/eventaraYour DB URL
spring.datasource.usernameDatabase usernamepostgresYour username
spring.datasource.passwordDatabase passwordmysecretpasswordSecure password
spring.jpa.show-sqlLog SQL statementstruefalse
spring.jpa.hibernate.ddl-autoSchema generationnonenone

Flyway Migration

# Flyway Configuration spring.flyway.enabled=true spring.flyway.locations=classpath:/db/migration
PropertyDescriptionDefault
spring.flyway.enabledEnable Flyway migrationstrue
spring.flyway.locationsMigration script locationclasspath:/db/migration

Kafka Configuration

# Kafka Bootstrap Servers spring.kafka.bootstrap-servers=${SPRING_KAFKA_BOOTSTRAP_SERVERS:localhost:9093} # Producer Configuration spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer spring.kafka.producer.acks=all spring.kafka.producer.retries=3 spring.kafka.producer.properties.linger.ms=10 spring.kafka.producer.properties.batch.size=16384 # Consumer Configuration spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer spring.kafka.consumer.value-deserializer=org.springframework.kafka.support.serializer.JsonDeserializer spring.kafka.consumer.auto-offset-reset=earliest spring.kafka.consumer.group-id=eventara-consumer-group spring.kafka.consumer.properties.spring.json.trusted.packages=*

Kafka Properties

Producer:

PropertyDescriptionDefaultNotes
acksAcknowledgment levelallall = wait for all replicas
retriesNumber of retries3Retry on transient failures
linger.msBatch delay10Wait 10ms to batch messages
batch.sizeBatch size in bytes1638416KB batch size

Consumer:

PropertyDescriptionDefaultNotes
auto-offset-resetOffset reset strategyearliestStart from beginning if no offset
group-idConsumer group IDeventara-consumer-groupShared across instances

Kafka Topics

# Topic Names eventara.kafka.topics.events-raw=eventara.events.raw eventara.kafka.topics.events-processed=eventara.events.processed
PropertyDescriptionDefault
eventara.kafka.topics.events-rawRaw events topiceventara.events.raw
eventara.kafka.topics.events-processedProcessed events topiceventara.events.processed

Application Properties

# Application Name spring.application.name=eventara-ingestion-service

Docker Compose Configuration

Service Ports

ServiceInternal PortExternal PortDescription
postgres54325432PostgreSQL database
zookeeper21812181Zookeeper coordination
kafka9092, 90939092, 9093Kafka broker
kafka-ui80808090Kafka UI
springboot80808080API server
dashboard51735173React dashboard

Environment Variables

PostgreSQL

postgres: environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: mysecretpassword POSTGRES_DB: eventara

Kafka

kafka: environment: KAFKA_BROKER_ID: 1 KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 KAFKA_LISTENERS: INTERNAL://0.0.0.0:9092,EXTERNAL://0.0.0.0:9093 KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:9092,EXTERNAL://localhost:9093 KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true" KAFKA_NUM_PARTITIONS: 3 KAFKA_DEFAULT_REPLICATION_FACTOR: 1 KAFKA_LOG_RETENTION_HOURS: 168 # 7 days

Dashboard Configuration

Environment Variables

Create eventara-dashboard/.env:

# API URL VITE_API_URL=http://localhost:8080 # WebSocket URL (optional, defaults to API URL) VITE_WS_URL=http://localhost:8080/ws

Vite Configuration

File: eventara-dashboard/vite.config.ts

import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; export default defineConfig({ plugins: [react()], server: { port: 5173, host: true, }, build: { outDir: 'dist', sourcemap: false, }, });

Logging Configuration

Log Levels

Add to application.properties:

# Root logger logging.level.root=INFO # Eventara packages logging.level.com.eventara=DEBUG # Spring Framework logging.level.org.springframework=INFO logging.level.org.springframework.kafka=WARN # Hibernate logging.level.org.hibernate.SQL=DEBUG logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE # Kafka logging.level.org.apache.kafka=WARN

Log Format

# Console output pattern logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} - %msg%n # File output logging.file.name=logs/eventara.log logging.file.max-size=10MB logging.file.max-history=30

Security Configuration

CORS

Currently configured in controllers:

@CrossOrigin(origins = "*") @RestController public class RuleController { // ... }

Production: Configure globally in application.properties:

# CORS Configuration spring.web.cors.allowed-origins=https://your-domain.com spring.web.cors.allowed-methods=GET,POST,PUT,DELETE,OPTIONS spring.web.cors.allowed-headers=* spring.web.cors.allow-credentials=true

Authentication

Current State: No authentication implemented.

Production Setup (Example):

# JWT Configuration eventara.jwt.secret=${JWT_SECRET} eventara.jwt.expiration=3600000 # 1 hour in ms # OAuth2 (if using) spring.security.oauth2.client.registration.google.client-id=${GOOGLE_CLIENT_ID} spring.security.oauth2.client.registration.google.client-secret=${GOOGLE_CLIENT_SECRET}

Performance Tuning

Connection Pool

Add to application.properties:

# HikariCP Configuration spring.datasource.hikari.maximum-pool-size=20 spring.datasource.hikari.minimum-idle=5 spring.datasource.hikari.connection-timeout=30000 spring.datasource.hikari.idle-timeout=600000 spring.datasource.hikari.max-lifetime=1800000

JVM Options

Set via environment variable or command line:

# Memory -Xms512m # Initial heap size -Xmx2g # Maximum heap size # Garbage Collection -XX:+UseG1GC # Use G1 garbage collector -XX:MaxGCPauseMillis=200 # Target max GC pause time # Other -XX:+HeapDumpOnOutOfMemoryError # Dump heap on OOM -XX:HeapDumpPath=/tmp/heapdump.hprof

Kafka Performance

# Producer throughput spring.kafka.producer.properties.compression.type=snappy spring.kafka.producer.properties.max.in.flight.requests.per.connection=5 # Consumer throughput spring.kafka.consumer.properties.fetch.min.bytes=1 spring.kafka.consumer.properties.fetch.max.wait.ms=500 spring.kafka.consumer.properties.max.partition.fetch.bytes=1048576

Metrics Configuration

Actuator (Optional)

To expose Spring Boot Actuator endpoints:

<!-- Add to pom.xml --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
# Actuator Configuration management.endpoints.web.exposure.include=health,metrics,info management.endpoint.health.show-details=always management.metrics.export.prometheus.enabled=true

Configuration Profiles

Development Profile

Create application-dev.properties:

# Show SQL spring.jpa.show-sql=true spring.jpa.properties.hibernate.format_sql=true # Debug logging logging.level.com.eventara=DEBUG # Local Kafka spring.kafka.bootstrap-servers=localhost:9093

Activate:

java -jar app.jar --spring.profiles.active=dev

Production Profile

Create application-prod.properties:

# Disable SQL logging spring.jpa.show-sql=false # Production logging logging.level.root=WARN logging.level.com.eventara=INFO # Production Kafka spring.kafka.bootstrap-servers=${KAFKA_SERVERS}

Activate:

java -jar app.jar --spring.profiles.active=prod

Environment Variable Override

All properties can be overridden with environment variables:

# Property: spring.datasource.password # Environment variable: SPRING_DATASOURCE_PASSWORD export SPRING_DATASOURCE_PASSWORD=secure_password export SPRING_KAFKA_BOOTSTRAP_SERVERS=kafka1:9092,kafka2:9092,kafka3:9092 java -jar eventara.jar

Docker Compose:

springboot: environment: SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD} SPRING_KAFKA_BOOTSTRAP_SERVERS: kafka1:9092,kafka2:9092

Validation

Check Configuration

# View active configuration curl http://localhost:8080/actuator/env # View specific property curl http://localhost:8080/actuator/env/spring.datasource.url

Test Connections

# Test database connection docker exec springboot psql -h postgres -U postgres -d eventara -c "SELECT 1" # Test Kafka connection docker exec springboot kafka-broker-api-versions --bootstrap-server kafka:9092

Configuration Best Practices

  1. Use Environment Variables: Don’t hardcode secrets
  2. Profile-Specific Configs: Separate dev/prod configurations
  3. Connection Pooling: Configure appropriately for load
  4. Logging Levels: Debug in dev, WARN in prod
  5. Monitor Metrics: Enable actuator in production
  6. Security: Never commit passwords to version control
  7. Backup Configs: Keep configuration backups
  8. Document Changes: Track configuration changes

Default Values Reference

Quick reference of all default values:

# Database spring.datasource.url=jdbc:postgresql://localhost:5432/eventara spring.datasource.username=postgres spring.datasource.password=mysecretpassword # Kafka spring.kafka.bootstrap-servers=localhost:9093 spring.kafka.producer.acks=all spring.kafka.consumer.group-id=eventara-consumer-group # Topics eventara.kafka.topics.events-raw=eventara.events.raw # Application spring.application.name=eventara-ingestion-service server.port=8080 # Dashboard VITE_API_URL=http://localhost:8080
Last updated on