Skip to content

AsyncAPI for a whole Pulsar namespace

Grants, subscriptions, schemas, functions and connectors in one document.

Terminal recording of kurkik pulsar export

The recording shows kurkik pulsar export on the demo sandbox; its data differs from this example.

Shown here: one cluster. Other broker setups are further down.

Terminal window
kurkik pulsar export standalone --acls --consumers
asyncapi.yaml
asyncapi: 3.0.0
info:
title: standalone Apache Pulsar API
version: 1.0.0-SNAPSHOT
description: Generated by reading Apache Pulsar of standalone (http://pulsar-standalone:8080).
servers:
standalone:
host: pulsar-standalone:6650
protocol: pulsar
protocolVersion: "4.0"
description: Apache Pulsar cluster standalone.
bindings:
pulsar:
bindingVersion: 0.1.0
tenant: shop
x-kurkik:
pulsar:
server:
cluster: standalone
brokers:
- localhost:8080
schemaRegistryUrl: http://pulsar-standalone:8080
schemaRegistryVendor: pulsar
namespacePolicies:
public/default:
schema-autoupdate: "on"
shop/orders:
schema-autoupdate: "on"
schema-compatibility-strategy: BACKWARD
tenants:
- tenant: public
adminRoles: []
allowedClusters:
- standalone
- tenant: shop
adminRoles:
- shop-admin
allowedClusters:
- standalone
security:
- security: NONE
tls: false
acl:
- role: billing
resourceType: namespace
name: shop/orders
actions:
- consume
- role: checkout
resourceType: namespace
name: shop/orders
actions:
- produce
- role: ops
resourceType: namespace
name: shop/orders
actions:
- functions
- sinks
- sources
- role: audit
resourceType: topic
name: persistent://shop/orders/created
actions:
- consume
consumers:
- subscription: billing
type: Shared
topics:
- persistent://shop/orders/created
- persistent://shop/orders/paid
consumers:
- billing-1
producers:
- producerName: checkout-1
accessMode: Shared
topics:
- persistent://shop/orders/created
- producerName: payments-1
accessMode: Shared
topics:
- persistent://shop/orders/paid
functions: []
sources: []
sinks: []
brokerConfiguration:
advertisedAddress: localhost
backlogQuotaDefaultLimitGB: "10.0"
bookkeeperClientMinNumRacksPerWriteQuorum: "1"
bookkeeperClientReorderReadSequenceEnabled: "false"
bookkeeperNumberOfChannelsPerBookie: "1"
clusterName: standalone
enablePackagesManagement: "true"
forceDeleteNamespaceAllowed: "true"
functionsWorkerEnablePackageManagement: "true"
isRunningStandalone: "true"
loadBalancerEnabled: "false"
loadManagerClassName: org.apache.pulsar.broker.loadbalance.NoopLoadManager
managedLedgerCacheEvictionFrequency: "100.0"
managedLedgerDefaultAckQuorum: "1"
managedLedgerDefaultEnsembleSize: "1"
managedLedgerDefaultMarkDeleteRateLimit: "0.1"
managedLedgerDefaultWriteQuorum: "1"
metadataStoreUrl: rocksdb:///pulsar/data/metadata
packagesManagementStorageProvider: org.apache.pulsar.packages.management.storage.filesystem.FileSystemPackagesStorageProvider
statusFilePath: /usr/local/apache/htdocs
topicPublisherThrottlingTickTimeMillis: "2"
webSocketServiceEnabled: "true"
clientConfiguration:
serviceUrl: pulsar://pulsar-standalone:6650
webServiceUrl: http://pulsar-standalone:8080
producerConfiguration: {}
consumerConfiguration: {}
channels:
persistent-shop-orders-created:
address: persistent://shop/orders/created
messages:
persistent-shop-orders-created:
payload:
schemaFormat: application/vnd.apache.avro;version=1.9.0
schema:
type: record
name: Order
namespace: shop
fields:
- name: id
type: string
- name: total
type: double
name: persistent-shop-orders-created
title: persistent://shop/orders/created
summary: "Schema read from Pulsar's own registry: AVRO, version 0."
x-kurkik:
pulsar:
message:
schemaType: AVRO
schemaVersion: 0
schemaIdLocation: metadata
schemaLookupStrategy: topic
schemaCompatibility: BACKWARD
key:
type: string
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/created
tenant: shop
namespace: orders
persistence: persistent
partitions: 0
geo-replication:
- standalone
topicConfiguration:
partitions: 0
persistence: persistent
replication-clusters:
- standalone
schema-autoupdate: "on"
schema-compatibility-strategy: BACKWARD
persistent-shop-orders-paid:
address: persistent://shop/orders/paid
messages:
persistent-shop-orders-paid:
payload:
schemaFormat: application/vnd.apache.avro;version=1.9.0
schema:
type: record
name: Payment
namespace: shop
fields:
- name: order
type: string
- name: paid
type: boolean
name: persistent-shop-orders-paid
title: persistent://shop/orders/paid
summary: "Schema read from Pulsar's own registry: JSON, version 0."
x-kurkik:
pulsar:
message:
schemaType: JSON
schemaVersion: 0
schemaIdLocation: metadata
schemaLookupStrategy: topic
schemaCompatibility: BACKWARD
key:
type: string
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/paid
tenant: shop
namespace: orders
persistence: persistent
partitions: 2
geo-replication:
- standalone
topicConfiguration:
partitions: 2
persistence: persistent
replication-clusters:
- standalone
schema-autoupdate: "on"
schema-compatibility-strategy: BACKWARD
operations:
receive_persistent-shop-orders-created:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
groupId:
type: string
enum:
- billing
clientId:
type: string
enum:
- billing-1
security:
- audit
- billing
consumerConfiguration: {}
receive_persistent-shop-orders-paid:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
groupId:
type: string
enum:
- billing
security:
- billing
consumerConfiguration: {}
send_persistent-shop-orders-created:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
clientId:
type: string
enum:
- checkout-1
security:
- checkout
producerConfiguration: {}
send_persistent-shop-orders-paid:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
clientId:
type: string
enum:
- payments-1
security:
- checkout
producerConfiguration: {}

Download asyncapi.yaml

  • One server, standalone, named after the cluster: a Pulsar cluster’s brokers share its metadata, so they are listed in x-kurkik.pulsar.server.brokers, not written as servers.
  • No channel has servers: the one cluster holds every topic.
  • Everything of acls, consumers and registry together: who may, who was seen, what travels.
  • The receive operation on created puts them side by side: groupId, clientId, security.
How to build this setup yourself

Clusters

Seed

Terminal window
pulsar-admin tenants create shop --allowed-clusters standalone --admin-roles shop-admin
pulsar-admin namespaces create shop/orders --clusters standalone
pulsar-admin topics create persistent://shop/orders/created
pulsar-admin topics create-partitioned-topic persistent://shop/orders/paid --partitions 2
Terminal window
pulsar-admin namespaces grant-permission shop/orders --role billing --actions consume
pulsar-admin namespaces grant-permission shop/orders --role checkout --actions produce
pulsar-admin namespaces grant-permission shop/orders --role ops --actions functions,sources,sinks
pulsar-admin topics grant-permission persistent://shop/orders/created --role audit --actions consume
pulsar-admin topics create-subscription persistent://shop/orders/paid --subscription billing --messageId earliest
# connected while exported: a Shared consumer `billing-1` on created (subscription billing), a producer `checkout-1` on created
pulsar-client consume persistent://shop/orders/created -s billing -t Shared -n 0 & # named billing-1 by the test's own client
pulsar-admin namespaces set-schema-compatibility-strategy shop/orders --compatibility BACKWARD
pulsar-admin schemas upload persistent://shop/orders/created -f order-avro.json # {"type":"AVRO","schema":"{...Order...}"}
pulsar-admin schemas upload persistent://shop/orders/paid -f payment-json.json # {"type":"JSON","schema":"{...Payment...}"}

Export

Terminal window
kurkik conn add pulsar standalone --admin-url http://pulsar-standalone:8080 --service-url pulsar://pulsar-standalone:6650
kurkik pulsar export standalone --acls --consumers
Show the document
asyncapi: 3.0.0
info:
title: east Apache Pulsar API
version: 1.0.0-SNAPSHOT
description: "Generated by reading Apache Pulsar of east (http://pulsar-east:8080),\
\ and the clusters it replicates with: west (http://pulsar-west:8080)."
servers:
east:
host: pulsar-east:6650
protocol: pulsar
protocolVersion: "4.0"
description: Apache Pulsar cluster east.
bindings:
pulsar:
bindingVersion: 0.1.0
tenant: shop
x-kurkik:
pulsar:
server:
cluster: east
brokers:
- localhost:8080
schemaRegistryUrl: http://pulsar-east:8080
schemaRegistryVendor: pulsar
namespacePolicies:
public/default:
schema-autoupdate: "on"
shop/orders:
schema-autoupdate: "on"
schema-compatibility-strategy: BACKWARD
tenants:
- tenant: public
adminRoles: []
allowedClusters:
- east
- tenant: shop
adminRoles:
- shop-admin
allowedClusters:
- east
- west
security:
- security: NONE
tls: false
acl:
- role: billing
resourceType: namespace
name: shop/orders
actions:
- consume
- role: checkout
resourceType: namespace
name: shop/orders
actions:
- produce
- role: ops
resourceType: namespace
name: shop/orders
actions:
- functions
- sinks
- sources
- role: audit
resourceType: topic
name: persistent://shop/orders/created
actions:
- consume
consumers:
- subscription: billing
type: Shared
topics:
- persistent://shop/orders/created
- persistent://shop/orders/paid
consumers:
- billing-1
producers:
- producerName: checkout-1
accessMode: Shared
topics:
- persistent://shop/orders/created
- producerName: payments-1
accessMode: Shared
topics:
- persistent://shop/orders/paid
functions: []
sources: []
sinks: []
brokerConfiguration:
advertisedAddress: localhost
backlogQuotaDefaultLimitGB: "10.0"
bookkeeperClientMinNumRacksPerWriteQuorum: "1"
bookkeeperClientReorderReadSequenceEnabled: "false"
bookkeeperNumberOfChannelsPerBookie: "1"
clusterName: east
enablePackagesManagement: "true"
forceDeleteNamespaceAllowed: "true"
functionsWorkerEnablePackageManagement: "true"
isRunningStandalone: "true"
loadBalancerEnabled: "false"
loadManagerClassName: org.apache.pulsar.broker.loadbalance.NoopLoadManager
managedLedgerCacheEvictionFrequency: "100.0"
managedLedgerDefaultAckQuorum: "1"
managedLedgerDefaultEnsembleSize: "1"
managedLedgerDefaultMarkDeleteRateLimit: "0.1"
managedLedgerDefaultWriteQuorum: "1"
metadataStoreUrl: rocksdb:///pulsar/data/metadata
packagesManagementStorageProvider: org.apache.pulsar.packages.management.storage.filesystem.FileSystemPackagesStorageProvider
statusFilePath: /usr/local/apache/htdocs
topicPublisherThrottlingTickTimeMillis: "2"
webSocketServiceEnabled: "true"
clientConfiguration:
serviceUrl: pulsar://pulsar-east:6650
webServiceUrl: http://pulsar-east:8080
producerConfiguration: {}
consumerConfiguration: {}
west:
host: pulsar-west:6650
protocol: pulsar
protocolVersion: "4.0"
description: Apache Pulsar cluster west.
bindings:
pulsar:
bindingVersion: 0.1.0
tenant: shop
x-kurkik:
pulsar:
server:
cluster: west
brokers:
- localhost:8080
schemaRegistryUrl: http://pulsar-west:8080
schemaRegistryVendor: pulsar
namespacePolicies:
public/default:
schema-autoupdate: "on"
shop/orders:
schema-autoupdate: "on"
schema-compatibility-strategy: BACKWARD
tenants:
- tenant: public
adminRoles: []
allowedClusters:
- west
- tenant: shop
adminRoles:
- shop-admin
allowedClusters:
- east
- west
security:
- security: NONE
tls: false
acl:
- role: billing
resourceType: namespace
name: shop/orders
actions:
- consume
- role: checkout
resourceType: namespace
name: shop/orders
actions:
- produce
- role: ops
resourceType: namespace
name: shop/orders
actions:
- functions
- sinks
- sources
- role: audit
resourceType: topic
name: persistent://shop/orders/created
actions:
- consume
consumers:
- subscription: billing
type: Shared
topics:
- persistent://shop/orders/created
- persistent://shop/orders/paid
consumers:
- billing-1
producers:
- producerName: checkout-1
accessMode: Shared
topics:
- persistent://shop/orders/created
- producerName: payments-1
accessMode: Shared
topics:
- persistent://shop/orders/paid
functions: []
sources: []
sinks: []
brokerConfiguration:
advertisedAddress: localhost
backlogQuotaDefaultLimitGB: "10.0"
bookkeeperClientMinNumRacksPerWriteQuorum: "1"
bookkeeperClientReorderReadSequenceEnabled: "false"
bookkeeperNumberOfChannelsPerBookie: "1"
clusterName: west
enablePackagesManagement: "true"
forceDeleteNamespaceAllowed: "true"
functionsWorkerEnablePackageManagement: "true"
isRunningStandalone: "true"
loadBalancerEnabled: "false"
loadManagerClassName: org.apache.pulsar.broker.loadbalance.NoopLoadManager
managedLedgerCacheEvictionFrequency: "100.0"
managedLedgerDefaultAckQuorum: "1"
managedLedgerDefaultEnsembleSize: "1"
managedLedgerDefaultMarkDeleteRateLimit: "0.1"
managedLedgerDefaultWriteQuorum: "1"
metadataStoreUrl: rocksdb:///pulsar/data/metadata
packagesManagementStorageProvider: org.apache.pulsar.packages.management.storage.filesystem.FileSystemPackagesStorageProvider
statusFilePath: /usr/local/apache/htdocs
topicPublisherThrottlingTickTimeMillis: "2"
webSocketServiceEnabled: "true"
clientConfiguration:
serviceUrl: pulsar://pulsar-west:6650
webServiceUrl: http://pulsar-west:8080
producerConfiguration: {}
consumerConfiguration: {}
channels:
persistent-shop-orders-created:
address: persistent://shop/orders/created
messages:
persistent-shop-orders-created:
payload:
schemaFormat: application/vnd.apache.avro;version=1.9.0
schema:
type: record
name: Order
namespace: shop
fields:
- name: id
type: string
- name: total
type: double
name: persistent-shop-orders-created
title: persistent://shop/orders/created
summary: "Schema read from Pulsar's own registry: AVRO, version 0."
x-kurkik:
pulsar:
message:
schemaType: AVRO
schemaVersion: 0
schemaIdLocation: metadata
schemaLookupStrategy: topic
schemaCompatibility: BACKWARD
key:
type: string
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
geo-replication:
- east
- west
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/created
tenant: shop
namespace: orders
persistence: persistent
partitions: 0
geo-replication:
- east
- west
topicConfiguration:
partitions: 0
persistence: persistent
replication-clusters:
- east
- west
schema-autoupdate: "on"
schema-compatibility-strategy: BACKWARD
persistent-shop-orders-paid:
address: persistent://shop/orders/paid
messages:
persistent-shop-orders-paid:
payload:
schemaFormat: application/vnd.apache.avro;version=1.9.0
schema:
type: record
name: Payment
namespace: shop
fields:
- name: order
type: string
- name: paid
type: boolean
name: persistent-shop-orders-paid
title: persistent://shop/orders/paid
summary: "Schema read from Pulsar's own registry: JSON, version 0."
x-kurkik:
pulsar:
message:
schemaType: JSON
schemaVersion: 0
schemaIdLocation: metadata
schemaLookupStrategy: topic
schemaCompatibility: BACKWARD
key:
type: string
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
geo-replication:
- east
- west
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/paid
tenant: shop
namespace: orders
persistence: persistent
partitions: 2
geo-replication:
- east
- west
topicConfiguration:
partitions: 2
persistence: persistent
replication-clusters:
- east
- west
schema-autoupdate: "on"
schema-compatibility-strategy: BACKWARD
operations:
receive_persistent-shop-orders-created:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
groupId:
type: string
enum:
- billing
clientId:
type: string
enum:
- billing-1
security:
- audit
- billing
consumerConfiguration: {}
receive_persistent-shop-orders-paid:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
groupId:
type: string
enum:
- billing
security:
- billing
consumerConfiguration: {}
send_persistent-shop-orders-created:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
clientId:
type: string
enum:
- checkout-1
security:
- checkout
producerConfiguration: {}
send_persistent-shop-orders-paid:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
clientId:
type: string
enum:
- payments-1
security:
- checkout
producerConfiguration: {}

Download

How to build this setup yourself

Clusters

Terminal window
pulsar-admin --admin-url http://pulsar-east:8080 clusters create west --url http://pulsar-west:8080 --broker-url pulsar://pulsar-west:6650
pulsar-admin --admin-url http://pulsar-west:8080 clusters create east --url http://pulsar-east:8080 --broker-url pulsar://pulsar-east:6650

Seed

Terminal window
pulsar-admin tenants create shop --allowed-clusters east,west --admin-roles shop-admin
pulsar-admin namespaces create shop/orders --clusters east,west
pulsar-admin topics create persistent://shop/orders/created
pulsar-admin topics create-partitioned-topic persistent://shop/orders/paid --partitions 2
Terminal window
pulsar-admin namespaces grant-permission shop/orders --role billing --actions consume
pulsar-admin namespaces grant-permission shop/orders --role checkout --actions produce
pulsar-admin namespaces grant-permission shop/orders --role ops --actions functions,sources,sinks
pulsar-admin topics grant-permission persistent://shop/orders/created --role audit --actions consume
pulsar-admin topics create-subscription persistent://shop/orders/paid --subscription billing --messageId earliest
# connected while exported: a Shared consumer `billing-1` on created (subscription billing), a producer `checkout-1` on created
pulsar-client consume persistent://shop/orders/created -s billing -t Shared -n 0 & # named billing-1 by the test's own client
pulsar-admin namespaces set-schema-compatibility-strategy shop/orders --compatibility BACKWARD
pulsar-admin schemas upload persistent://shop/orders/created -f order-avro.json # {"type":"AVRO","schema":"{...Order...}"}
pulsar-admin schemas upload persistent://shop/orders/paid -f payment-json.json # {"type":"JSON","schema":"{...Payment...}"}

Export

Terminal window
kurkik conn add pulsar east --admin-url http://pulsar-east:8080 --service-url pulsar://pulsar-east:6650
kurkik pulsar export east --acls --consumers
Show the document
asyncapi: 3.0.0
info:
title: east Apache Pulsar API
version: 1.0.0-SNAPSHOT
description: "Generated by reading Apache Pulsar of east (http://pulsar-east:8080),\
\ and the clusters it replicates with: west (http://pulsar-west:8080)."
servers:
east:
host: pulsar-east:6650
protocol: pulsar
protocolVersion: "4.0"
description: Apache Pulsar cluster east.
bindings:
pulsar:
bindingVersion: 0.1.0
tenant: shop
x-kurkik:
pulsar:
server:
cluster: east
brokers:
- localhost:8080
schemaRegistryUrl: http://pulsar-east:8080
schemaRegistryVendor: pulsar
namespacePolicies:
public/default:
schema-autoupdate: "on"
shop/east-only:
schema-autoupdate: "on"
shop/orders:
schema-autoupdate: "on"
schema-compatibility-strategy: BACKWARD
tenants:
- tenant: public
adminRoles: []
allowedClusters:
- east
- tenant: shop
adminRoles:
- shop-admin
allowedClusters:
- east
- west
security:
- security: NONE
tls: false
acl:
- role: east-team
resourceType: namespace
name: shop/east-only
actions:
- consume
- produce
- role: billing
resourceType: namespace
name: shop/orders
actions:
- consume
- role: checkout
resourceType: namespace
name: shop/orders
actions:
- produce
- role: ops
resourceType: namespace
name: shop/orders
actions:
- functions
- sinks
- sources
- role: audit
resourceType: topic
name: persistent://shop/orders/created
actions:
- consume
consumers:
- subscription: billing
type: Shared
topics:
- persistent://shop/orders/created
- persistent://shop/orders/paid
consumers:
- billing-1
- subscription: east-reports
topics:
- persistent://shop/east-only/records
consumers: []
producers:
- producerName: checkout-east
accessMode: Shared
topics:
- persistent://shop/orders/created
- producerName: payments-east
accessMode: Shared
topics:
- persistent://shop/orders/paid
functions: []
sources: []
sinks: []
brokerConfiguration:
advertisedAddress: localhost
backlogQuotaDefaultLimitGB: "10.0"
bookkeeperClientMinNumRacksPerWriteQuorum: "1"
bookkeeperClientReorderReadSequenceEnabled: "false"
bookkeeperNumberOfChannelsPerBookie: "1"
clusterName: east
enablePackagesManagement: "true"
forceDeleteNamespaceAllowed: "true"
functionsWorkerEnablePackageManagement: "true"
isRunningStandalone: "true"
loadBalancerEnabled: "false"
loadManagerClassName: org.apache.pulsar.broker.loadbalance.NoopLoadManager
managedLedgerCacheEvictionFrequency: "100.0"
managedLedgerDefaultAckQuorum: "1"
managedLedgerDefaultEnsembleSize: "1"
managedLedgerDefaultMarkDeleteRateLimit: "0.1"
managedLedgerDefaultWriteQuorum: "1"
metadataStoreUrl: rocksdb:///pulsar/data/metadata
packagesManagementStorageProvider: org.apache.pulsar.packages.management.storage.filesystem.FileSystemPackagesStorageProvider
statusFilePath: /usr/local/apache/htdocs
topicPublisherThrottlingTickTimeMillis: "2"
webSocketServiceEnabled: "true"
clientConfiguration:
serviceUrl: pulsar://pulsar-east:6650
webServiceUrl: http://pulsar-east:8080
producerConfiguration: {}
consumerConfiguration: {}
west:
host: pulsar-west:6650
protocol: pulsar
protocolVersion: "4.0"
description: Apache Pulsar cluster west.
bindings:
pulsar:
bindingVersion: 0.1.0
tenant: shop
x-kurkik:
pulsar:
server:
cluster: west
brokers:
- localhost:8080
schemaRegistryUrl: http://pulsar-west:8080
schemaRegistryVendor: pulsar
namespacePolicies:
public/default:
schema-autoupdate: "on"
shop/orders:
schema-autoupdate: "on"
schema-compatibility-strategy: BACKWARD
shop/west-only:
schema-autoupdate: "on"
tenants:
- tenant: public
adminRoles: []
allowedClusters:
- west
- tenant: shop
adminRoles:
- shop-admin
allowedClusters:
- east
- west
security:
- security: NONE
tls: false
acl:
- role: billing
resourceType: namespace
name: shop/orders
actions:
- consume
- role: checkout
resourceType: namespace
name: shop/orders
actions:
- produce
- role: ops
resourceType: namespace
name: shop/orders
actions:
- functions
- sinks
- sources
- role: west-team
resourceType: namespace
name: shop/west-only
actions:
- consume
- produce
- role: audit
resourceType: topic
name: persistent://shop/orders/created
actions:
- consume
consumers:
- subscription: billing
type: Shared
topics:
- persistent://shop/orders/created
- persistent://shop/orders/paid
consumers:
- billing-1
- subscription: west-reports
topics:
- persistent://shop/west-only/records
consumers: []
producers:
- producerName: checkout-west
accessMode: Shared
topics:
- persistent://shop/orders/created
- producerName: payments-west
accessMode: Shared
topics:
- persistent://shop/orders/paid
functions: []
sources: []
sinks: []
brokerConfiguration:
advertisedAddress: localhost
backlogQuotaDefaultLimitGB: "10.0"
bookkeeperClientMinNumRacksPerWriteQuorum: "1"
bookkeeperClientReorderReadSequenceEnabled: "false"
bookkeeperNumberOfChannelsPerBookie: "1"
clusterName: west
enablePackagesManagement: "true"
forceDeleteNamespaceAllowed: "true"
functionsWorkerEnablePackageManagement: "true"
isRunningStandalone: "true"
loadBalancerEnabled: "false"
loadManagerClassName: org.apache.pulsar.broker.loadbalance.NoopLoadManager
managedLedgerCacheEvictionFrequency: "100.0"
managedLedgerDefaultAckQuorum: "1"
managedLedgerDefaultEnsembleSize: "1"
managedLedgerDefaultMarkDeleteRateLimit: "0.1"
managedLedgerDefaultWriteQuorum: "1"
metadataStoreUrl: rocksdb:///pulsar/data/metadata
packagesManagementStorageProvider: org.apache.pulsar.packages.management.storage.filesystem.FileSystemPackagesStorageProvider
statusFilePath: /usr/local/apache/htdocs
topicPublisherThrottlingTickTimeMillis: "2"
webSocketServiceEnabled: "true"
clientConfiguration:
serviceUrl: pulsar://pulsar-west:6650
webServiceUrl: http://pulsar-west:8080
producerConfiguration: {}
consumerConfiguration: {}
channels:
persistent-shop-east-only-records:
address: persistent://shop/east-only/records
servers:
- $ref: "#/servers/east"
messages:
persistent-shop-east-only-records:
payload:
type: string
name: persistent-shop-east-only-records
title: persistent://shop/east-only/records
summary: "Schema read from Pulsar's own registry: STRING, version 0."
x-kurkik:
pulsar:
message:
schemaType: STRING
schemaVersion: 0
schemaIdLocation: metadata
schemaLookupStrategy: topic
schemaCompatibility: FULL
key:
type: string
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: east-only
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/east-only/records
tenant: shop
namespace: east-only
persistence: persistent
partitions: 0
geo-replication:
- east
topicConfiguration:
partitions: 0
persistence: persistent
replication-clusters:
- east
schema-autoupdate: "on"
persistent-shop-orders-created:
address: persistent://shop/orders/created
messages:
persistent-shop-orders-created:
payload:
schemaFormat: application/vnd.apache.avro;version=1.9.0
schema:
type: record
name: Order
namespace: shop
fields:
- name: id
type: string
- name: total
type: double
name: persistent-shop-orders-created
title: persistent://shop/orders/created
summary: "Schema read from Pulsar's own registry: AVRO, version 0."
x-kurkik:
pulsar:
message:
schemaType: AVRO
schemaVersion: 0
schemaIdLocation: metadata
schemaLookupStrategy: topic
schemaCompatibility: BACKWARD
key:
type: string
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
geo-replication:
- east
- west
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/created
tenant: shop
namespace: orders
persistence: persistent
partitions: 0
geo-replication:
- east
- west
topicConfiguration:
partitions: 0
persistence: persistent
replication-clusters:
- east
- west
schema-autoupdate: "on"
schema-compatibility-strategy: BACKWARD
persistent-shop-orders-paid:
address: persistent://shop/orders/paid
messages:
persistent-shop-orders-paid:
payload:
schemaFormat: application/vnd.apache.avro;version=1.9.0
schema:
type: record
name: Payment
namespace: shop
fields:
- name: order
type: string
- name: paid
type: boolean
name: persistent-shop-orders-paid
title: persistent://shop/orders/paid
summary: "Schema read from Pulsar's own registry: JSON, version 0."
x-kurkik:
pulsar:
message:
schemaType: JSON
schemaVersion: 0
schemaIdLocation: metadata
schemaLookupStrategy: topic
schemaCompatibility: BACKWARD
key:
type: string
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: orders
persistence: persistent
geo-replication:
- east
- west
x-kurkik:
pulsar:
channel:
topic: persistent://shop/orders/paid
tenant: shop
namespace: orders
persistence: persistent
partitions: 2
geo-replication:
- east
- west
topicConfiguration:
partitions: 2
persistence: persistent
replication-clusters:
- east
- west
schema-autoupdate: "on"
schema-compatibility-strategy: BACKWARD
persistent-shop-west-only-records:
address: persistent://shop/west-only/records
servers:
- $ref: "#/servers/west"
messages:
persistent-shop-west-only-records:
payload:
type: string
name: persistent-shop-west-only-records
title: persistent://shop/west-only/records
summary: "Schema read from Pulsar's own registry: STRING, version 0."
x-kurkik:
pulsar:
message:
schemaType: STRING
schemaVersion: 0
schemaIdLocation: metadata
schemaLookupStrategy: topic
schemaCompatibility: FULL
key:
type: string
bindings:
pulsar:
bindingVersion: 0.1.0
namespace: west-only
persistence: persistent
x-kurkik:
pulsar:
channel:
topic: persistent://shop/west-only/records
tenant: shop
namespace: west-only
persistence: persistent
partitions: 0
geo-replication:
- west
topicConfiguration:
partitions: 0
persistence: persistent
replication-clusters:
- west
schema-autoupdate: "on"
operations:
receive_persistent-shop-east-only-records:
action: receive
channel:
$ref: "#/channels/persistent-shop-east-only-records"
x-kurkik:
pulsar:
operation:
groupId:
type: string
enum:
- east-reports
security:
- east-team
consumerConfiguration: {}
receive_persistent-shop-orders-created:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
groupId:
type: string
enum:
- billing
clientId:
type: string
enum:
- billing-1
security:
- audit
- billing
consumerConfiguration: {}
receive_persistent-shop-orders-paid:
action: receive
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
groupId:
type: string
enum:
- billing
security:
- billing
consumerConfiguration: {}
receive_persistent-shop-west-only-records:
action: receive
channel:
$ref: "#/channels/persistent-shop-west-only-records"
x-kurkik:
pulsar:
operation:
groupId:
type: string
enum:
- west-reports
security:
- west-team
consumerConfiguration: {}
send_persistent-shop-east-only-records:
action: send
channel:
$ref: "#/channels/persistent-shop-east-only-records"
x-kurkik:
pulsar:
operation:
security:
- east-team
producerConfiguration: {}
send_persistent-shop-orders-created:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-created"
x-kurkik:
pulsar:
operation:
clientId:
type: string
enum:
- checkout-east
- checkout-west
security:
- checkout
producerConfiguration: {}
send_persistent-shop-orders-paid:
action: send
channel:
$ref: "#/channels/persistent-shop-orders-paid"
x-kurkik:
pulsar:
operation:
clientId:
type: string
enum:
- payments-east
- payments-west
security:
- checkout
producerConfiguration: {}
send_persistent-shop-west-only-records:
action: send
channel:
$ref: "#/channels/persistent-shop-west-only-records"
x-kurkik:
pulsar:
operation:
security:
- west-team
producerConfiguration: {}

Download

How to build this setup yourself

Clusters

Terminal window
pulsar-admin --admin-url http://pulsar-east:8080 clusters create west --url http://pulsar-west:8080 --broker-url pulsar://pulsar-west:6650
pulsar-admin --admin-url http://pulsar-west:8080 clusters create east --url http://pulsar-east:8080 --broker-url pulsar://pulsar-east:6650

Seed

Terminal window
pulsar-admin tenants create shop --allowed-clusters east,west --admin-roles shop-admin
pulsar-admin namespaces create shop/orders --clusters east,west
pulsar-admin topics create persistent://shop/orders/created
pulsar-admin topics create-partitioned-topic persistent://shop/orders/paid --partitions 2
pulsar-admin --admin-url http://pulsar-east:8080 namespaces create shop/east-only --clusters east
pulsar-admin --admin-url http://pulsar-east:8080 topics create persistent://shop/east-only/records
pulsar-admin --admin-url http://pulsar-west:8080 namespaces create shop/west-only --clusters west
pulsar-admin --admin-url http://pulsar-west:8080 topics create persistent://shop/west-only/records
Terminal window
pulsar-admin namespaces grant-permission shop/orders --role billing --actions consume
pulsar-admin namespaces grant-permission shop/orders --role checkout --actions produce
pulsar-admin namespaces grant-permission shop/orders --role ops --actions functions,sources,sinks
pulsar-admin topics grant-permission persistent://shop/orders/created --role audit --actions consume
pulsar-admin topics create-subscription persistent://shop/orders/paid --subscription billing --messageId earliest
# connected while exported: a Shared consumer `billing-1` on created (subscription billing), a producer on created (`checkout-east`, `checkout-west`)
pulsar-client consume persistent://shop/orders/created -s billing -t Shared -n 0 & # named billing-1 by the test's own client
pulsar-admin namespaces set-schema-compatibility-strategy shop/orders --compatibility BACKWARD
pulsar-admin schemas upload persistent://shop/orders/created -f order-avro.json # {"type":"AVRO","schema":"{...Order...}"}
pulsar-admin schemas upload persistent://shop/orders/paid -f payment-json.json # {"type":"JSON","schema":"{...Payment...}"}

Export

Terminal window
kurkik conn add pulsar east --admin-url http://pulsar-east:8080 --service-url pulsar://pulsar-east:6650
kurkik pulsar export east --acls --consumers

All flags: kurkik pulsar export · more Apache Pulsar export examples