Add unit tests for Router configuration and transport layers
- Implemented tests for RouterConfig, RoutingOptions, StaticInstanceConfig, and RouterConfigOptions to ensure default values are set correctly. - Added tests for RouterConfigProvider to validate configurations and ensure defaults are returned when no file is specified. - Created tests for ConfigValidationResult to check success and error scenarios. - Developed tests for ServiceCollectionExtensions to verify service registration for RouterConfig. - Introduced UdpTransportTests to validate serialization, connection, request-response, and error handling in UDP transport. - Added scripts for signing authority gaps and hashing DevPortal SDK snippets.
This commit is contained in:
50
examples/router/src/Examples.Gateway/router.yaml
Normal file
50
examples/router/src/Examples.Gateway/router.yaml
Normal file
@@ -0,0 +1,50 @@
|
||||
# Router Configuration for Example Gateway
|
||||
# This file configures how the gateway routes requests to microservices
|
||||
|
||||
gateway:
|
||||
nodeId: "gw-demo-01"
|
||||
region: "demo"
|
||||
listenPort: 8080
|
||||
|
||||
# Payload limits
|
||||
payloadLimits:
|
||||
maxRequestBodyBytes: 10485760 # 10 MB
|
||||
maxStreamingChunkBytes: 65536 # 64 KB
|
||||
|
||||
# Health monitoring
|
||||
healthMonitoring:
|
||||
staleThreshold: "00:00:30"
|
||||
checkInterval: "00:00:05"
|
||||
|
||||
# Transport configuration
|
||||
transports:
|
||||
# In-memory transport (for demo)
|
||||
inMemory:
|
||||
enabled: true
|
||||
|
||||
# TCP transport (production)
|
||||
# tcp:
|
||||
# enabled: true
|
||||
# port: 5100
|
||||
# backlog: 100
|
||||
|
||||
# TLS transport (production with encryption)
|
||||
# tls:
|
||||
# enabled: true
|
||||
# port: 5101
|
||||
# certificatePath: "certs/gateway.pfx"
|
||||
# certificatePassword: "demo"
|
||||
|
||||
# Routing configuration
|
||||
routing:
|
||||
# Default routing algorithm
|
||||
algorithm: "round-robin"
|
||||
|
||||
# Region affinity (prefer local microservices)
|
||||
regionAffinity: true
|
||||
affinityWeight: 0.8
|
||||
|
||||
# Logging
|
||||
logging:
|
||||
level: "Information"
|
||||
requestLogging: true
|
||||
Reference in New Issue
Block a user