Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions java/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
12 changes: 4 additions & 8 deletions java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<repositories>
Expand All @@ -21,7 +21,7 @@ Java 21 or newer is required. Add `com.riverqueue:river:0.1.0` and a JDBC driver
<dependency>
<groupId>com.riverqueue</groupId>
<artifactId>river</artifactId>
<version>0.1.0</version>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -166,7 +162,7 @@ cat > pom.xml <<'EOF'
<modelVersion>4.0.0</modelVersion>
<groupId>local</groupId><artifactId>river-cli-install</artifactId><version>1</version>
<repositories><repository><id>river</id><url>https://riverqueue.com/maven</url></repository></repositories>
<dependencies><dependency><groupId>com.riverqueue</groupId><artifactId>river-cli</artifactId><version>0.1.0</version></dependency></dependencies>
<dependencies><dependency><groupId>com.riverqueue</groupId><artifactId>river-cli</artifactId><version>0.2.0</version></dependency></dependencies>
</project>
EOF
mvn --batch-mode --no-transfer-progress \
Expand Down
6 changes: 3 additions & 3 deletions java/cli/pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent><groupId>com.riverqueue</groupId><artifactId>river-java</artifactId><version>0.1.0</version><relativePath>../pom.xml</relativePath></parent>
<artifactId>river-cli</artifactId><version>0.1.0</version>
<parent><groupId>com.riverqueue</groupId><artifactId>river-java</artifactId><version>0.2.0</version><relativePath>../pom.xml</relativePath></parent>
<artifactId>river-cli</artifactId><version>0.2.0</version>
<name>River Java migration CLI</name>
<description>Executable database migration tool for River on Postgres and SQLite</description>
<dependencies>
<dependency><groupId>com.riverqueue</groupId><artifactId>river</artifactId><version>0.1.0</version></dependency>
<dependency><groupId>com.riverqueue</groupId><artifactId>river</artifactId><version>0.2.0</version></dependency>
<dependency><groupId>org.postgresql</groupId><artifactId>postgresql</artifactId></dependency>
<dependency><groupId>org.xerial</groupId><artifactId>sqlite-jdbc</artifactId></dependency>
<dependency><groupId>org.junit.jupiter</groupId><artifactId>junit-jupiter</artifactId><scope>test</scope></dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions java/conformance/bin/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion java/conformance/bin/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 | {
Expand Down
2 changes: 1 addition & 1 deletion java/conformance/candidate.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion java/conformance/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent><groupId>com.riverqueue</groupId><artifactId>river-java</artifactId><version>0.1.0</version></parent>
<parent><groupId>com.riverqueue</groupId><artifactId>river-java</artifactId><version>0.2.0</version></parent>
<artifactId>river-conformance</artifactId>
<!-- This is a development adapter, not a publishable River artifact. -->
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion java/conformance/src/main/resources/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"java": {
"package": "com.riverqueue:river",
"registry": "maven",
"version": "0.1.0"
"version": "0.2.0"
}
},
"migration": {
Expand Down
2 changes: 1 addition & 1 deletion java/docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```

Expand Down
2 changes: 1 addition & 1 deletion java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.riverqueue</groupId>
<artifactId>river-java</artifactId>
<version>0.1.0</version>
<version>0.2.0</version>
<packaging>pom</packaging>
<name>River for Java</name>
<description>Transactional jobs on Postgres and SQLite, interoperable with River clients in other languages</description>
Expand Down
2 changes: 1 addition & 1 deletion java/river/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent><groupId>com.riverqueue</groupId><artifactId>river-java</artifactId><version>0.1.0</version></parent>
<parent><groupId>com.riverqueue</groupId><artifactId>river-java</artifactId><version>0.2.0</version></parent>
<artifactId>river</artifactId>
<name>River for Java library</name>
<description>Transactional jobs interoperable with River clients in other languages</description>
Expand Down
Loading