Skip to content

Commit 2db0ba9

Browse files
Copilotdevstress
andcommitted
Re-add conditional ASPNETCORE_URLS for LocalTesting mode
LocalTesting mode requires explicit ASPNETCORE_URLS setting to work properly. Added conditional configuration: - LocalTesting mode (LEARNINGCOURSE=false): Sets ASPNETCORE_URLS=http://localhost:8086 - LearningCourse mode (LEARNINGCOURSE=true): Lets Aspire manage port binding automatically This matches the original working configuration but with updated port 8086. Co-authored-by: devstress <30769729+devstress@users.noreply.github.com>
1 parent 363cec4 commit 2db0ba9

File tree

1 file changed

+11
-2
lines changed
  • LocalTesting/LocalTesting.FlinkSqlAppHost

1 file changed

+11
-2
lines changed

LocalTesting/LocalTesting.FlinkSqlAppHost/Program.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,19 @@
355355
// Flink.JobGateway - Add Flink Job Gateway as .NET project
356356
// CRITICAL: Using .AddProject() for proper Aspire service discovery and endpoint management
357357
// JobGateway runs as a host process (not containerized) for reliable endpoint discovery
358-
// Note: JobGateway has default port 8086 in launchSettings.json, no need to set ASPNETCORE_URLS
358+
// Note: ASPNETCORE_URLS set for LocalTesting mode compatibility; removed for LearningCourse mode
359359
#pragma warning disable S1481 // Gateway resource is created but not directly referenced - used via Aspire orchestration
360360
var gateway = builder.AddProject<Projects.FlinkDotNet_JobGateway>("flink-job-gateway")
361-
.WithHttpEndpoint(port: 8086, name: "gateway-http")
361+
.WithHttpEndpoint(port: 8086, name: "gateway-http");
362+
363+
// In LocalTesting mode, explicitly set ASPNETCORE_URLS to ensure proper binding
364+
// In LearningCourse mode, Aspire's service discovery manages port binding automatically
365+
if (!isLearningCourse)
366+
{
367+
gateway = gateway.WithEnvironment("ASPNETCORE_URLS", "http://localhost:8086");
368+
}
369+
370+
gateway = gateway
362371
.WithEnvironment("FLINK_CONNECTOR_PATH", connectorsDir)
363372
.WithEnvironment("FLINK_RUNNER_JAR_PATH", gatewayJarPath)
364373
.WithEnvironment("LOG_FILE_PATH", testLogsDir)

0 commit comments

Comments
 (0)