diff --git a/FlinkDotNet/FlinkDotNet.JobGateway/Properties/launchSettings.json b/FlinkDotNet/FlinkDotNet.JobGateway/Properties/launchSettings.json index 05958479..0ed12ad6 100644 --- a/FlinkDotNet/FlinkDotNet.JobGateway/Properties/launchSettings.json +++ b/FlinkDotNet/FlinkDotNet.JobGateway/Properties/launchSettings.json @@ -6,7 +6,7 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "http://localhost:61388" + "applicationUrl": "http://localhost:8086" } } } diff --git a/FlinkDotNet/FlinkDotNet.JobGateway/appsettings.json b/FlinkDotNet/FlinkDotNet.JobGateway/appsettings.json index 1aba68e6..86798d88 100644 --- a/FlinkDotNet/FlinkDotNet.JobGateway/appsettings.json +++ b/FlinkDotNet/FlinkDotNet.JobGateway/appsettings.json @@ -16,7 +16,7 @@ } }, "FlinkJobGateway": { - "BaseUrl": "http://localhost:8080/", + "BaseUrl": "http://localhost:8086/", "HttpTimeout": "00:05:00", "MaxRetries": 3, "RetryDelay": "00:00:01", diff --git a/LearningCourse/Day01-Kafka-Flink-Data-Pipeline/Exercise-Solutions/Exercise1-StringCapitalize/Program.cs b/LearningCourse/Day01-Kafka-Flink-Data-Pipeline/Exercise-Solutions/Exercise1-StringCapitalize/Program.cs index e4ae477e..d1b9afc1 100644 --- a/LearningCourse/Day01-Kafka-Flink-Data-Pipeline/Exercise-Solutions/Exercise1-StringCapitalize/Program.cs +++ b/LearningCourse/Day01-Kafka-Flink-Data-Pipeline/Exercise-Solutions/Exercise1-StringCapitalize/Program.cs @@ -39,7 +39,7 @@ static class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; private static string FlinkJobManagerUrl => Environment.GetEnvironmentVariable("FLINK_JOBMANAGER_URL") ?? "http://localhost:8081"; @@ -677,7 +677,7 @@ static async Task WaitForFlinkHealthyAsync() try { using var httpClient = new System.Net.Http.HttpClient { Timeout = TimeSpan.FromSeconds(2) }; - var response = await httpClient.GetAsync($"{FlinkJobManagerUrl}/api/v1/health"); + var response = await httpClient.GetAsync($"{FlinkJobManagerUrl}/v1/overview"); if (response.IsSuccessStatusCode) { diff --git a/LearningCourse/Day01-Kafka-Flink-Data-Pipeline/Exercise-Solutions/Exercise2-BackupAggregator/Program.cs b/LearningCourse/Day01-Kafka-Flink-Data-Pipeline/Exercise-Solutions/Exercise2-BackupAggregator/Program.cs index ab47a272..c525302e 100644 --- a/LearningCourse/Day01-Kafka-Flink-Data-Pipeline/Exercise-Solutions/Exercise2-BackupAggregator/Program.cs +++ b/LearningCourse/Day01-Kafka-Flink-Data-Pipeline/Exercise-Solutions/Exercise2-BackupAggregator/Program.cs @@ -32,7 +32,7 @@ static class Program // Flink Gateway configuration // Lazy evaluation - reads env var when first accessed, not at class load time private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; private static string FlinkJobManagerUrl => Environment.GetEnvironmentVariable("FLINK_JOBMANAGER_URL") ?? "http://localhost:8081"; @@ -680,7 +680,7 @@ static async Task WaitForFlinkHealthyAsync() try { using var httpClient = new System.Net.Http.HttpClient { Timeout = TimeSpan.FromSeconds(3) }; - var response = await httpClient.GetAsync($"{FlinkJobManagerUrl}/api/v1/health"); + var response = await httpClient.GetAsync($"{FlinkJobManagerUrl}/v1/overview"); if (response.IsSuccessStatusCode) { diff --git a/LearningCourse/Day03-AI-Stream-Processing/Exercise-Solutions/Exercise31/Program.cs b/LearningCourse/Day03-AI-Stream-Processing/Exercise-Solutions/Exercise31/Program.cs index 7cd48e9c..e028f4e0 100644 --- a/LearningCourse/Day03-AI-Stream-Processing/Exercise-Solutions/Exercise31/Program.cs +++ b/LearningCourse/Day03-AI-Stream-Processing/Exercise-Solutions/Exercise31/Program.cs @@ -26,7 +26,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; private const string RegistrationTopic = "ai-model-registrations"; private const string ValidationTopic = "ai-model-validations"; diff --git a/LearningCourse/Day03-AI-Stream-Processing/Exercise-Solutions/Exercise32/Program.cs b/LearningCourse/Day03-AI-Stream-Processing/Exercise-Solutions/Exercise32/Program.cs index 2faf40ab..0d8e14ae 100644 --- a/LearningCourse/Day03-AI-Stream-Processing/Exercise-Solutions/Exercise32/Program.cs +++ b/LearningCourse/Day03-AI-Stream-Processing/Exercise-Solutions/Exercise32/Program.cs @@ -29,7 +29,7 @@ public class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; public static async Task Main(string[] args) { diff --git a/LearningCourse/Day03-AI-Stream-Processing/Exercise-Solutions/Exercise33/Program.cs b/LearningCourse/Day03-AI-Stream-Processing/Exercise-Solutions/Exercise33/Program.cs index 540a4ea1..3d7b648e 100644 --- a/LearningCourse/Day03-AI-Stream-Processing/Exercise-Solutions/Exercise33/Program.cs +++ b/LearningCourse/Day03-AI-Stream-Processing/Exercise-Solutions/Exercise33/Program.cs @@ -33,7 +33,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; private const string InputTopic = "fraud-transactions-input"; private const string PredictionsTopic = "fraud-model-predictions"; diff --git a/LearningCourse/Day03-AI-Stream-Processing/Exercise-Solutions/Exercise34/Program.cs b/LearningCourse/Day03-AI-Stream-Processing/Exercise-Solutions/Exercise34/Program.cs index 6dbbf1e1..a63e0ab8 100644 --- a/LearningCourse/Day03-AI-Stream-Processing/Exercise-Solutions/Exercise34/Program.cs +++ b/LearningCourse/Day03-AI-Stream-Processing/Exercise-Solutions/Exercise34/Program.cs @@ -32,7 +32,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; private const string InputTopic = "mlnet-transactions-input"; private const string OutputTopic = "mlnet-fraud-predictions-output"; diff --git a/LearningCourse/Day04-Production-Backpressure/Exercise-Solutions/Exercise41/Program.cs b/LearningCourse/Day04-Production-Backpressure/Exercise-Solutions/Exercise41/Program.cs index 5d3f96be..50d6bf64 100644 --- a/LearningCourse/Day04-Production-Backpressure/Exercise-Solutions/Exercise41/Program.cs +++ b/LearningCourse/Day04-Production-Backpressure/Exercise-Solutions/Exercise41/Program.cs @@ -32,7 +32,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; private const string InputTopic = "streaming-requests-input"; private const string OutputTopic = "streaming-sessions-output"; diff --git a/LearningCourse/Day04-Production-Backpressure/Exercise-Solutions/Exercise42/Program.cs b/LearningCourse/Day04-Production-Backpressure/Exercise-Solutions/Exercise42/Program.cs index 4bed7cee..48840b41 100644 --- a/LearningCourse/Day04-Production-Backpressure/Exercise-Solutions/Exercise42/Program.cs +++ b/LearningCourse/Day04-Production-Backpressure/Exercise-Solutions/Exercise42/Program.cs @@ -32,7 +32,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics for multi-tier pipeline private const string ClientRequestsTopic = "client-requests-input"; diff --git a/LearningCourse/Day04-Production-Backpressure/Exercise-Solutions/Exercise43/Program.cs b/LearningCourse/Day04-Production-Backpressure/Exercise-Solutions/Exercise43/Program.cs index f33e6cdd..a29349b4 100644 --- a/LearningCourse/Day04-Production-Backpressure/Exercise-Solutions/Exercise43/Program.cs +++ b/LearningCourse/Day04-Production-Backpressure/Exercise-Solutions/Exercise43/Program.cs @@ -30,7 +30,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; private const string LoadInputTopic = "performance-load-input"; private const string LatencyMeasurementsTopic = "performance-latency-measurements"; diff --git a/LearningCourse/Day04-Production-Backpressure/Exercise-Solutions/Exercise45/Program.cs b/LearningCourse/Day04-Production-Backpressure/Exercise-Solutions/Exercise45/Program.cs index 2acbf04f..2434ebc0 100644 --- a/LearningCourse/Day04-Production-Backpressure/Exercise-Solutions/Exercise45/Program.cs +++ b/LearningCourse/Day04-Production-Backpressure/Exercise-Solutions/Exercise45/Program.cs @@ -30,7 +30,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; private const string InputTopic = "backpressure-input"; private const string OutputTopic = "backpressure-output"; diff --git a/LearningCourse/Day05-Enterprise-Observability/Exercise-Solutions/Exercise51/Program.cs b/LearningCourse/Day05-Enterprise-Observability/Exercise-Solutions/Exercise51/Program.cs index a39f9f9c..72dde4e5 100644 --- a/LearningCourse/Day05-Enterprise-Observability/Exercise-Solutions/Exercise51/Program.cs +++ b/LearningCourse/Day05-Enterprise-Observability/Exercise-Solutions/Exercise51/Program.cs @@ -35,7 +35,7 @@ static class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; static async Task Main(string[] args) { diff --git a/LearningCourse/Day07-Advanced-Windows-Joins/Exercise-Solutions/Exercise71/Program.cs b/LearningCourse/Day07-Advanced-Windows-Joins/Exercise-Solutions/Exercise71/Program.cs index fe0bdd8b..f04cd156 100644 --- a/LearningCourse/Day07-Advanced-Windows-Joins/Exercise-Solutions/Exercise71/Program.cs +++ b/LearningCourse/Day07-Advanced-Windows-Joins/Exercise-Solutions/Exercise71/Program.cs @@ -29,7 +29,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics for multi-stream join private const string OrdersTopic = "orders"; diff --git a/LearningCourse/Day07-Advanced-Windows-Joins/Exercise-Solutions/Exercise72/Program.cs b/LearningCourse/Day07-Advanced-Windows-Joins/Exercise-Solutions/Exercise72/Program.cs index 6780d60e..f8c64f5c 100644 --- a/LearningCourse/Day07-Advanced-Windows-Joins/Exercise-Solutions/Exercise72/Program.cs +++ b/LearningCourse/Day07-Advanced-Windows-Joins/Exercise-Solutions/Exercise72/Program.cs @@ -30,7 +30,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics private const string TransactionsTopic = "fraud-transactions"; diff --git a/LearningCourse/Day07-Advanced-Windows-Joins/Exercise-Solutions/Exercise73/Program.cs b/LearningCourse/Day07-Advanced-Windows-Joins/Exercise-Solutions/Exercise73/Program.cs index 11d56780..e7e7abd3 100644 --- a/LearningCourse/Day07-Advanced-Windows-Joins/Exercise-Solutions/Exercise73/Program.cs +++ b/LearningCourse/Day07-Advanced-Windows-Joins/Exercise-Solutions/Exercise73/Program.cs @@ -30,7 +30,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics for IoT sensors private const string TemperatureTopic = "sensor-temperature"; diff --git a/LearningCourse/Day07-Advanced-Windows-Joins/Exercise-Solutions/Exercise74/Program.cs b/LearningCourse/Day07-Advanced-Windows-Joins/Exercise-Solutions/Exercise74/Program.cs index bb5e031e..d7f1361f 100644 --- a/LearningCourse/Day07-Advanced-Windows-Joins/Exercise-Solutions/Exercise74/Program.cs +++ b/LearningCourse/Day07-Advanced-Windows-Joins/Exercise-Solutions/Exercise74/Program.cs @@ -30,7 +30,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics for windowing optimization demonstration private const string EventStreamTopic = "high-volume-events"; diff --git a/LearningCourse/Day08-Stress-Testing/Exercise-Solutions/Exercise81/Program.cs b/LearningCourse/Day08-Stress-Testing/Exercise-Solutions/Exercise81/Program.cs index 105813e5..9262585c 100644 --- a/LearningCourse/Day08-Stress-Testing/Exercise-Solutions/Exercise81/Program.cs +++ b/LearningCourse/Day08-Stress-Testing/Exercise-Solutions/Exercise81/Program.cs @@ -28,7 +28,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics for stress testing private const string StressTestTopic = "stress-test-events"; diff --git a/LearningCourse/Day08-Stress-Testing/Exercise-Solutions/Exercise82/Program.cs b/LearningCourse/Day08-Stress-Testing/Exercise-Solutions/Exercise82/Program.cs index b41602f8..26ac71e1 100644 --- a/LearningCourse/Day08-Stress-Testing/Exercise-Solutions/Exercise82/Program.cs +++ b/LearningCourse/Day08-Stress-Testing/Exercise-Solutions/Exercise82/Program.cs @@ -28,7 +28,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics for backpressure testing private const string InputTopic = "backpressure-input"; diff --git a/LearningCourse/Day08-Stress-Testing/Exercise-Solutions/Exercise83/Program.cs b/LearningCourse/Day08-Stress-Testing/Exercise-Solutions/Exercise83/Program.cs index 211cfea1..18a12d41 100644 --- a/LearningCourse/Day08-Stress-Testing/Exercise-Solutions/Exercise83/Program.cs +++ b/LearningCourse/Day08-Stress-Testing/Exercise-Solutions/Exercise83/Program.cs @@ -28,7 +28,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics for benchmarking private const string BenchmarkInputTopic = "benchmark-input"; diff --git a/LearningCourse/Day08-Stress-Testing/Exercise-Solutions/Exercise84/Program.cs b/LearningCourse/Day08-Stress-Testing/Exercise-Solutions/Exercise84/Program.cs index c3a1e88d..006b3792 100644 --- a/LearningCourse/Day08-Stress-Testing/Exercise-Solutions/Exercise84/Program.cs +++ b/LearningCourse/Day08-Stress-Testing/Exercise-Solutions/Exercise84/Program.cs @@ -28,7 +28,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics for resource monitoring private const string ResourceInputTopic = "resource-monitor-input"; diff --git a/LearningCourse/Day09-Exactly-Once-Semantics/Exercise-Solutions/Exercise91/Program.cs b/LearningCourse/Day09-Exactly-Once-Semantics/Exercise-Solutions/Exercise91/Program.cs index 7fdc5f1e..18caf131 100644 --- a/LearningCourse/Day09-Exactly-Once-Semantics/Exercise-Solutions/Exercise91/Program.cs +++ b/LearningCourse/Day09-Exactly-Once-Semantics/Exercise-Solutions/Exercise91/Program.cs @@ -29,7 +29,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics for banking transactions private const string PaymentTransactionsTopic = "payment-transactions"; diff --git a/LearningCourse/Day09-Exactly-Once-Semantics/Exercise-Solutions/Exercise92/Program.cs b/LearningCourse/Day09-Exactly-Once-Semantics/Exercise-Solutions/Exercise92/Program.cs index d31903ac..067c2b5f 100644 --- a/LearningCourse/Day09-Exactly-Once-Semantics/Exercise-Solutions/Exercise92/Program.cs +++ b/LearningCourse/Day09-Exactly-Once-Semantics/Exercise-Solutions/Exercise92/Program.cs @@ -29,7 +29,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics for e-commerce order processing private const string OrdersTopic = "ecommerce-orders"; diff --git a/LearningCourse/Day09-Exactly-Once-Semantics/Exercise-Solutions/Exercise93/Program.cs b/LearningCourse/Day09-Exactly-Once-Semantics/Exercise-Solutions/Exercise93/Program.cs index a93a953a..5322ec1c 100644 --- a/LearningCourse/Day09-Exactly-Once-Semantics/Exercise-Solutions/Exercise93/Program.cs +++ b/LearningCourse/Day09-Exactly-Once-Semantics/Exercise-Solutions/Exercise93/Program.cs @@ -29,7 +29,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics for real-time analytics private const string EventStreamTopic = "analytics-events"; diff --git a/LearningCourse/Day09-Exactly-Once-Semantics/Exercise-Solutions/Exercise94/Program.cs b/LearningCourse/Day09-Exactly-Once-Semantics/Exercise-Solutions/Exercise94/Program.cs index cf42669f..b2cc259d 100644 --- a/LearningCourse/Day09-Exactly-Once-Semantics/Exercise-Solutions/Exercise94/Program.cs +++ b/LearningCourse/Day09-Exactly-Once-Semantics/Exercise-Solutions/Exercise94/Program.cs @@ -29,7 +29,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics for advanced patterns private const string HighVolumeTopic = "high-volume-events"; diff --git a/LearningCourse/Day10-Performance-Optimization-Scaling/Exercise-Solutions/Exercise101/Program.cs b/LearningCourse/Day10-Performance-Optimization-Scaling/Exercise-Solutions/Exercise101/Program.cs index f31ff65b..7eed97bd 100644 --- a/LearningCourse/Day10-Performance-Optimization-Scaling/Exercise-Solutions/Exercise101/Program.cs +++ b/LearningCourse/Day10-Performance-Optimization-Scaling/Exercise-Solutions/Exercise101/Program.cs @@ -26,7 +26,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics private const string InputTopic = "resource-optimization-input"; diff --git a/LearningCourse/Day10-Performance-Optimization-Scaling/Exercise-Solutions/Exercise102/Program.cs b/LearningCourse/Day10-Performance-Optimization-Scaling/Exercise-Solutions/Exercise102/Program.cs index 1ebe6beb..1de49b1c 100644 --- a/LearningCourse/Day10-Performance-Optimization-Scaling/Exercise-Solutions/Exercise102/Program.cs +++ b/LearningCourse/Day10-Performance-Optimization-Scaling/Exercise-Solutions/Exercise102/Program.cs @@ -27,7 +27,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics - 8 partitions for load distribution testing private const string InputTopic = "horizontal-scaling-input"; diff --git a/LearningCourse/Day13-Advanced-Streaming-Patterns/Exercise-Solutions/Exercise131/Program.cs b/LearningCourse/Day13-Advanced-Streaming-Patterns/Exercise-Solutions/Exercise131/Program.cs index 3c3198eb..a257252b 100644 --- a/LearningCourse/Day13-Advanced-Streaming-Patterns/Exercise-Solutions/Exercise131/Program.cs +++ b/LearningCourse/Day13-Advanced-Streaming-Patterns/Exercise-Solutions/Exercise131/Program.cs @@ -29,7 +29,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics for event sourcing private const string CommandsTopic = "order-commands"; diff --git a/LearningCourse/Day13-Advanced-Streaming-Patterns/Exercise-Solutions/Exercise132/Program.cs b/LearningCourse/Day13-Advanced-Streaming-Patterns/Exercise-Solutions/Exercise132/Program.cs index c48b5b9f..17aaf3d3 100644 --- a/LearningCourse/Day13-Advanced-Streaming-Patterns/Exercise-Solutions/Exercise132/Program.cs +++ b/LearningCourse/Day13-Advanced-Streaming-Patterns/Exercise-Solutions/Exercise132/Program.cs @@ -30,7 +30,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics for CQRS pattern private const string CommandsTopic = "banking-commands"; diff --git a/LearningCourse/Day13-Advanced-Streaming-Patterns/Exercise-Solutions/Exercise133/Program.cs b/LearningCourse/Day13-Advanced-Streaming-Patterns/Exercise-Solutions/Exercise133/Program.cs index e8dd8a6e..2ac0e0c3 100644 --- a/LearningCourse/Day13-Advanced-Streaming-Patterns/Exercise-Solutions/Exercise133/Program.cs +++ b/LearningCourse/Day13-Advanced-Streaming-Patterns/Exercise-Solutions/Exercise133/Program.cs @@ -30,7 +30,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics for saga pattern private const string SagaCommandsTopic = "saga-commands"; diff --git a/LearningCourse/Day13-Advanced-Streaming-Patterns/Exercise-Solutions/Exercise134/Program.cs b/LearningCourse/Day13-Advanced-Streaming-Patterns/Exercise-Solutions/Exercise134/Program.cs index 62f10f80..391469b0 100644 --- a/LearningCourse/Day13-Advanced-Streaming-Patterns/Exercise-Solutions/Exercise134/Program.cs +++ b/LearningCourse/Day13-Advanced-Streaming-Patterns/Exercise-Solutions/Exercise134/Program.cs @@ -30,7 +30,7 @@ class Program Environment.GetEnvironmentVariable("KAFKA_FLINK_BOOTSTRAP_SERVERS") ?? "kafka:9092"; private static string FlinkGatewayUrl => - Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; // Kafka topics for CEP pattern private const string SecurityEventsTopic = "security-events"; diff --git a/LearningCourse/Day15-Capstone-Project/Exercise-Solutions/Exercise151/Program.cs b/LearningCourse/Day15-Capstone-Project/Exercise-Solutions/Exercise151/Program.cs index ab0e796d..f2144ca3 100644 --- a/LearningCourse/Day15-Capstone-Project/Exercise-Solutions/Exercise151/Program.cs +++ b/LearningCourse/Day15-Capstone-Project/Exercise-Solutions/Exercise151/Program.cs @@ -6,7 +6,7 @@ // Environment variables for service discovery (set by test infrastructure) var kafkaBootstrapServers = Environment.GetEnvironmentVariable("KAFKA_BOOTSTRAP_SERVERS") ?? "localhost:9093"; -var flinkGatewayUrl = Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; +var flinkGatewayUrl = Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; var redisConnectionString = Environment.GetEnvironmentVariable("REDIS_ENDPOINT") ?? "localhost:6379"; Log.Logger = new LoggerConfiguration() diff --git a/LearningCourse/Day15-Capstone-Project/Exercise-Solutions/Exercise154/Program.cs b/LearningCourse/Day15-Capstone-Project/Exercise-Solutions/Exercise154/Program.cs index dd4d8086..dbc75ba7 100644 --- a/LearningCourse/Day15-Capstone-Project/Exercise-Solutions/Exercise154/Program.cs +++ b/LearningCourse/Day15-Capstone-Project/Exercise-Solutions/Exercise154/Program.cs @@ -7,7 +7,7 @@ // Environment variables for service discovery var kafkaBootstrapServers = Environment.GetEnvironmentVariable("KAFKA_BOOTSTRAP_SERVERS") ?? "localhost:9093"; -var flinkGatewayUrl = Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; +var flinkGatewayUrl = Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; var redisConnectionString = Environment.GetEnvironmentVariable("REDIS_ENDPOINT") ?? "localhost:6379"; Log.Logger = new LoggerConfiguration() diff --git a/LearningCourse/LearningCourse.Common/AspireServiceDiscovery.cs b/LearningCourse/LearningCourse.Common/AspireServiceDiscovery.cs index c26d7d8b..0c2e9eec 100644 --- a/LearningCourse/LearningCourse.Common/AspireServiceDiscovery.cs +++ b/LearningCourse/LearningCourse.Common/AspireServiceDiscovery.cs @@ -102,7 +102,7 @@ public static string GetFlinkGatewayUrl() return envValue; } - // Flink Gateway typically uses fixed port 8080 - return "http://localhost:8080"; + // Flink Gateway typically uses fixed port 8086 + return "http://localhost:8086"; } } \ No newline at end of file diff --git a/LearningCourse/LearningCourse.Common/DockerInfrastructure.cs b/LearningCourse/LearningCourse.Common/DockerInfrastructure.cs index f87dc1e2..ed1c4d30 100644 --- a/LearningCourse/LearningCourse.Common/DockerInfrastructure.cs +++ b/LearningCourse/LearningCourse.Common/DockerInfrastructure.cs @@ -9,11 +9,11 @@ namespace LearningCourse.Common; public static class DockerInfrastructure { /// - /// Discovers the Kafka container IP address for Flink job configurations. - /// Docker's default bridge network doesn't support DNS between containers, - /// so we need to use the actual container IP address. + /// Discovers the Kafka bootstrap servers for Flink job configurations. + /// In Aspire-managed containers, uses DNS name (kafka:9093) for container-to-container communication. + /// Aspire creates a Docker network with DNS support, so containers can use service names. /// - /// Kafka container IP with port (e.g., "172.17.0.2:9093") + /// Kafka bootstrap servers for Flink (e.g., "kafka:9093") public static async Task GetKafkaContainerIpAsync() { try @@ -26,39 +26,17 @@ public static async Task GetKafkaContainerIpAsync() throw new InvalidOperationException("Kafka container not found"); } - // Try Docker bridge network first - var ipAddress = await RunDockerCommandAsync($"inspect {kafkaContainer} --format \"{{{{.NetworkSettings.Networks.bridge.IPAddress}}}}\""); - var ip = ipAddress.Trim(); + Console.WriteLine($"✅ Kafka container found: {kafkaContainer}"); - // If bridge network doesn't have IP, try podman network (for Podman runtime) - if (string.IsNullOrWhiteSpace(ip) || ip == "") - { - Console.WriteLine($"🔍 Bridge network IP not found, trying podman network..."); - ipAddress = await RunDockerCommandAsync($"inspect {kafkaContainer} --format \"{{{{.NetworkSettings.Networks.podman.IPAddress}}}}\""); - ip = ipAddress.Trim(); - } - - if (string.IsNullOrWhiteSpace(ip) || ip == "") - { - // Fallback: Get the first available network IP - Console.WriteLine($"🔍 Specific network not found, getting first available IP..."); - ipAddress = await RunDockerCommandAsync($"inspect {kafkaContainer} --format \"{{{{range .NetworkSettings.Networks}}}}{{{{.IPAddress}}}}{{{{end}}}}\""); - ip = ipAddress.Trim(); - } - - if (string.IsNullOrWhiteSpace(ip) || ip == "") - { - throw new InvalidOperationException($"Could not determine Kafka container IP from any network. Container: {kafkaContainer}"); - } - - Console.WriteLine($"✅ Kafka container IP discovered: {ip}"); - - // Return IP with PLAINTEXT_INTERNAL port (9093) - return $"{ip}:9093"; + // CRITICAL: In Aspire-managed Docker networks, containers support DNS resolution + // Flink containers can access Kafka using the service name "kafka" instead of IP + // This works because all Aspire containers are on the same Docker network + // Port 9093 is used for container-to-container communication (PLAINTEXT_INTERNAL) + return "kafka:9093"; } catch (Exception ex) { - throw new InvalidOperationException($"Failed to get Kafka container IP: {ex.Message}", ex); + throw new InvalidOperationException($"Failed to get Kafka bootstrap servers: {ex.Message}", ex); } } diff --git a/LearningCourse/LearningCourse.IntegrationTests/Day01Tests.cs b/LearningCourse/LearningCourse.IntegrationTests/Day01Tests.cs index 155f0c75..e39ae329 100644 --- a/LearningCourse/LearningCourse.IntegrationTests/Day01Tests.cs +++ b/LearningCourse/LearningCourse.IntegrationTests/Day01Tests.cs @@ -268,6 +268,12 @@ private static void FailWithDeserializationError() private static Dictionary BuildExercise2ValidationChecks(string output) { + // Check that we actually consumed backups (not just 0) + bool backupsConsumed = !output.Contains("Consumed 0 backup") && + (output.Contains("Successfully aggregated") || + output.Contains("window fired") || + (output.Contains("Consumed") && output.Contains("backup") && !output.Contains("[ERROR] No backups consumed"))); + return new Dictionary { ["Kafka Ready"] = (output.Contains("Kafka is ready") || output.Contains("Verifying Kafka"), "Kafka is not ready"), @@ -276,7 +282,7 @@ private static void FailWithDeserializationError() ["EventTime Used"] = (output.Contains("EventTime") || output.Contains("timestamped"), "EventTime was not used"), ["Time Windows"] = (output.Contains("Time windows") || output.Contains("TimeWindowAll") || output.Contains("24 hours") || output.Contains("time-based") || output.Contains("Time.Hours(24)"), "Time-based windows were not configured"), ["InputMessages Produced"] = (output.Contains("Producing") && output.Contains("InputMessage") || output.Contains("All 50 InputMessage objects produced"), "InputMessage objects were not produced"), - ["Backups Consumed"] = (output.Contains("Consumed") && output.Contains("Backup") || output.Contains("Successfully aggregated") || output.Contains("window fired"), "Should consume aggregated backups with time window"), + ["Backups Consumed"] = (backupsConsumed, "No backups were consumed - aggregation failed to produce output"), ["Job Running"] = (output.Contains("Job is running") || output.Contains("job submitted") || output.Contains("Flink") || output.Contains("SUCCESS"), "Job should be running in Flink") }; } diff --git a/LearningCourse/LearningCourse.IntegrationTests/Day05Tests.cs b/LearningCourse/LearningCourse.IntegrationTests/Day05Tests.cs index 6b44601c..4bbd365e 100644 --- a/LearningCourse/LearningCourse.IntegrationTests/Day05Tests.cs +++ b/LearningCourse/LearningCourse.IntegrationTests/Day05Tests.cs @@ -88,7 +88,7 @@ public async Task PrometheusExporters_ShouldExposeMetrics() Assert.Fail("Prometheus endpoint not available. Ensure LEARNINGCOURSE=true and infrastructure is running."); } - var flinkGatewayUrl = "http://localhost:8080"; + var flinkGatewayUrl = "http://localhost:8086"; TestContext.WriteLine($"📊 Prometheus Endpoint: {PrometheusHostEndpoint}"); TestContext.WriteLine($"🔧 Flink Gateway URL: {flinkGatewayUrl}"); TestContext.WriteLine(); @@ -280,8 +280,8 @@ public async Task UIVideoTest_EndToEndObservability_ShouldCaptureMetricsDuringLi Assert.Fail("Prometheus or Grafana endpoint not available. Ensure LEARNINGCOURSE=true and infrastructure is running."); } - // Use Gateway endpoint which is stable at localhost:8080 (same as non-Playwright test) - var flinkGatewayUrl = "http://localhost:8080"; + // Use Gateway endpoint which is stable at localhost:8086 (same as non-Playwright test) + var flinkGatewayUrl = "http://localhost:8086"; TestContext.WriteLine($"📊 Prometheus: {PrometheusHostEndpoint}"); TestContext.WriteLine($"📊 Grafana: {GrafanaHostEndpoint}"); @@ -1178,7 +1178,7 @@ private async Task VerifyMetricHasData(string metricName, string description) /// private async Task VerifyJobGatewayPrometheusAsync() { - const string JobGatewayUrl = "http://localhost:8080"; + const string JobGatewayUrl = "http://localhost:8086"; TestContext.WriteLine($" 📊 1. JobGateway Prometheus Metrics (CRITICAL):"); TestContext.WriteLine($" Purpose: Verify JobGateway is exposing Prometheus metrics"); TestContext.WriteLine($" Endpoint: {JobGatewayUrl}/metrics"); @@ -1750,11 +1750,11 @@ private async Task StartExercise51InBackgroundAsync(string exercisePath) startInfo.Environment["KAFKA_BOOTSTRAP_SERVERS"] = KafkaHostBootstrapServers; startInfo.Environment["KAFKA_FLINK_BOOTSTRAP_SERVERS"] = KafkaFlinkBootstrapServers; // Exercise51 uses the Gateway to submit jobs, not Flink REST API directly - startInfo.Environment["FLINK_JOB_GATEWAY_URL"] = "http://localhost:8080"; + startInfo.Environment["FLINK_JOB_GATEWAY_URL"] = "http://localhost:8086"; TestContext.WriteLine($" 🔧 KAFKA_BOOTSTRAP_SERVERS={KafkaHostBootstrapServers}"); TestContext.WriteLine($" 🔧 KAFKA_FLINK_BOOTSTRAP_SERVERS={KafkaFlinkBootstrapServers}"); - TestContext.WriteLine($" 🔧 FLINK_JOB_GATEWAY_URL=http://localhost:8080"); + TestContext.WriteLine($" 🔧 FLINK_JOB_GATEWAY_URL=http://localhost:8086"); _exercise51Process = new Process { StartInfo = startInfo }; diff --git a/LearningCourse/LearningCourse.IntegrationTests/LearningCourseTestBase.cs b/LearningCourse/LearningCourse.IntegrationTests/LearningCourseTestBase.cs index ae31b282..60645d77 100644 --- a/LearningCourse/LearningCourse.IntegrationTests/LearningCourseTestBase.cs +++ b/LearningCourse/LearningCourse.IntegrationTests/LearningCourseTestBase.cs @@ -50,8 +50,8 @@ public abstract class LearningCourseTestBase public static string? RedisHostEndpoint { get; private set; } /// - /// FlinkDotNet JobGateway endpoint for job submission (e.g., "http://localhost:8080/"). - /// JobGateway is a .NET Aspire project running on fixed port 8080. + /// FlinkDotNet JobGateway endpoint for job submission (e.g., "http://localhost:8086/"). + /// JobGateway is a .NET Aspire project running on fixed port 8086. /// public static string? FlinkJobGatewayUrl { get; private set; } @@ -391,8 +391,8 @@ private static async Task WaitForInfrastructureReadyAsync(DateTime appHostStartT PrometheusHostEndpoint = prometheusEndpoint; GrafanaHostEndpoint = grafanaEndpoint; FlinkRestApiEndpoint = flinkRestApi; - FlinkJobGatewayUrl = "http://localhost:8080/"; // Fixed port for JobGateway (not dynamic) - FlinkJobManagerUrl = "http://localhost:8081/"; // Fixed port for JobManager (configured in Aspire) + FlinkJobGatewayUrl = "http://localhost:8086/"; // Fixed port for JobGateway (not dynamic) + FlinkJobManagerUrl = flinkRestApi; // Use discovered dynamic port from Aspire var savedTime = (maxWait - stopwatch.Elapsed).TotalSeconds; TestContext.WriteLine($"✅ All required infrastructure ready after {stopwatch.Elapsed.TotalSeconds:F1}s (saved {savedTime:F1}s with optimized polling)"); @@ -771,7 +771,7 @@ private static async Task IsTemporalHealthyAsync(string temporalEndpoint) /// /// Kill any orphaned processes from previous test runs. /// This prevents "address already in use" errors and infrastructure startup failures. - /// Kills both JobGateway (port 8080) and AppHost processes. + /// Kills both JobGateway (port 8086) and AppHost processes. /// private static void KillOrphanedJobGatewayProcesses() { @@ -1614,7 +1614,7 @@ private static void CancelAllFlinkJobsSync() { try { - var flinkGatewayUrl = Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8080"; + var flinkGatewayUrl = Environment.GetEnvironmentVariable("FLINK_JOB_GATEWAY_URL") ?? "http://localhost:8086"; using var httpClient = new System.Net.Http.HttpClient { Timeout = TimeSpan.FromSeconds(10) }; @@ -1802,9 +1802,9 @@ private static async Task GetKafkaTopicMessageCountAsync(string topicName) } // Set FLINK_JOB_GATEWAY_URL for exercises that submit Flink jobs - // FlinkDotNet.JobGateway is a .NET Aspire project running on fixed port 8080 + // FlinkDotNet.JobGateway is a .NET Aspire project running on fixed port 8086 // NOTE: This is different from FlinkRestApiEndpoint (Flink JobManager with dynamic Docker port) - psi.Environment["FLINK_JOB_GATEWAY_URL"] = "http://localhost:8080/"; + psi.Environment["FLINK_JOB_GATEWAY_URL"] = "http://localhost:8086/"; // Set FLINK_JOBMANAGER_URL for exercises that check Flink cluster health // Flink JobManager REST API with dynamic Docker port @@ -1819,7 +1819,7 @@ private static async Task GetKafkaTopicMessageCountAsync(string topicName) TestContext.WriteLine($"🔧 KAFKA_BOOTSTRAP_SERVERS={KafkaHostBootstrapServers}"); TestContext.WriteLine($"🔧 KAFKA_FLINK_BOOTSTRAP_SERVERS={KafkaFlinkBootstrapServers}"); - TestContext.WriteLine($"🔧 FLINK_JOB_GATEWAY_URL=http://localhost:8080/"); + TestContext.WriteLine($"🔧 FLINK_JOB_GATEWAY_URL=http://localhost:8086/"); using var process = Process.Start(psi); if (process == null) @@ -1982,9 +1982,9 @@ private static async Task GetKafkaTopicMessageCountAsync(string topicName) } // Set FLINK_JOB_GATEWAY_URL for exercises that submit Flink jobs - // FlinkDotNet.JobGateway is a .NET Aspire project running on fixed port 8080 + // FlinkDotNet.JobGateway is a .NET Aspire project running on fixed port 8086 // NOTE: This is different from FlinkRestApiEndpoint (Flink JobManager with dynamic Docker port) - psi.Environment["FLINK_JOB_GATEWAY_URL"] = "http://localhost:8080/"; + psi.Environment["FLINK_JOB_GATEWAY_URL"] = "http://localhost:8086/"; // Set FLINK_JOBMANAGER_URL for exercises that check Flink cluster health // Flink JobManager REST API with dynamic Docker port diff --git a/LocalTesting/LocalTesting.FlinkSqlAppHost/Ports.cs b/LocalTesting/LocalTesting.FlinkSqlAppHost/Ports.cs index 05baa61e..f34eaf2d 100644 --- a/LocalTesting/LocalTesting.FlinkSqlAppHost/Ports.cs +++ b/LocalTesting/LocalTesting.FlinkSqlAppHost/Ports.cs @@ -15,7 +15,7 @@ public static class Ports /// /// Gateway HTTP port (Projects.FlinkDotNet_JobGateway runs on fixed host port) /// - public const int GatewayHostPort = 8080; + public const int GatewayHostPort = 8086; /// /// Kafka FIXED port configuration (no dynamic allocation). diff --git a/LocalTesting/LocalTesting.FlinkSqlAppHost/Program.cs b/LocalTesting/LocalTesting.FlinkSqlAppHost/Program.cs index 25e9418e..4d258c6c 100644 --- a/LocalTesting/LocalTesting.FlinkSqlAppHost/Program.cs +++ b/LocalTesting/LocalTesting.FlinkSqlAppHost/Program.cs @@ -355,10 +355,19 @@ // Flink.JobGateway - Add Flink Job Gateway as .NET project // CRITICAL: Using .AddProject() for proper Aspire service discovery and endpoint management // JobGateway runs as a host process (not containerized) for reliable endpoint discovery +// Note: ASPNETCORE_URLS set for LocalTesting mode compatibility; removed for LearningCourse mode #pragma warning disable S1481 // Gateway resource is created but not directly referenced - used via Aspire orchestration var gateway = builder.AddProject("flink-job-gateway") - .WithHttpEndpoint(port: 8080, name: "gateway-http") - .WithEnvironment("ASPNETCORE_URLS", "http://localhost:8080") + .WithHttpEndpoint(port: 8086, name: "gateway-http"); + +// In LocalTesting mode, explicitly set ASPNETCORE_URLS to ensure proper binding +// In LearningCourse mode, Aspire's service discovery manages port binding automatically +if (!isLearningCourse) +{ + gateway = gateway.WithEnvironment("ASPNETCORE_URLS", "http://localhost:8086"); +} + +gateway = gateway .WithEnvironment("FLINK_CONNECTOR_PATH", connectorsDir) .WithEnvironment("FLINK_RUNNER_JAR_PATH", gatewayJarPath) .WithEnvironment("LOG_FILE_PATH", testLogsDir) @@ -528,7 +537,7 @@ static void SetupEnvironment() Environment.SetEnvironmentVariable("ASPIRE_ALLOW_UNSECURED_TRANSPORT", "true"); // CRITICAL: Set ASPNETCORE_URLS for Aspire Dashboard (required by Aspire SDK) // This will be inherited by child processes, but we override it per-project using WithEnvironment() - // JobGateway explicitly sets ASPNETCORE_URLS=http://0.0.0.0:8080 via WithEnvironment() + // JobGateway explicitly sets ASPNETCORE_URLS=http://0.0.0.0:8086 via WithEnvironment() Environment.SetEnvironmentVariable("ASPNETCORE_URLS", "http://localhost:15888"); Environment.SetEnvironmentVariable("ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL", "http://localhost:16686"); Environment.SetEnvironmentVariable("ASPIRE_DASHBOARD_OTLP_HTTP_ENDPOINT_URL", "http://localhost:16687"); diff --git a/LocalTesting/LocalTesting.IntegrationTests/AspireValidationTest.cs b/LocalTesting/LocalTesting.IntegrationTests/AspireValidationTest.cs index 6b2f1252..7ce28588 100644 --- a/LocalTesting/LocalTesting.IntegrationTests/AspireValidationTest.cs +++ b/LocalTesting/LocalTesting.IntegrationTests/AspireValidationTest.cs @@ -53,7 +53,7 @@ public static async Task ValidateAspireSetup(string[] args) Console.WriteLine("Service URLs:"); Console.WriteLine(" • Aspire Dashboard: http://localhost:15888"); Console.WriteLine(" • Flink JobManager UI: http://localhost:8081"); - Console.WriteLine(" • Flink Job Gateway: http://localhost:8080"); + Console.WriteLine(" • Flink Job Gateway: http://localhost:8086"); Console.WriteLine(" • Kafka: localhost:9092"); } else @@ -126,7 +126,7 @@ private static async Task TestFlinkGateway() { try { - var response = await _httpClient.GetAsync("http://localhost:8080/api/v1/health"); + var response = await _httpClient.GetAsync("http://localhost:8086/api/v1/health"); if (response.IsSuccessStatusCode) { var content = await response.Content.ReadAsStringAsync(); diff --git a/LocalTesting/run-learningcourse-nobuild.sh b/LocalTesting/run-learningcourse-nobuild.sh old mode 100644 new mode 100755 diff --git a/LocalTesting/run-learningcourse.cmd b/LocalTesting/run-learningcourse.cmd index f4ecf596..e971ffdc 100644 --- a/LocalTesting/run-learningcourse.cmd +++ b/LocalTesting/run-learningcourse.cmd @@ -24,7 +24,7 @@ echo. echo [INFO] Starting LocalTesting.FlinkSqlAppHost... echo. -dotnet run --project LocalTesting.FlinkSqlAppHost +dotnet run --project LocalTesting.FlinkSqlAppHost --configuration Release echo. echo ======================================== diff --git a/LocalTesting/run-learningcourse.sh b/LocalTesting/run-learningcourse.sh old mode 100644 new mode 100755 index 8e6fe3d7..7e66a85c --- a/LocalTesting/run-learningcourse.sh +++ b/LocalTesting/run-learningcourse.sh @@ -14,7 +14,7 @@ echo "" echo "[INFO] Starting LocalTesting.FlinkSqlAppHost..." echo "" -dotnet run --project LocalTesting.FlinkSqlAppHost +dotnet run --project LocalTesting.FlinkSqlAppHost --configuration Release echo "" echo "========================================"