Troubleshooting Guide
This guide provides diagnostics and solutions for common issues with the Wow framework.
Frequently Asked Questions
1. Command Processing
Q: Command Processing Timeout
Symptom: Command sent but no response for a long time, eventually timeout.
Possible Causes:
- Message bus connection issues
- Command processor not properly registered
- Aggregate root loading failure
- Event store connection issues
Troubleshooting Steps:
// Check if command is received correctly
logging.level:
me.ahoo.wow.command: DEBUG
me.ahoo.wow.bus: DEBUGSolutions:
- Check Kafka/Redis connection configuration
- Confirm aggregate root class uses
@AggregateRootannotation - Verify EventStore connection status
- Increase command timeout
Q: Duplicate Command Execution
Symptom: Same command executed multiple times.
Possible Causes:
- Client retry
- Idempotency check not enabled
- Message bus duplicate delivery
Solution:
wow:
command:
idempotency:
enabled: true
bloom-filter:
ttl: PT60SQ: Command Validation Failure
Symptom: CommandValidationException exception.
Troubleshooting Steps:
- Check if command fields comply with validation rules
- Check JSR-303 validation annotation configuration
data class CreateOrder(
@field:NotBlank val customerId: String,
@field:Size(min = 1) val items: List<OrderItem>
)2. Event Processing
Q: Event Projection Delay
Symptom: After domain event is published, projection update is severely delayed.
Possible Causes:
- Consumer processing capacity insufficient
- Event backlog
- Projection processor blocking
Troubleshooting Steps:
# Enable projection processor logging
logging:
level:
me.ahoo.wow.projection: DEBUGSolutions:
- Increase consumer instance count
- Optimize projection processor performance
- Use
@Blockingannotation for blocking operations
@ProjectionProcessor
class OrderProjection {
@OnEvent
@Blocking
fun onOrderCreated(event: OrderCreated) {
// IO intensive operation
}
}Q: Event Processing Failure
Symptom: Event processing throws exception, event consumed repeatedly.
Solution:
- Configure retry strategy
- Use event compensation mechanism
@OnEvent
@Retry(maxRetries = 3)
fun onOrderCreated(event: OrderCreated) {
// Operation that may fail
}3. Event Sourcing
Q: Version Conflict Exception
Symptom: EventVersionConflictException exception.
Cause: Concurrent modification of the same aggregate root.
Solution:
- This is normal optimistic locking behavior
- Framework will automatically retry
- If frequent, consider optimizing business process
Q: Slow Aggregate Root Loading
Symptom: Aggregate root loading takes too long.
Possible Causes:
- Too many events
- Snapshots not enabled
- EventStore query performance issue
Solution:
wow:
eventsourcing:
snapshot:
enabled: true
strategy: VERSION_OFFSET
version-offset: 10Q: Snapshot Inconsistency
Symptom: Snapshot state is inconsistent with event replay result.
Possible Causes:
- Event sourcing method (
onSourcing) implementation error - State fields not properly updated
Troubleshooting Steps:
- Check all
onSourcingmethod implementations - Use test suite to verify event sourcing
class OrderSpec : AggregateSpec<Order, OrderState>({
on {
whenCommand(CreateOrder(...)) {
expectEventType(OrderCreated::class)
expectState {
// Verify state
}
}
}
})4. Connection Issues
Q: Kafka Connection Failure
Symptom: TimeoutException: Failed to update metadata
Solutions:
- Check
bootstrap-serversconfiguration - Verify network connectivity
- Confirm Kafka service status
wow:
kafka:
bootstrap-servers:
- kafka-0:9092
- kafka-1:9092Q: MongoDB Connection Timeout
Symptom: MongoTimeoutException
Solutions:
- Check MongoDB URI configuration
- Increase connection pool size
- Verify network latency
spring:
data:
mongodb:
uri: mongodb://localhost:27017/wow_db?connectTimeoutMS=5000&socketTimeoutMS=5000Q: Redis Connection Failure
Symptom: RedisConnectionFailureException
Solutions:
- Check Redis service status
- Verify password configuration
- Check network firewall
5. Configuration Issues
Q: Metadata Not Loaded
Symptom: AggregateMetadataException: Aggregate metadata not found
Possible Causes:
- wow-compiler not used
- Metadata file not generated
- Bounded context configuration error
Solution:
// build.gradle.kts
plugins {
id("com.google.devtools.ksp")
}
dependencies {
ksp("me.ahoo.wow:wow-compiler")
}Check generated metadata file: build/generated/ksp/main/resources/META-INF/wow/wow-metadata.json
Q: Bean Wiring Failure
Symptom: NoSuchBeanDefinitionException
Troubleshooting Steps:
- Check if dependencies are correctly imported
- Verify auto-configuration conditions
- Check
@ConditionalOnPropertyconfiguration
# Ensure basic configuration is correct
wow:
enabled: truePerformance Issue Diagnosis
Response Latency Analysis
# Enable detailed logging
logging:
level:
me.ahoo.wow: DEBUGMonitoring Metrics
The following metrics should be monitored:
| Metric | Description | Alert Threshold |
|---|---|---|
| Command processing latency | Time from command sent to processing complete | > 1s |
| Event projection latency | Time from event published to projection updated | > 5s |
| Aggregate root loading time | Time to load aggregate root from storage | > 500ms |
| Message queue backlog | Number of pending messages | > 10000 |
Performance Tuning Recommendations
- Enable LocalFirst Mode
wow:
command:
bus:
local-first:
enabled: true- Optimize Snapshot Strategy
wow:
eventsourcing:
snapshot:
strategy: VERSION_OFFSET
version-offset: 10- Adjust Connection Pool
spring:
data:
mongodb:
uri: mongodb://localhost:27017/wow_db?minPoolSize=10&maxPoolSize=100Log Analysis
Enable Debug Logging
logging:
level:
me.ahoo.wow: DEBUG
me.ahoo.wow.command: TRACE
me.ahoo.wow.eventsourcing: TRACE
me.ahoo.wow.projection: DEBUGKey Log Patterns
| Log Pattern | Description |
|---|---|
Command received | Command has been received |
Command processed | Command processing complete |
Event appended | Event has been appended |
Snapshot saved | Snapshot has been saved |
Projection updated | Projection has been updated |
Error Log Analysis
ERROR - EventVersionConflictException: version conflict for aggregate[order:order-001]Analysis: Version conflict due to concurrent writes, framework will automatically retry.
ERROR - DuplicateRequestIdException: duplicate request[req-001]Analysis: Idempotency check blocked duplicate request, this is normal behavior.
Debugging Tips
Local Debugging
- Use in-memory implementation for quick testing:
wow:
command:
bus:
type: in_memory
eventsourcing:
store:
storage: in_memory
snapshot:
storage: in_memory- Use test suite to verify business logic:
class OrderSpec : AggregateSpec<Order, OrderState>({
// Test cases
})Remote Debugging
- Enable JMX monitoring
- Use distributed tracing (OpenTelemetry)
wow:
opentelemetry:
enabled: trueGetting Help
If the above solutions cannot resolve your issue, please:
- Check GitHub Issues
- Submit a new Issue with:
- Wow framework version
- Complete error stack trace
- Related configuration
- Minimal reproducible example