diff --git a/java/CHANGELOG.md b/java/CHANGELOG.md index 4dcd04adc..4d45e1841 100644 --- a/java/CHANGELOG.md +++ b/java/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.2.0] - 2026-10-26 + ### Changed - **Breaking:** Move runtime configuration to `Client.builder(database)` and startup to `Client.start()`, which returns an `AutoCloseable` `RunHandle` for `stop()`, `stopAndCancel()`, and runtime queue/periodic controls. `Workers` is now a handler registry supplied through `.workers(registry)`; `.worker(type, handler)` supports inline registration. Move subscriptions and event types to `Client`, allowing subscriptions before startup. A client allows one active run and can restart after shutdown completes. [PR #1555](https://github.com/riverqueue/river/pull/1555). diff --git a/java/README.md b/java/README.md index be5343b83..f0c3aa511 100644 --- a/java/README.md +++ b/java/README.md @@ -6,7 +6,7 @@ retry, or work them using the same database. ## Installation -Java 21 or newer is required. Add `com.riverqueue:river:0.1.0` and a JDBC driver to your application's dependencies. Jackson 3 is included transitively. +Java 21 or newer is required. Add `com.riverqueue:river:0.2.0` and a JDBC driver to your application's dependencies. Jackson 3 is included transitively. ```xml @@ -21,7 +21,7 @@ Java 21 or newer is required. Add `com.riverqueue:river:0.1.0` and a JDBC driver com.riverqueue river - 0.1.0 + 0.2.0 org.postgresql @@ -36,10 +36,6 @@ For SQLite, replace the Postgres JDBC dependency with `org.xerial:sqlite-jdbc:3. ## Quick start -The lifecycle API below is unreleased. For the published `0.1.0` API, see -[its README](https://github.com/riverqueue/river/blob/java/v0.1.0/java/README.md). -Build from source to use these examples. - Define job arguments as a record, give the job a stable kind, and register a worker lambda. This complete `Example.java` starts a client, inserts a job, waits for its completion, and stops the workers. Set `DATABASE_URL` to a @@ -100,7 +96,7 @@ jbang app install --name river-java --java 21 \ --java-options=--enable-native-access=ALL-UNNAMED \ --repos https://riverqueue.com/maven --repos central \ --main com.riverqueue.cli.MigrationCli \ - com.riverqueue:river-cli:0.1.0 + com.riverqueue:river-cli:0.2.0 export PATH="$HOME/.jbang/bin:$PATH" export DATABASE_URL=postgres://localhost/myapp # For SQLite: export DATABASE_URL=jdbc:sqlite:/absolute/path/myapp.db @@ -166,7 +162,7 @@ cat > pom.xml <<'EOF' 4.0.0 localriver-cli-install1 riverhttps://riverqueue.com/maven - com.riverqueueriver-cli0.1.0 + com.riverqueueriver-cli0.2.0 EOF mvn --batch-mode --no-transfer-progress \ diff --git a/java/cli/pom.xml b/java/cli/pom.xml index 56bfa3704..3535e89a9 100644 --- a/java/cli/pom.xml +++ b/java/cli/pom.xml @@ -1,11 +1,11 @@ 4.0.0 - com.riverqueueriver-java0.1.0../pom.xml - river-cli0.1.0 + com.riverqueueriver-java0.2.0../pom.xml + river-cli0.2.0 River Java migration CLI Executable database migration tool for River on Postgres and SQLite - com.riverqueueriver0.1.0 + com.riverqueueriver0.2.0 org.postgresqlpostgresql org.xerialsqlite-jdbc org.junit.jupiterjunit-jupitertest diff --git a/java/cli/src/test/java/com/riverqueue/cli/ExecutableIT.java b/java/cli/src/test/java/com/riverqueue/cli/ExecutableIT.java index 6783741f5..086b75d18 100644 --- a/java/cli/src/test/java/com/riverqueue/cli/ExecutableIT.java +++ b/java/cli/src/test/java/com/riverqueue/cli/ExecutableIT.java @@ -52,7 +52,7 @@ private String command(boolean executableJar, String... args) throws Exception { @ParameterizedTest @ValueSource(booleans = {false, true}) void thinJarRunsWithRuntimeDependencies(boolean executableJar) throws Exception { - assertEquals("river 0.1.0", command(executableJar, "--version").strip()); + assertEquals("river 0.2.0", command(executableJar, "--version").strip()); assertTrue(command(executableJar, "migrate-up").contains("008 [up]")); assertTrue(command(executableJar, "migrate-list").contains("applied")); assertTrue( diff --git a/java/conformance/bin/build.py b/java/conformance/bin/build.py index 3fd9f9e5c..69e6b9115 100644 --- a/java/conformance/bin/build.py +++ b/java/conformance/bin/build.py @@ -13,9 +13,9 @@ with (artifacts.parent / "build.lock").open("w") as lock: fcntl.flock(lock, fcntl.LOCK_EX) subprocess.run(["mvn", "-q", "-f", str(root / "pom.xml"), "package", "-DskipTests"], check=True) - jar = root / "conformance/target/river-conformance-0.1.0.jar" + jar = root / "conformance/target/river-conformance-0.2.0.jar" # A stale shaded jar can otherwise silently retain an older dependency's classes. - with zipfile.ZipFile(root / "river/target/river-0.1.0.jar") as library, zipfile.ZipFile(jar) as bundled: + with zipfile.ZipFile(root / "river/target/river-0.2.0.jar") as library, zipfile.ZipFile(jar) as bundled: for entry in library.namelist(): if entry.startswith("com/riverqueue/") and not entry.endswith("/"): if library.read(entry) != bundled.read(entry): diff --git a/java/conformance/bin/run.py b/java/conformance/bin/run.py index d79c31bf4..df7daeca3 100644 --- a/java/conformance/bin/run.py +++ b/java/conformance/bin/run.py @@ -53,7 +53,7 @@ def main(): manifest_path = reference / "conformance/manifest.json" manifest = json.loads(manifest_path.read_text()) manifest["implementations"]["java"] = { - "package": "com.riverqueue:river", "registry": "maven", "version": "0.1.0" + "package": "com.riverqueue:river", "registry": "maven", "version": "0.2.0" } manifest_path.write_text(json.dumps(manifest, indent=2) + "\n") environment = os.environ | { diff --git a/java/conformance/candidate.json b/java/conformance/candidate.json index 24a3f14d4..0abbd45fb 100644 --- a/java/conformance/candidate.json +++ b/java/conformance/candidate.json @@ -14,7 +14,7 @@ "postgres-full-v1", "sqlite-runtime-v1" ], - "version": "0.1.0", + "version": "0.2.0", "start_options": [ "elect_interval_ms", "rescuer_interval_ms", diff --git a/java/conformance/pom.xml b/java/conformance/pom.xml index fdb525a22..b33614e46 100644 --- a/java/conformance/pom.xml +++ b/java/conformance/pom.xml @@ -1,6 +1,6 @@ 4.0.0 - com.riverqueueriver-java0.1.0 + com.riverqueueriver-java0.2.0 river-conformance diff --git a/java/conformance/src/main/java/com/riverqueue/conformance/Adapter.java b/java/conformance/src/main/java/com/riverqueue/conformance/Adapter.java index 9d5e18c6f..c0df8f421 100644 --- a/java/conformance/src/main/java/com/riverqueue/conformance/Adapter.java +++ b/java/conformance/src/main/java/com/riverqueue/conformance/Adapter.java @@ -211,7 +211,7 @@ private JsonNode handle(String method, JsonNode params, String rawParams) throws database.dialect() == Database.Dialect.POSTGRES ? "postgres" : "sqlite"), Map.entry("capabilities", capabilities), Map.entry("implementation", "java"), - Map.entry("implementation_version", "0.1.0"), + Map.entry("implementation_version", "0.2.0"), Map.entry("methods", methods), Map.entry("migration_lines", Map.of("main", 8)), Map.entry("profile", profile), diff --git a/java/conformance/src/main/resources/manifest.json b/java/conformance/src/main/resources/manifest.json index 2fae9cef1..567192429 100644 --- a/java/conformance/src/main/resources/manifest.json +++ b/java/conformance/src/main/resources/manifest.json @@ -50,7 +50,7 @@ "java": { "package": "com.riverqueue:river", "registry": "maven", - "version": "0.1.0" + "version": "0.2.0" } }, "migration": { diff --git a/java/docs/development.md b/java/docs/development.md index 42ca61d0e..ea72de746 100644 --- a/java/docs/development.md +++ b/java/docs/development.md @@ -57,7 +57,7 @@ needed. Stop if a command fails. Versions omit `v`; tags use `java/vVERSION`. ```sh git checkout master && git pull --rebase git fetch --tags - export VERSION=0.1.1 + export VERSION=0.2.1 git checkout -b "$USER-java-$VERSION" ``` diff --git a/java/pom.xml b/java/pom.xml index efada6395..dd3c15c2f 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.riverqueue river-java - 0.1.0 + 0.2.0 pom River for Java Transactional jobs on Postgres and SQLite, interoperable with River clients in other languages diff --git a/java/river/pom.xml b/java/river/pom.xml index a2736ed8b..b02d94704 100644 --- a/java/river/pom.xml +++ b/java/river/pom.xml @@ -1,6 +1,6 @@ 4.0.0 - com.riverqueueriver-java0.1.0 + com.riverqueueriver-java0.2.0 river River for Java library Transactional jobs interoperable with River clients in other languages