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
1 change: 1 addition & 0 deletions DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ here.
| 28 | *compatibility* §1 lets a client use a regular `persistent://` topic through a synthetic layout, but doesn't say whether that covers the consumers whose segments a controller assigns: the Stream consumer, and the members of a Checkpoint consumer group. The 5.0.1 controller serves only topics with scalable-topic metadata, which a regular topic gets when it migrates: before that, it refuses their registration ("Failed to initialize controller"). So a Stream consumer can't read a topic until the topic migrates, nor run across its migration, while the producer and the Queue and ungrouped Checkpoint consumers can. | The broker's answer: the create fails, with `ErrorKind::Other`. A Stream consumer should be able to use a regular topic; a Checkpoint consumer group needn't. | To raise |
| 29 | *client-behavior* §1 applies a layout only if its epoch is greater than the last applied, and *compatibility* §1 doesn't say how a client moves from a regular topic's synthetic layout to the layout its migration commits. The 5.0.1 broker gives both epoch 0: the synthetic layout always has it, and a migration commits its layout, with the legacy segments sealed and managed children, at epoch 0 too. A client that keeps to the spec's rule keeps the synthetic layout, sends to the legacy topics the migration terminated, and never reads the managed segments. Java applies every layout, whatever its epoch (J1), so it follows a migration. | A migrated topic's first layout replaces its synthetic one at the same epoch; otherwise the spec's `>`. | To raise |
| 30 | *data-model* §6 has the broker check a schema "on connect", and *error-model* §2 gives `IncompatibleSchema` the producer's or consumer's connect as its origin, but a producer connects to each segment separately, and the spec doesn't say when. Java V5 registers a Shared producer on a segment with the first message routed there, so a producer with an incompatible schema is created, and its sends fail; Java's `V5SchemaEvolutionTest` expects the failure on the send. An exclusive producer registers on every segment as it is created, and its create fails. | Java's: a Shared producer's sends fail, and it stays usable; an exclusive producer's create fails. | To raise |
| 31 | *conformance* §3 lists chunking, compression and custom batching as one optional capability, "Producer-local policies", and §1 makes a capability implemented in part non-conformant. The three are independent: a client that compresses and doesn't chunk can't tell whether it conforms. The spec should list them as three capabilities. | States compression as implemented, and chunking and custom batching as not (the README's Conformance section, and the release notes). | To raise |

## Java client and broker fixes to propose upstream

Expand Down
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ A Rust client for [Apache Pulsar](https://pulsar.apache.org) scalable topics, bu
[Scalable Topics client specification](https://github.com/apache/pulsar/tree/master/spec/scalable-topics) on the
[compio](https://github.com/compio-rs/compio) runtime.

**Status:** milestones 3 to 5. Producers publish to scalable topics, keeping per-key order across segment splits and
**Status:** the first release, 0.1.0, is being prepared.
Producers publish to scalable topics, keeping per-key order across segment splits and
merges, and to regular `persistent://` topics through the migration bridge. Queue consumers read every segment of a
topic, following its splits and merges, and acknowledge each message. Stream consumers read the segments the topic's
controller assigns them, each key in order, share segments by entry bucket when they outnumber them, and acknowledge
cumulatively. Checkpoint consumers read every segment, parents before their children, or as members of a group the
segments the controller assigns them, and resume from checkpoints the application keeps, in the Java client's bytes.
All work in the thread-safe, local and blocking APIs, with token and mTLS authentication, directly or through a proxy.
Producers batch messages by entry bucket and compress them, as Java's do. The design is in
Producers batch messages by entry bucket and compress them, as Java's do. Messages carry the Java client's schemas:
bytes, string, the primitive types, key/value, JSON, Avro and Protobuf, and generic records. The design is in
[DESIGN.md](DESIGN.md), the milestones in [PLAN.md](PLAN.md).

```rust
Expand All @@ -48,6 +50,26 @@ consumer.acknowledge(message.id()).await?;
client.close().await?;
```

## Conformance

Each release states the version of the
[Scalable Topics client specification](https://github.com/apache/pulsar/tree/master/spec/scalable-topics) it conforms
to, and which of the specification's optional capabilities it implements, in its
[release notes](https://github.com/apache/pulsar-client-rust/releases). The client conforms to version 1.0. It
implements the required core, C1 to C15
([*conformance*](https://github.com/apache/pulsar/blob/master/spec/scalable-topics/conformance.md) §2), and these of
the optional capabilities (§3):

| Capability | Implemented |
|---|---|
| Entry-bucketing, producer side | Yes: each batch holds one entry bucket's messages, and each entry is stamped with its bucket hashes. |
| Migration bridge | Yes: `persistent://` topics, partitioned or not, and short topic names. |
| Chunking, compression, custom batching | Compression: LZ4, ZLIB, ZSTD and Snappy. No chunking, and no custom batching. |
| Transactions | No. |
| Namespace subscription | No. |
| Dead-letter | No. |
| End-to-end encryption | No. |

## Layout

| Path | What it is |
Expand All @@ -61,6 +83,8 @@ client.close().await?;

## Building and testing

Building needs Rust 1.95 or later, and a C compiler for the ZSTD codec.

```bash
cargo test --workspace
```
Expand Down
3 changes: 2 additions & 1 deletion docs/8-quality.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ a layout change. It is written so that it could later grow into a suite every SD
- **Crate versions:** 0.x until the API settles. 1.0 once the required core is complete and the API has been
used in practice.
- **Spec version:** each release states the spec version it conforms to (1.0 to start), and which optional
capabilities it implements.
capabilities it implements: in its [release notes](https://github.com/apache/pulsar-client-rust/releases), and for
the current code in the README's Conformance section.
- **Brokers:** Pulsar 5.0 or later ([1](1-scope.md) §3).
- **Serialized identifiers:** MessageId and Checkpoint bytes stay readable by every later release
(*stability* §4.3). The golden-byte tests guard that.
Expand Down
Loading