diff --git a/build.gradle b/build.gradle index 5470533eb4..3c56e22767 100644 --- a/build.gradle +++ b/build.gradle @@ -264,22 +264,19 @@ subprojects { options.compilerArgs << "-Xlint:-rawtypes" options.compilerArgs << "-Xlint:-serial" options.compilerArgs << "-Xlint:-try" - // AutoMQ inject start - // TODO: remove me, when upgrade to 4.x -// options.compilerArgs << "-Werror" - // AutoMQ inject start + + // ... (Baki ka beech ka code waisa hi rahega) ... - // --release is the recommended way to select the target release, but it's only supported in Java 9 so we also - // set --source and --target via `sourceCompatibility` and `targetCompatibility` a couple of lines below - if (JavaVersion.current().isJava9Compatible()) - options.release = minJavaVersion - // --source/--target 8 is deprecated in Java 20, suppress warning until Java 8 support is dropped in Kafka 4.0 if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_20)) options.compilerArgs << "-Xlint:-options" addParametersForTests(name, options) - } + } + tasks.withType(ScalaCompile) { + options.encoding = 'UTF-8' + scalaCompileOptions.encoding = 'UTF-8' + } java { // We should only set this if Java version is < 9 (--release is recommended for >= 9), but the Scala plugin for IntelliJ sets // `-target` incorrectly if this is unset diff --git a/docs/WINDOWS_DEVELOPMENT.md b/docs/WINDOWS_DEVELOPMENT.md new file mode 100644 index 0000000000..c18c0458d7 --- /dev/null +++ b/docs/WINDOWS_DEVELOPMENT.md @@ -0,0 +1,146 @@ +\# AutoMQ Local Development Guide for Windows + + + +This guide outlines the steps to set up a local development environment for AutoMQ on Windows using Docker and LocalStack. + + + +\## Prerequisites + + + +Ensure you have the following installed: + +1\. \*\*Java 17 (LTS)\*\*: Run `java -version` to verify. + +2\. \*\*Docker Desktop for Windows\*\*: Required to run LocalStack. + +3\. \*\*AWS CLI\*\*: Required to configure the mock S3 bucket. + + + +--- + + + +\## 1. Troubleshooting Docker Setup (Important) + + + +If you encounter errors starting Docker Desktop, check the following: + + + +\### A. Enable Virtualization + +If Docker fails to start, ensure \*\*Virtualization\*\* is enabled in your BIOS. + +1\. Open Task Manager (`Ctrl + Shift + Esc`) -> Performance -> CPU. + +2\. Check if "Virtualization" is \*\*Enabled\*\*. + +3\. If Disabled, restart your computer, enter BIOS (usually `F2`, `F10`, or `Del`), and enable \*\*Intel Virtual Technology\*\* or \*\*AMD SVM\*\*. + + + +\### B. Update WSL 2 + +If you see a "WSL kernel version too low" error: + +1\. Open PowerShell as Administrator. + +2\. Run: `wsl --update` + +3\. Restart Docker Desktop. + + + +--- + + + +\## 2. Setting up LocalStack (Mock Cloud) + + + +AutoMQ requires an S3-compatible storage layer. We use LocalStack for this. + + + +1\. \*\*Start LocalStack Container:\*\* + +  Open a PowerShell terminal and run: + +  ```powershell + +  docker run --rm -it -p 4566:4566 -p 4510-4559:4510-4559 localstack/localstack + +  ``` + +  \*Keep this window open.\* + + + +2\. \*\*Configure AWS CLI (Dummy Credentials):\*\* + +  Open a \*new\* PowerShell window and run: + +  ```powershell + +  aws configure + +  ``` + +  - AWS Access Key ID: `test` + +  - AWS Secret Access Key: `test` + +  - Default region name: `us-east-1` + +  - Default output format: `json` + + + +3\. \*\*Create S3 Bucket:\*\* + +  Run the following command to create a bucket named `ko3`: + +  ```powershell + +  aws s3api create-bucket --bucket ko3 --region us-east-1 --endpoint-url=\[http://127.0.0.1:4566](http://127.0.0.1:4566) + +  ``` + + + +--- + + + +\## 3. Configuration \& Running AutoMQ + + + +\### A. Configure Server Properties + +Open `config/kraft/server.properties` and ensure the S3 settings match your LocalStack setup. + + + +\*\*Note on Region Mismatch:\*\* + +If you encounter an error like `Authorization header is malformed; expecting 'us-east-2'`, update the region in the config file to match what LocalStack expects. + + + +```properties + +\# Updated settings for LocalStack + +s3.endpoint=\[http://127.0.0.1:4566](http://127.0.0.1:4566) + +s3.region=us-east-1 + +s3.bucket=ko3 +