Skip to content

Commit

Permalink
Merge branch 'master' into read_priority_full
Browse files Browse the repository at this point in the history
  • Loading branch information
Renkai committed Dec 2, 2020
2 parents e1d8335 + ee4cddf commit 578727a
Show file tree
Hide file tree
Showing 77 changed files with 22,539 additions and 5 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,7 @@ flexible messaging model and an intuitive client API.</description>
<exclude>**/src/main/java/org/apache/bookkeeper/mledger/util/AbstractCASReferenceCounted.java</exclude>
<exclude>**/ByteBufCodedInputStream.java</exclude>
<exclude>**/ByteBufCodedOutputStream.java</exclude>
<exclude>**/ahc.properties</exclude>
<exclude>bin/proto/*</exclude>
<exclude>conf/schema_example.conf</exclude>
<exclude>data/**</exclude>
Expand Down
6 changes: 3 additions & 3 deletions site2/docs/client-libraries-websocket.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
id: client-libraries-websocket
title: Pulsar's WebSocket API
title: Pulsar WebSocket API
sidebar_label: WebSocket
---

Pulsar's [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) API is meant to provide a simple way to interact with Pulsar using languages that do not have an official [client library](getting-started-clients.md). Through WebSockets you can publish and consume messages and use all the features available in the [Java](client-libraries-java.md), [Go](client-libraries-go.md), [Python](client-libraries-python.md) and [C++](client-libraries-cpp.md) client libraries.
Pulsar [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API) API provides a simple way to interact with Pulsar using languages that do not have an official [client library](getting-started-clients.md). Through WebSocket, you can publish and consume messages and use features available on the [Client Features Matrix](https://github.com/apache/pulsar/wiki/Client-Features-Matrix) page.


> You can use Pulsar's WebSocket API with any WebSocket client library. See examples for Python and Node.js [below](#client-examples).
> You can use Pulsar WebSocket API with any WebSocket client library. See examples for Python and Node.js [below](#client-examples).
## Running the WebSocket service

Expand Down
2 changes: 1 addition & 1 deletion site2/docs/getting-started-clients.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: client-libraries
title: Pulsar client libraries
sidebar_label: Use Pulsar with client libraries
sidebar_label: Overview
---

Pulsar supports the following client libraries:
Expand Down
2 changes: 1 addition & 1 deletion site2/website/data/connectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ module.exports = [
longName: 'NSQ source',
type: 'Source',
link: 'https://nsq.io/',
}
},
{
name: 'rabbitmq',
longName: 'RabbitMQ source and sink',
Expand Down
1 change: 1 addition & 0 deletions site2/website/releases.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[
"2.6.2",
"2.7.0",
"2.6.1",
"2.6.0",
"2.5.2",
Expand Down
1 change: 1 addition & 0 deletions site2/website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"performance-pulsar-perf"
],
"Client libraries": [
"client-libraries",
"client-libraries-java",
"client-libraries-go",
"client-libraries-python",
Expand Down
158 changes: 158 additions & 0 deletions site2/website/versioned_docs/version-2.7.0/admin-api-brokers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
---
id: version-2.7.0-admin-api-brokers
title: Managing Brokers
sidebar_label: Brokers
original_id: admin-api-brokers
---

Pulsar brokers consist of two components:

1. An HTTP server exposing a {@inject: rest:REST:/} interface administration and [topic](reference-terminology.md#topic) lookup.
2. A dispatcher that handles all Pulsar [message](reference-terminology.md#message) transfers.

[Brokers](reference-terminology.md#broker) can be managed via:

* The [`brokers`](reference-pulsar-admin.md#brokers) command of the [`pulsar-admin`](reference-pulsar-admin.md) tool
* The `/admin/v2/brokers` endpoint of the admin {@inject: rest:REST:/} API
* The `brokers` method of the {@inject: javadoc:PulsarAdmin:/admin/org/apache/pulsar/client/admin/PulsarAdmin.html} object in the [Java API](client-libraries-java.md)

In addition to being configurable when you start them up, brokers can also be [dynamically configured](#dynamic-broker-configuration).

> See the [Configuration](reference-configuration.md#broker) page for a full listing of broker-specific configuration parameters.
## Brokers resources

### List active brokers

Fetch all available active brokers that are serving traffic.

<!--DOCUSAURUS_CODE_TABS-->
<!--pulsar-admin-->

```shell
$ pulsar-admin brokers list use
```

```
broker1.use.org.com:8080
```

<!--REST API-->

{@inject: endpoint|GET|/admin/v2/brokers/:cluster|operation/getActiveBrokers}

<!--JAVA-->

```java
admin.brokers().getActiveBrokers(clusterName)
```

<!--END_DOCUSAURUS_CODE_TABS-->

#### list of namespaces owned by a given broker

It finds all namespaces which are owned and served by a given broker.

<!--DOCUSAURUS_CODE_TABS-->
<!--pulsar-admin-->

```shell
$ pulsar-admin brokers namespaces use \
--url broker1.use.org.com:8080
```

```json
{
"my-property/use/my-ns/0x00000000_0xffffffff": {
"broker_assignment": "shared",
"is_controlled": false,
"is_active": true
}
}
```
<!--REST API-->

{@inject: endpoint|GET|/admin/v2/brokers/:cluster/:broker/ownedNamespaces|operation/getOwnedNamespaes}

<!--JAVA-->

```java
admin.brokers().getOwnedNamespaces(cluster,brokerUrl);
```
<!--END_DOCUSAURUS_CODE_TABS-->

### Dynamic broker configuration

One way to configure a Pulsar [broker](reference-terminology.md#broker) is to supply a [configuration](reference-configuration.md#broker) when the broker is [started up](reference-cli-tools.md#pulsar-broker).

But since all broker configuration in Pulsar is stored in ZooKeeper, configuration values can also be dynamically updated *while the broker is running*. When you update broker configuration dynamically, ZooKeeper will notify the broker of the change and the broker will then override any existing configuration values.

* The [`brokers`](reference-pulsar-admin.md#brokers) command for the [`pulsar-admin`](reference-pulsar-admin.md) tool has a variety of subcommands that enable you to manipulate a broker's configuration dynamically, enabling you to [update config values](#update-dynamic-configuration) and more.
* In the Pulsar admin {@inject: rest:REST:/} API, dynamic configuration is managed through the `/admin/v2/brokers/configuration` endpoint.

### Update dynamic configuration

<!--DOCUSAURUS_CODE_TABS-->
<!--pulsar-admin-->

The [`update-dynamic-config`](reference-pulsar-admin.md#brokers-update-dynamic-config) subcommand will update existing configuration. It takes two arguments: the name of the parameter and the new value using the `config` and `value` flag respectively. Here's an example for the [`brokerShutdownTimeoutMs`](reference-configuration.md#broker-brokerShutdownTimeoutMs) parameter:

```shell
$ pulsar-admin brokers update-dynamic-config --config brokerShutdownTimeoutMs --value 100
```

<!--REST API-->

{@inject: endpoint|POST|/admin/v2/brokers/configuration/:configName/:configValue|operation/updateDynamicConfiguration}

<!--JAVA-->

```java
admin.brokers().updateDynamicConfiguration(configName, configValue);
```
<!--END_DOCUSAURUS_CODE_TABS-->

### List updated values

Fetch a list of all potentially updatable configuration parameters.
<!--DOCUSAURUS_CODE_TABS-->
<!--pulsar-admin-->

```shell
$ pulsar-admin brokers list-dynamic-config
brokerShutdownTimeoutMs
```

<!--REST API-->

{@inject: endpoint|GET|/admin/v2/brokers/configuration|operation/getDynamicConfigurationName}

<!--JAVA-->

```java
admin.brokers().getDynamicConfigurationNames();
```
<!--END_DOCUSAURUS_CODE_TABS-->

### List all

Fetch a list of all parameters that have been dynamically updated.

<!--DOCUSAURUS_CODE_TABS-->
<!--pulsar-admin-->

```shell
$ pulsar-admin brokers get-all-dynamic-config
brokerShutdownTimeoutMs:100
```

<!--REST API-->

{@inject: endpoint|GET|/admin/v2/brokers/configuration/values|operation/getAllDynamicConfigurations}

<!--JAVA-->

```java
admin.brokers().getAllDynamicConfigurations();
```
<!--END_DOCUSAURUS_CODE_TABS-->
Loading

0 comments on commit 578727a

Please sign in to comment.