Skip to content

Add .NET Kafka webserver#1

Open
RayCoulstock wants to merge 2 commits into
masterfrom
codex/add-dotnet-webserver-with-kafka-integration
Open

Add .NET Kafka webserver#1
RayCoulstock wants to merge 2 commits into
masterfrom
codex/add-dotnet-webserver-with-kafka-integration

Conversation

@RayCoulstock

Copy link
Copy Markdown
Owner

Motivation

  • Provide a simple ASP.NET Core webserver option so C# students can interact with Kafka from a familiar stack.
  • Keep the server intentionally minimal with one page to send keyed string messages and one page to view recently consumed messages so it can be edited during class.
  • Make the service runnable in the existing course environment via Docker Compose and a dedicated topic to avoid interfering with existing examples.

Description

  • Add a minimal ASP.NET Core app (webserver-dotnet/Program.cs) exposing /produce to send messages and /consume to view recent messages, using Confluent.Kafka for production and a background consumer.
  • Add a .NET project file (webserver-dotnet/webserver-dotnet.csproj) and a Dockerfile (webserver-dotnet/Dockerfile) for containerized runs, plus .dockerignore.
  • Register a webserver-dotnet service in docker-compose.yml (mapped to host port 3005) and add creation of the dotnet-messages topic to the create-topics service.
  • Update README.md with instructions on how to start the .NET webserver and where to access the produce and consume pages.

Testing

  • Ran git diff --check to validate there are no trivial whitespace or diff errors and it completed successfully.
  • Parsed docker-compose.yml with a small YAML check (ruby -e 'require "yaml"; ...') to confirm the webserver-dotnet service and its port are present and the check succeeded.
  • Attempted to run the ./dotnet-install.sh and dotnet build steps but they could not complete because the environment lacked a local .NET SDK and the installer was blocked by the network/proxy, so the build could not be verified here.
  • Attempted to run docker compose config / docker-compose config to validate the Compose file but this environment does not have Docker installed, so compose validation could not be performed here.

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d709c2e74

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docker-compose.yml
Comment on lines +233 to +235
depends_on:
- kafka
- create-topics

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Wait for topic creation before starting the .NET server

In the documented docker-compose up -d zookeeper kafka create-topics webserver-dotnet flow, this short-form depends_on only orders container startup; Docker's startup-order docs state it does not wait for a dependency to be ready or for a one-shot job to complete. Because Kafka has auto topic creation disabled and dotnet-messages is created later by create-topics, the .NET consumer/producer can start against a missing topic and fail or return produce errors on a fresh environment, unlike the existing webservers that explicitly wait for their topic/schema before running.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant