Pulsar 2.0 是 Pulsar 一個新的主版本,其中有一些重大變化,包括簡化的 Topic 名稱,增加 Pulsar Functions 的功能,以及一些術語的變化等等。
Pulsar 2.0 的新功能
功能 | Description |
---|---|
Pulsar Functions | Pulsar 的一個輕量級計算功能 |
主要變化
需要注意一些重大變化,這些變化會顯著影響 Pulsar 的日常使用。
屬性 Vs. 租戶
在之前的版本中,Pulsar 有一個屬性(property)的概念。 A property is essentially the exact same thing as a tenant, so the "property" terminology has been removed in version 2.0. The pulsar-admin properties
command-line interface, for example, has been replaced with the pulsar-admin tenants
interface. 在某些情況下,仍然使用 properties,但不推薦使用,並且在後續更新中會將其完全移除。
Topic 名稱
Prior to version 2.0, all Pulsar topics had the following form:
{persistent|non-persistent}://property/cluster/namespace/topic
在 Pulsar 2.0 版本中有兩個重要改變:
不再使用集羣部分
The cluster component has been removed from topic names. Thus, all topic names now have the following form:
{persistent|non-persistent}://tenant/namespace/topic
已經使用了之前命名形式的 topic,其命名形式沒有改變,並且以後也不會更改。
Topic 靈活性命名
在 Pulsar 2.0 內部,所有 Topic 名稱的形式如上所示,但是在許多情況下(出於簡便考慮),可以使用簡化的名稱。 靈活命名系統基於 topic 類型、租戶及命名空間均有默認值,默認值如下:
Topic | 默認值 |
---|---|
topic 類型 | persistent |
租戶 | public |
命名空間 | default |
下表爲使用隱式默認值的 topic 名稱的轉換示例:
輸入 topic 名稱 | 轉換後的 topic 名稱 |
---|---|
my-topic |
persistent://public/default/my-topic |
my-tenant/my-namespace/my-topic |
persistent://tenant/namespace/topic |
對於非持久化 topics,需要指定 topic 的完整名稱,因爲持久化 topic 名稱的默認規則在此不適用。 因此,不能使用如
non-persistent://my-topic
這樣簡化的名稱,而應使用non-persistent://public/default/my-topic
。