Skip to content

Commit

Permalink
[pulsar-client-tools] Support Disable Replication in Pulsar Client To…
Browse files Browse the repository at this point in the history
…ols (apache#13659)

* support disable replication in pulsar-client

* edit docs

Co-authored-by: yfuruta <[email protected]>
  • Loading branch information
k2la and yfuruta authored Jan 11, 2022
1 parent 104adbe commit c9728ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ public class CmdProduce {
+ "file:///path/to/public.key or data:application/x-pem-file;base64,*****")
private String encKeyValue = null;

@Parameter(names = { "-dr",
"--disable-replication" }, description = "Disable geo-replication for messages.")
private boolean disableReplication = false;

private ClientBuilder clientBuilder;
private Authentication authentication;
private String serviceURL;
Expand Down Expand Up @@ -297,6 +301,10 @@ private int publish(String topic) {
throw new IllegalStateException();
}

if (disableReplication) {
message.disableReplication();
}

message.send();


Expand Down
1 change: 1 addition & 0 deletions site2/website-next/docs/reference-cli-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ Options
|`-p`, `--properties`|Properties to add. If you want to add multiple properties, use the comma as the separator, e.g. `k1=v1,k2=v2`.| |
|`-ekn`, `--encryption-key-name`|The public key name to encrypt payload.| |
|`-ekv`, `--encryption-key-value`|The URI of public key to encrypt payload. For example, `file:///path/to/public.key` or `data:application/x-pem-file;base64,*****`.| |
|`-dr`, `--disable-replication`|Disable geo-replication for messages|false|


### `consume`
Expand Down

0 comments on commit c9728ab

Please sign in to comment.