Skip to content

Commit

Permalink
[website] Update website to include release 2.5.0 (apache#6075)
Browse files Browse the repository at this point in the history
  • Loading branch information
sijie authored Jan 17, 2020
1 parent fd4d0dd commit a75cd7d
Show file tree
Hide file tree
Showing 95 changed files with 22,943 additions and 0 deletions.
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.4.2",
"2.5.0",
"2.4.1",
"2.4.0",
"2.3.2",
Expand Down
264 changes: 264 additions & 0 deletions site2/website/versioned_docs/version-2.5.0/adaptors-kafka.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
id: version-2.5.0-admin-api-non-partitioned-topics
title: Managing non-partitioned topics
sidebar_label: Non-Partitioned topics
original_id: admin-api-non-partitioned-topics
---


You can use Pulsar's [admin API](admin-api-overview.md) to create and manage non-partitioned topics.

In all of the instructions and commands below, the topic name structure is:

```shell
persistent://tenant/namespace/topic
```

## Non-Partitioned topics resources

### Create

Non-partitioned topics in Pulsar must be explicitly created. When creating a new non-partitioned topic you
need to provide a name for the topic.

> #### Note
>
> By default, after 60 seconds of creation, topics are considered inactive and deleted automatically to prevent from generating trash data.
>
> To disable this feature, set `brokerDeleteInactiveTopicsEnabled` to `false`.
>
> To change the frequency of checking inactive topics, set `brokerDeleteInactiveTopicsFrequencySeconds` to your desired value.
>
> For more information about these two parameters, see [here](reference-configuration.md#broker).
#### pulsar-admin

You can create non-partitioned topics using the [`create`](reference-pulsar-admin.md#create-3)
command and specifying the topic name as an argument.
Here's an example:

```shell
$ bin/pulsar-admin topics create \
persistent://my-tenant/my-namespace/my-topic
```

> #### Note
>
> It's only allowed to create non partitioned topic of name contains suffix '-partition-' followed by numeric value like
> 'xyz-topic-partition-10', if there's already a partitioned topic with same name, in this case 'xyz-topic', and has
> number of partition larger then that numeric value in this case 11(partition index is start from 0). Else creation of such topic will fail.
#### REST API

{@inject: endpoint|PUT|/admin/v2/persistent/:tenant/:namespace/:topic|operation/createNonPartitionedTopic}

#### Java

```java
String topicName = "persistent://my-tenant/my-namespace/my-topic";
admin.topics().createNonPartitionedTopic(topicName);
```

### Delete

#### pulsar-admin

Non-partitioned topics can be deleted using the
[`delete`](reference-pulsar-admin.md#delete-4) command, specifying the topic by name:

```shell
$ bin/pulsar-admin topics delete \
persistent://my-tenant/my-namespace/my-topic
```

#### REST API

{@inject: endpoint|DELETE|/admin/v2/persistent/:tenant/:namespace/:topic|operation/deleteTopic}

#### Java

```java
admin.topics().delete(persistentTopic);
```

### List

It provides a list of topics existing under a given namespace.

#### pulsar-admin

```shell
$ pulsar-admin topics list tenant/namespace
persistent://tenant/namespace/topic1
persistent://tenant/namespace/topic2
```

#### REST API

{@inject: endpoint|GET|/admin/v2/persistent/:tenant/:namespace|operation/getList}

#### Java

```java
admin.topics().getList(namespace);
```
Loading

0 comments on commit a75cd7d

Please sign in to comment.