blob: eb772878491a1d58462a93555ca6b05d7a5585d6 [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Managing Namespaces · Apache Pulsar</title><meta name="viewport" content="width=device-width, initial-scale=1.0"/><meta name="generator" content="Docusaurus"/><meta name="description" content="Pulsar [namespaces](/docs/en/2.8.0/reference-terminology#namespace) are logical groupings of [topics](/docs/en/2.8.0/reference-terminology#topic)."/><meta name="docsearch:version" content="2.8.0"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="Managing Namespaces · Apache Pulsar"/><meta property="og:type" content="website"/><meta property="og:url" content="https://pulsar.apache.org/"/><meta property="og:description" content="Pulsar [namespaces](/docs/en/2.8.0/reference-terminology#namespace) are logical groupings of [topics](/docs/en/2.8.0/reference-terminology#topic)."/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://pulsar.apache.org/img/pulsar.svg"/><link rel="shortcut icon" href="/img/pulsar.ico"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://pulsar.apache.org/blog/atom.xml" title="Apache Pulsar Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://pulsar.apache.org/blog/feed.xml" title="Apache Pulsar Blog RSS Feed"/><link rel="stylesheet" href="/css/code-blocks-buttons.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="/js/custom.js"></script><script src="/js/scrollSpy.js"></script><link rel="stylesheet" href="/css/main.css"/><script src="/js/codetabs.js"></script></head><body class="sideNavVisible separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/en"><img class="logo" src="/img/pulsar.svg" alt="Apache Pulsar"/></a><a href="/en/versions"><h3>2.8.0</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/en/2.8.0/getting-started-standalone" target="_self">Docs</a></li><li class=""><a href="/en/download" target="_self">Download</a></li><li class="siteNavGroupActive"><a href="/docs/en/2.8.0/client-libraries" target="_self">Clients</a></li><li class=""><a href="#restapis" target="_self">REST APIs</a></li><li class=""><a href="#cli" target="_self">Cli</a></li><li class=""><a href="/blog/" target="_self">Blog</a></li><li class=""><a href="#community" target="_self">Community</a></li><li class=""><a href="#apache" target="_self">Apache</a></li><li class=""><a href="https://pulsar-next.staged.apache.org/" target="_self">New Website (Beta)</a></li><span><li><a id="languages-menu" href="#"><img class="languages-icon" src="/img/language.svg" alt="Languages icon"/>English</a><div id="languages-dropdown" class="hide"><ul id="languages-dropdown-items"><li><a href="/docs/ja/2.8.0/admin-api-namespaces">日本語</a></li><li><a href="/docs/fr/2.8.0/admin-api-namespaces">Français</a></li><li><a href="/docs/ko/2.8.0/admin-api-namespaces">한국어</a></li><li><a href="/docs/zh-CN/2.8.0/admin-api-namespaces">中文</a></li><li><a href="/docs/zh-TW/2.8.0/admin-api-namespaces">繁體中文</a></li><li><a href="https://crowdin.com/project/apache-pulsar" target="_blank" rel="noreferrer noopener">Help Translate</a></li></ul></div></li><script>
const languagesMenuItem = document.getElementById("languages-menu");
const languagesDropDown = document.getElementById("languages-dropdown");
languagesMenuItem.addEventListener("click", function(event) {
event.preventDefault();
if (languagesDropDown.className == "hide") {
languagesDropDown.className = "visible";
} else {
languagesDropDown.className = "hide";
}
});
</script></span></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><div class="hamburger-menu"><div class="line1"></div><div class="line2"></div><div class="line3"></div></div></div><h2><i></i><span>Admin API</span></h2><div class="tocToggler" id="tocToggler"><i class="icon-toc"></i></div></div><div class="navGroups"><div class="navGroup"><h3 class="navGroupCategoryTitle">Get Started</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/getting-started-standalone">Run Pulsar locally</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/getting-started-docker">Run Pulsar in Docker</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/getting-started-helm">Run Pulsar in Kubernetes</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Concepts and Architecture</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/concepts-overview">Overview</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/concepts-messaging">Messaging</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/concepts-architecture-overview">Architecture</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/concepts-clients">Clients</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/concepts-replication">Geo Replication</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/concepts-multi-tenancy">Multi Tenancy</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/concepts-authentication">Authentication and Authorization</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/concepts-topic-compaction">Topic Compaction</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/concepts-proxy-sni-routing">Proxy support with SNI routing</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/concepts-multiple-advertised-listeners">Multiple advertised listeners</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Pulsar Schema</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/schema-get-started">Get started</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/schema-understand">Understand schema</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/schema-evolution-compatibility">Schema evolution and compatibility</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/schema-manage">Manage schema</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Pulsar Functions</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/functions-overview">Overview</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/functions-runtime">Setup: Configure Functions runtime</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/functions-worker">Setup: Pulsar Functions Worker</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/functions-develop">How-to: Develop</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/functions-package">How-to: Package</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/functions-debug">How-to: Debug</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/functions-deploy">How-to: Deploy</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/functions-cli">Reference: CLI</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/window-functions-context">Window Functions: Context</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Pulsar IO</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/io-overview">Overview</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/io-quickstart">Get started</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/io-use">Use</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/io-debug">Debug</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/io-connectors">Built-in connector</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/io-cdc">CDC connector</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/io-develop">Develop</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/io-cli">CLI</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Pulsar SQL</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/sql-overview">Overview</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/sql-getting-started">Query data</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/sql-deployment-configurations">Configuration and deployment</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/sql-rest-api">REST APIs</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Tiered Storage</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/tiered-storage-overview">Overview</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/tiered-storage-aws">AWS S3 offloader</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/tiered-storage-gcs">GCS offloader</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/tiered-storage-filesystem">Filesystem offloader</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/tiered-storage-azure">Azure BlobStore offloader</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/tiered-storage-aliyun">Aliyun OSS offloader</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Transactions</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/txn-why">Why transactions?</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/txn-what">What are transactions?</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/txn-how">How transactions work?</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/txn-use">How to use transactions?</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/txn-monitor">How to monitor transactions?</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Kubernetes (Helm)</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/helm-overview">Overview</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/helm-prepare">Prepare</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/helm-install">Install</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/helm-deploy">Deployment</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/helm-upgrade">Upgrade</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/helm-tools">Required Tools</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Deployment</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/deploy-aws">Amazon Web Services</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/deploy-kubernetes">Kubernetes</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/deploy-bare-metal">Bare metal</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/deploy-bare-metal-multi-cluster">Bare metal multi-cluster</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/deploy-docker">Docker</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/deploy-monitoring">Monitor</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Administration</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/administration-zk-bk">ZooKeeper and BookKeeper</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/administration-geo">Geo-replication</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/administration-pulsar-manager">Pulsar Manager</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/administration-stats">Pulsar statistics</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/administration-load-balance">Load balance</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/administration-proxy">Pulsar proxy</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/administration-upgrade">Upgrade</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/administration-isolation">Pulsar isolation</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Security</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/security-overview">Overview</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/security-tls-transport">Transport Encryption using TLS</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/security-tls-authentication">Authentication using TLS</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/security-tls-keystore">Using TLS with KeyStore configure</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/security-jwt">Authentication using JWT</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/security-athenz">Authentication using Athenz</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/security-kerberos">Authentication using Kerberos</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/security-oauth2">Authentication using OAuth 2.0 access tokens</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/security-authorization">Authorization and ACLs</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/security-encryption">End-to-End Encryption</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/security-extending">Extending</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/security-bouncy-castle">Bouncy Castle Providers</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Performance</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/performance-pulsar-perf">Pulsar Perf</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Client Libraries</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/client-libraries">Overview</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/client-libraries-java">Java</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/client-libraries-go">Go</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/client-libraries-python">Python</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/client-libraries-cpp">C++</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/client-libraries-node">Node.js</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/client-libraries-websocket">WebSocket</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/client-libraries-dotnet">C#</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Admin API</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/admin-api-overview">Overview</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/admin-api-clusters">Clusters</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/admin-api-tenants">Tenants</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/admin-api-brokers">Brokers</a></li><li class="navListItem navListItemActive"><a class="navItem" href="/docs/en/2.8.0/admin-api-namespaces">Namespaces</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/admin-api-permissions">Permissions</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/admin-api-topics">Topics</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/admin-api-functions">Functions</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/admin-api-packages">Packages</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Adaptors</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/adaptors-kafka">Kafka client wrapper</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/adaptors-spark">Apache Spark</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/adaptors-storm">Apache Storm</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Cookbooks</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/cookbooks-compaction">Topic compaction</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/cookbooks-deduplication">Message deduplication</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/cookbooks-non-persistent">Non-persistent messaging</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/cookbooks-retention-expiry">Message retention and expiry</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/cookbooks-encryption">Encryption</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/cookbooks-message-queue">Message queue</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/cookbooks-bookkeepermetadata">BookKeeper Ledger Metadata</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Development</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/develop-tools">Simulation tools</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/developing-binary-protocol">Binary protocol</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/develop-schema">Custom schema storage</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/develop-load-manager">Modular load manager</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Reference</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/reference-terminology">Terminology</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/reference-cli-tools">Pulsar CLI tools</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/reference-configuration">Pulsar configuration</a></li><li class="navListItem"><a class="navItem" href="/docs/en/2.8.0/reference-metrics">Pulsar Metrics</a></li></ul></div></div></section></div><script>
var coll = document.getElementsByClassName('collapsible');
var checkActiveCategory = true;
for (var i = 0; i < coll.length; i++) {
var links = coll[i].nextElementSibling.getElementsByTagName('*');
if (checkActiveCategory){
for (var j = 0; j < links.length; j++) {
if (links[j].classList.contains('navListItemActive')){
coll[i].nextElementSibling.classList.toggle('hide');
coll[i].childNodes[1].classList.toggle('rotate');
checkActiveCategory = false;
break;
}
}
}
coll[i].addEventListener('click', function() {
var arrow = this.childNodes[1];
arrow.classList.toggle('rotate');
var content = this.nextElementSibling;
content.classList.toggle('hide');
});
}
document.addEventListener('DOMContentLoaded', function() {
createToggler('#navToggler', '#docsNav', 'docsSliderActive');
createToggler('#tocToggler', 'body', 'tocActive');
var headings = document.querySelector('.toc-headings');
headings && headings.addEventListener('click', function(event) {
var el = event.target;
while(el !== headings){
if (el.tagName === 'A') {
document.body.classList.remove('tocActive');
break;
} else{
el = el.parentNode;
}
}
}, false);
function createToggler(togglerSelector, targetSelector, className) {
var toggler = document.querySelector(togglerSelector);
var target = document.querySelector(targetSelector);
if (!toggler) {
return;
}
toggler.onclick = function(event) {
event.preventDefault();
target.classList.toggle(className);
};
}
});
</script></nav></div><div class="container mainContainer docsContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/apache/pulsar/edit/master/site2/docs/admin-api-namespaces.md" target="_blank" rel="noreferrer noopener">Edit</a><h1 id="__docusaurus" class="postHeaderTitle">Managing Namespaces</h1></header><article><div><span><p>Pulsar <a href="/docs/en/2.8.0/reference-terminology#namespace">namespaces</a> are logical groupings of <a href="/docs/en/2.8.0/reference-terminology#topic">topics</a>.</p>
<p>Namespaces can be managed via:</p>
<ul>
<li>The <a href="/docs/en/2.8.0/reference-pulsar-admin#clusters"><code>namespaces</code></a> command of the <a href="/docs/en/2.8.0/reference-pulsar-admin"><code>pulsar-admin</code></a> tool</li>
<li>The <code>/admin/v2/namespaces</code> endpoint of the admin <a href="https://pulsar.apache.org/admin-rest-api#/">REST</a>
API</li>
<li>The <code>namespaces</code> method of the <a href="https://pulsar.apache.org/api/admin/2.8.0-SNAPSHOT/org/apache/pulsar/client/admin/PulsarAdmin">PulsarAdmin</a>
object in the <a href="/docs/en/2.8.0/client-libraries-java">Java API</a></li>
</ul>
<h2><a class="anchor" aria-hidden="true" id="namespaces-resources"></a><a href="#namespaces-resources" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Namespaces resources</h2>
<h3><a class="anchor" aria-hidden="true" id="create-namespaces"></a><a href="#create-namespaces" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Create namespaces</h3>
<p>You can create new namespaces under a given <a href="/docs/en/2.8.0/reference-terminology#tenant">tenant</a>.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5567-tab-5568" class="nav-link active" data-group="group_5567" data-tab="tab-group-5567-content-5568">pulsar-admin</div><div id="tab-group-5567-tab-5569" class="nav-link" data-group="group_5567" data-tab="tab-group-5567-content-5569">REST API</div><div id="tab-group-5567-tab-5570" class="nav-link" data-group="group_5567" data-tab="tab-group-5567-content-5570">Java</div></div><div class="tab-content"><div id="tab-group-5567-content-5568" class="tab-pane active" data-group="group_5567" tabindex="-1"><div><span><p>Use the <a href="/docs/en/2.8.0/reference-pulsar-admin#namespaces-create"><code>create</code></a> subcommand and specify the namespace by name:</p>
<pre><code class="hljs css language-shell"><span class="hljs-meta">$</span><span class="bash"> pulsar-admin namespaces create <span class="hljs-built_in">test</span>-tenant/<span class="hljs-built_in">test</span>-namespace</span><br /></code></pre>
</span></div></div><div id="tab-group-5567-content-5569" class="tab-pane" data-group="group_5567" tabindex="-1"><div><span><p><a href="https://pulsar.apache.org/admin-rest-api#operation/createNamespace?version=2.8.0&amp;apiVersion=v2"><b>PUT</b> <i>/admin/v2/namespaces/:tenant/:namespace</i></a>
</p>
</span></div></div><div id="tab-group-5567-content-5570" class="tab-pane" data-group="group_5567" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().createNamespace(namespace);<br /></code></pre>
</span></div></div></div></div>
<h3><a class="anchor" aria-hidden="true" id="get-policies"></a><a href="#get-policies" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Get policies</h3>
<p>You can fetch the current policies associated with a namespace at any time.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5571-tab-5572" class="nav-link active" data-group="group_5571" data-tab="tab-group-5571-content-5572">pulsar-admin</div><div id="tab-group-5571-tab-5573" class="nav-link" data-group="group_5571" data-tab="tab-group-5571-content-5573">REST API</div><div id="tab-group-5571-tab-5574" class="nav-link" data-group="group_5571" data-tab="tab-group-5571-content-5574">Java</div></div><div class="tab-content"><div id="tab-group-5571-content-5572" class="tab-pane active" data-group="group_5571" tabindex="-1"><div><span><p>Use the <a href="/docs/en/2.8.0/reference-pulsar-admin#namespaces-policies"><code>policies</code></a> subcommand and specify the namespace:</p>
<pre><code class="hljs css language-shell"><span class="hljs-meta">$</span><span class="bash"> pulsar-admin namespaces policies <span class="hljs-built_in">test</span>-tenant/<span class="hljs-built_in">test</span>-namespace</span><br />{<br /> "auth_policies": {<br /> "namespace_auth": {},<br /> "destination_auth": {}<br /> },<br /> "replication_clusters": [],<br /> "bundles_activated": true,<br /> "bundles": {<br /> "boundaries": [<br /> "0x00000000",<br /> "0xffffffff"<br /> ],<br /> "numBundles": 1<br /> },<br /> "backlog_quota_map": {},<br /> "persistence": null,<br /> "latency_stats_sample_rate": {},<br /> "message_ttl_in_seconds": 0,<br /> "retention_policies": null,<br /> "deleted": false<br />}<br /></code></pre>
</span></div></div><div id="tab-group-5571-content-5573" class="tab-pane" data-group="group_5571" tabindex="-1"><div><span><p><a href="https://pulsar.apache.org/admin-rest-api#operation/getPolicies?version=2.8.0&amp;apiVersion=v2"><b>GET</b> <i>/admin/v2/namespaces/:tenant/:namespace</i></a>
</p>
</span></div></div><div id="tab-group-5571-content-5574" class="tab-pane" data-group="group_5571" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().getPolicies(namespace);<br /></code></pre>
</span></div></div></div></div>
<h3><a class="anchor" aria-hidden="true" id="list-namespaces"></a><a href="#list-namespaces" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>List namespaces</h3>
<p>You can list all namespaces within a given Pulsar <a href="/docs/en/2.8.0/reference-terminology#tenant">tenant</a>.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5575-tab-5576" class="nav-link active" data-group="group_5575" data-tab="tab-group-5575-content-5576">pulsar-admin</div><div id="tab-group-5575-tab-5577" class="nav-link" data-group="group_5575" data-tab="tab-group-5575-content-5577">REST API</div><div id="tab-group-5575-tab-5578" class="nav-link" data-group="group_5575" data-tab="tab-group-5575-content-5578">Java</div></div><div class="tab-content"><div id="tab-group-5575-content-5576" class="tab-pane active" data-group="group_5575" tabindex="-1"><div><span><p>Use the <a href="/docs/en/2.8.0/reference-pulsar-admin#namespaces-list"><code>list</code></a> subcommand and specify the tenant:</p>
<pre><code class="hljs css language-shell"><span class="hljs-meta">$</span><span class="bash"> pulsar-admin namespaces list <span class="hljs-built_in">test</span>-tenant</span><br />test-tenant/ns1<br />test-tenant/ns2<br /></code></pre>
</span></div></div><div id="tab-group-5575-content-5577" class="tab-pane" data-group="group_5575" tabindex="-1"><div><span><p><a href="https://pulsar.apache.org/admin-rest-api#operation/getTenantNamespaces?version=2.8.0&amp;apiVersion=v2"><b>GET</b> <i>/admin/v2/namespaces/:tenant</i></a>
</p>
</span></div></div><div id="tab-group-5575-content-5578" class="tab-pane" data-group="group_5575" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().getNamespaces(tenant);<br /></code></pre>
</span></div></div></div></div>
<h3><a class="anchor" aria-hidden="true" id="delete-namespaces"></a><a href="#delete-namespaces" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Delete namespaces</h3>
<p>You can delete existing namespaces from a tenant.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5579-tab-5580" class="nav-link active" data-group="group_5579" data-tab="tab-group-5579-content-5580">pulsar-admin</div><div id="tab-group-5579-tab-5581" class="nav-link" data-group="group_5579" data-tab="tab-group-5579-content-5581">REST API</div><div id="tab-group-5579-tab-5582" class="nav-link" data-group="group_5579" data-tab="tab-group-5579-content-5582">Java</div></div><div class="tab-content"><div id="tab-group-5579-content-5580" class="tab-pane active" data-group="group_5579" tabindex="-1"><div><span><p>Use the <a href="/docs/en/2.8.0/reference-pulsar-admin#namespaces-delete"><code>delete</code></a> subcommand and specify the namespace:</p>
<pre><code class="hljs css language-shell"><span class="hljs-meta">$</span><span class="bash"> pulsar-admin namespaces delete <span class="hljs-built_in">test</span>-tenant/ns1</span><br /></code></pre>
</span></div></div><div id="tab-group-5579-content-5581" class="tab-pane" data-group="group_5579" tabindex="-1"><div><span><p><a href="https://pulsar.apache.org/admin-rest-api#operation/deleteNamespace?version=2.8.0&amp;apiVersion=v2"><b>DELETE</b> <i>/admin/v2/namespaces/:tenant/:namespace</i></a>
</p>
</span></div></div><div id="tab-group-5579-content-5582" class="tab-pane" data-group="group_5579" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().deleteNamespace(namespace);<br /></code></pre>
</span></div></div></div></div>
<h3><a class="anchor" aria-hidden="true" id="configure-replication-clusters"></a><a href="#configure-replication-clusters" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configure replication clusters</h3>
<h4><a class="anchor" aria-hidden="true" id="set-replication-cluster"></a><a href="#set-replication-cluster" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Set replication cluster</h4>
<p>It sets replication clusters for a namespace, so Pulsar can internally replicate publish message from one colo to another colo.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5583-tab-5584" class="nav-link active" data-group="group_5583" data-tab="tab-group-5583-content-5584">pulsar-admin</div><div id="tab-group-5583-tab-5585" class="nav-link" data-group="group_5583" data-tab="tab-group-5583-content-5585">REST API</div><div id="tab-group-5583-tab-5586" class="nav-link" data-group="group_5583" data-tab="tab-group-5583-content-5586">Java</div></div><div class="tab-content"><div id="tab-group-5583-content-5584" class="tab-pane active" data-group="group_5583" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-string">namespaces </span><span class="hljs-built_in">set-clusters</span> <span class="hljs-string">test-tenant/</span><span class="hljs-string">ns1 </span>\<br /> <span class="hljs-built_in">--clusters</span> <span class="hljs-string">cl1<br /></span></code></pre>
</span></div></div><div id="tab-group-5583-content-5585" class="tab-pane" data-group="group_5583" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|POST|/admin/v2/namespaces/:tenant/:namespace/replication|operation/setNamespaceReplicationClusters?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5583-content-5586" class="tab-pane" data-group="group_5583" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().setNamespaceReplicationClusters(namespace, clusters);<br /></code></pre>
</span></div></div></div></div>
<h4><a class="anchor" aria-hidden="true" id="get-replication-cluster"></a><a href="#get-replication-cluster" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Get replication cluster</h4>
<p>It gives a list of replication clusters for a given namespace.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5587-tab-5588" class="nav-link active" data-group="group_5587" data-tab="tab-group-5587-content-5588">pulsar-admin</div><div id="tab-group-5587-tab-5589" class="nav-link" data-group="group_5587" data-tab="tab-group-5587-content-5589">REST API</div><div id="tab-group-5587-tab-5590" class="nav-link" data-group="group_5587" data-tab="tab-group-5587-content-5590">Java</div></div><div class="tab-content"><div id="tab-group-5587-content-5588" class="tab-pane active" data-group="group_5587" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-string">namespaces </span><span class="hljs-built_in">get-clusters</span> <span class="hljs-string">test-tenant/</span><span class="hljs-string">cl1/</span><span class="hljs-string">ns1<br /></span></code></pre>
<pre><code class="hljs"><span class="hljs-attribute">cl2</span><br /></code></pre>
</span></div></div><div id="tab-group-5587-content-5589" class="tab-pane" data-group="group_5587" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|GET|/admin/v2/namespaces/:tenant/:namespace/replication|operation/getNamespaceReplicationClusters?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5587-content-5590" class="tab-pane" data-group="group_5587" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().getNamespaceReplicationClusters(namespace)<br /></code></pre>
</span></div></div></div></div>
<h3><a class="anchor" aria-hidden="true" id="configure-backlog-quota-policies"></a><a href="#configure-backlog-quota-policies" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configure backlog quota policies</h3>
<h4><a class="anchor" aria-hidden="true" id="set-backlog-quota-policies"></a><a href="#set-backlog-quota-policies" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Set backlog quota policies</h4>
<p>Backlog quota helps the broker to restrict bandwidth/storage of a namespace once it reaches a certain threshold limit. Admin can set the limit and take corresponding action after the limit is reached.</p>
<ol>
<li><p>producer_request_hold: broker will hold and not persist produce request payload</p></li>
<li><p>producer_exception: broker disconnects with the client by giving an exception.</p></li>
<li><p>consumer_backlog_eviction: broker will start discarding backlog messages</p></li>
</ol>
<p>Backlog quota restriction can be taken care by defining restriction of backlog-quota-type: destination_storage</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5591-tab-5592" class="nav-link active" data-group="group_5591" data-tab="tab-group-5591-content-5592">pulsar-admin</div><div id="tab-group-5591-tab-5593" class="nav-link" data-group="group_5591" data-tab="tab-group-5591-content-5593">REST API</div><div id="tab-group-5591-tab-5594" class="nav-link" data-group="group_5591" data-tab="tab-group-5591-content-5594">Java</div></div><div class="tab-content"><div id="tab-group-5591-content-5592" class="tab-pane active" data-group="group_5591" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-string">namespaces </span><span class="hljs-built_in">set-backlog-quota</span> <span class="hljs-built_in">--limit</span> <span class="hljs-string">10G </span><span class="hljs-built_in">--limitTime</span> <span class="hljs-string">36000 </span><span class="hljs-built_in">--policy</span> <span class="hljs-string">producer_request_hold </span><span class="hljs-string">test-tenant/</span><span class="hljs-string">ns1<br /></span></code></pre>
<pre><code class="hljs">N/<span class="hljs-keyword">A</span><br /></code></pre>
</span></div></div><div id="tab-group-5591-content-5593" class="tab-pane" data-group="group_5591" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|POST|/admin/v2/namespaces/:tenant/:namespace/backlogQuota|operation/setBacklogQuota?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5591-content-5594" class="tab-pane" data-group="group_5591" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().setBacklogQuota(namespace, <span class="hljs-keyword">new</span> BacklogQuota(limit, limitTime, policy))<br /></code></pre>
</span></div></div></div></div>
<h4><a class="anchor" aria-hidden="true" id="get-backlog-quota-policies"></a><a href="#get-backlog-quota-policies" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Get backlog quota policies</h4>
<p>It shows a configured backlog quota for a given namespace.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5595-tab-5596" class="nav-link active" data-group="group_5595" data-tab="tab-group-5595-content-5596">pulsar-admin</div><div id="tab-group-5595-tab-5597" class="nav-link" data-group="group_5595" data-tab="tab-group-5595-content-5597">REST API</div><div id="tab-group-5595-tab-5598" class="nav-link" data-group="group_5595" data-tab="tab-group-5595-content-5598">Java</div></div><div class="tab-content"><div id="tab-group-5595-content-5596" class="tab-pane active" data-group="group_5595" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-string">namespaces </span><span class="hljs-built_in">get-backlog-quotas</span> <span class="hljs-string">test-tenant/</span><span class="hljs-string">ns1<br /></span></code></pre>
<pre><code class="hljs css language-json">{<br /> <span class="hljs-attr">"destination_storage"</span>: {<br /> <span class="hljs-attr">"limit"</span>: <span class="hljs-number">10</span>,<br /> <span class="hljs-attr">"policy"</span>: <span class="hljs-string">"producer_request_hold"</span><br /> }<br />}<br /></code></pre>
</span></div></div><div id="tab-group-5595-content-5597" class="tab-pane" data-group="group_5595" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|GET|/admin/v2/namespaces/:tenant/:namespace/backlogQuotaMap|operation/getBacklogQuotaMap?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5595-content-5598" class="tab-pane" data-group="group_5595" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().getBacklogQuotaMap(namespace);<br /></code></pre>
</span></div></div></div></div>
<h4><a class="anchor" aria-hidden="true" id="remove-backlog-quota-policies"></a><a href="#remove-backlog-quota-policies" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Remove backlog quota policies</h4>
<p>It removes backlog quota policies for a given namespace</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5599-tab-5600" class="nav-link active" data-group="group_5599" data-tab="tab-group-5599-content-5600">pulsar-admin</div><div id="tab-group-5599-tab-5601" class="nav-link" data-group="group_5599" data-tab="tab-group-5599-content-5601">REST API</div><div id="tab-group-5599-tab-5602" class="nav-link" data-group="group_5599" data-tab="tab-group-5599-content-5602">Java</div></div><div class="tab-content"><div id="tab-group-5599-content-5600" class="tab-pane active" data-group="group_5599" tabindex="-1"><div><span><pre><code class="hljs"><span class="hljs-variable">$</span> pulsar<span class="hljs-literal">-admin</span> namespaces <span class="hljs-built_in">remove-backlog</span><span class="hljs-literal">-quota</span> <span class="hljs-built_in">test-tenant</span>/ns1<br /></code></pre>
<pre><code class="hljs">N/<span class="hljs-keyword">A</span><br /></code></pre>
</span></div></div><div id="tab-group-5599-content-5601" class="tab-pane" data-group="group_5599" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|DELETE|/admin/v2/namespaces/:tenant/:namespace/backlogQuota|operation/removeBacklogQuota?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5599-content-5602" class="tab-pane" data-group="group_5599" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().removeBacklogQuota(namespace, backlogQuotaType)<br /></code></pre>
</span></div></div></div></div>
<h3><a class="anchor" aria-hidden="true" id="configure-persistence-policies"></a><a href="#configure-persistence-policies" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configure persistence policies</h3>
<h4><a class="anchor" aria-hidden="true" id="set-persistence-policies"></a><a href="#set-persistence-policies" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Set persistence policies</h4>
<p>Persistence policies allow to configure persistency-level for all topic messages under a given namespace.</p>
<ul>
<li><p>Bookkeeper-ack-quorum: Number of acks (guaranteed copies) to wait for each entry, default: 0</p></li>
<li><p>Bookkeeper-ensemble: Number of bookies to use for a topic, default: 0</p></li>
<li><p>Bookkeeper-write-quorum: How many writes to make of each entry, default: 0</p></li>
<li><p>Ml-mark-delete-max-rate: Throttling rate of mark-delete operation (0 means no throttle), default: 0.0</p></li>
</ul>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5603-tab-5604" class="nav-link active" data-group="group_5603" data-tab="tab-group-5603-content-5604">pulsar-admin</div><div id="tab-group-5603-tab-5605" class="nav-link" data-group="group_5603" data-tab="tab-group-5603-content-5605">REST API</div><div id="tab-group-5603-tab-5606" class="nav-link" data-group="group_5603" data-tab="tab-group-5603-content-5606">Java</div></div><div class="tab-content"><div id="tab-group-5603-content-5604" class="tab-pane active" data-group="group_5603" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-string">namespaces </span><span class="hljs-built_in">set-persistence</span> <span class="hljs-built_in">--bookkeeper-ack-quorum</span> 2 <span class="hljs-built_in">--bookkeeper-ensemble</span> 3 <span class="hljs-built_in">--bookkeeper-write-quorum</span> 2 <span class="hljs-built_in">--ml-mark-delete-max-rate</span> 0 <span class="hljs-string">test-tenant/</span><span class="hljs-string">ns1<br /></span></code></pre>
<pre><code class="hljs">N/<span class="hljs-keyword">A</span><br /></code></pre>
</span></div></div><div id="tab-group-5603-content-5605" class="tab-pane" data-group="group_5603" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|POST|/admin/v2/namespaces/:tenant/:namespace/persistence|operation/setPersistence?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5603-content-5606" class="tab-pane" data-group="group_5603" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().setPersistence(namespace,<span class="hljs-keyword">new</span> PersistencePolicies(bookkeeperEnsemble, bookkeeperWriteQuorum,bookkeeperAckQuorum,managedLedgerMaxMarkDeleteRate))<br /></code></pre>
</span></div></div></div></div>
<h4><a class="anchor" aria-hidden="true" id="get-persistence-policies"></a><a href="#get-persistence-policies" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Get persistence policies</h4>
<p>It shows the configured persistence policies of a given namespace.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5607-tab-5608" class="nav-link active" data-group="group_5607" data-tab="tab-group-5607-content-5608">pulsar-admin</div><div id="tab-group-5607-tab-5609" class="nav-link" data-group="group_5607" data-tab="tab-group-5607-content-5609">REST API</div><div id="tab-group-5607-tab-5610" class="nav-link" data-group="group_5607" data-tab="tab-group-5607-content-5610">Java</div></div><div class="tab-content"><div id="tab-group-5607-content-5608" class="tab-pane active" data-group="group_5607" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-string">namespaces </span><span class="hljs-built_in">get-persistence</span> <span class="hljs-string">test-tenant/</span><span class="hljs-string">ns1<br /></span></code></pre>
<pre><code class="hljs css language-json">{<br /> <span class="hljs-attr">"bookkeeperEnsemble"</span>: <span class="hljs-number">3</span>,<br /> <span class="hljs-attr">"bookkeeperWriteQuorum"</span>: <span class="hljs-number">2</span>,<br /> <span class="hljs-attr">"bookkeeperAckQuorum"</span>: <span class="hljs-number">2</span>,<br /> <span class="hljs-attr">"managedLedgerMaxMarkDeleteRate"</span>: <span class="hljs-number">0</span><br />}<br /></code></pre>
</span></div></div><div id="tab-group-5607-content-5609" class="tab-pane" data-group="group_5607" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|GET|/admin/v2/namespaces/:tenant/:namespace/persistence|operation/getPersistence?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5607-content-5610" class="tab-pane" data-group="group_5607" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().getPersistence(namespace)<br /></code></pre>
</span></div></div></div></div>
<h3><a class="anchor" aria-hidden="true" id="configure-namespace-bundles"></a><a href="#configure-namespace-bundles" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configure namespace bundles</h3>
<h4><a class="anchor" aria-hidden="true" id="unload-namespace-bundles"></a><a href="#unload-namespace-bundles" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Unload namespace bundles</h4>
<p>The namespace bundle is a virtual group of topics which belong to the same namespace. If the broker gets overloaded with the number of bundles, this command can help unload a bundle from that broker, so it can be served by some other less-loaded brokers. The namespace bundle ID ranges from 0x00000000 to 0xffffffff.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5611-tab-5612" class="nav-link active" data-group="group_5611" data-tab="tab-group-5611-content-5612">pulsar-admin</div><div id="tab-group-5611-tab-5613" class="nav-link" data-group="group_5611" data-tab="tab-group-5611-content-5613">REST API</div><div id="tab-group-5611-tab-5614" class="nav-link" data-group="group_5611" data-tab="tab-group-5611-content-5614">Java</div></div><div class="tab-content"><div id="tab-group-5611-content-5612" class="tab-pane active" data-group="group_5611" tabindex="-1"><div><span><pre><code class="hljs">$ pulsar-admin namespaces <span class="hljs-built_in">unload</span> <span class="hljs-comment">--bundle 0x00000000_0xffffffff test-tenant/ns1</span><br /></code></pre>
<pre><code class="hljs">N/<span class="hljs-keyword">A</span><br /></code></pre>
</span></div></div><div id="tab-group-5611-content-5613" class="tab-pane" data-group="group_5611" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject</span>: endpoint|PUT|<span class="hljs-regexp">/admin/v</span>2/namespaces/<span class="hljs-symbol">:tenant/</span><span class="hljs-symbol">:namespace/</span>{bundle}/unload|operation/unloadNamespaceBundle?version=[[<span class="hljs-symbol">pulsar:</span>version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5611-content-5614" class="tab-pane" data-group="group_5611" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().unloadNamespaceBundle(namespace, bundle)<br /></code></pre>
</span></div></div></div></div>
<h4><a class="anchor" aria-hidden="true" id="split-namespace-bundles"></a><a href="#split-namespace-bundles" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Split namespace bundles</h4>
<p>Each namespace bundle can contain multiple topics and each bundle can be served by only one broker.
If a single bundle is creating an excessive load on a broker, an admin splits the bundle using this command permitting one or more of the new bundles to be unloaded thus spreading the load across the brokers.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5615-tab-5616" class="nav-link active" data-group="group_5615" data-tab="tab-group-5615-content-5616">pulsar-admin</div><div id="tab-group-5615-tab-5617" class="nav-link" data-group="group_5615" data-tab="tab-group-5615-content-5617">REST API</div><div id="tab-group-5615-tab-5618" class="nav-link" data-group="group_5615" data-tab="tab-group-5615-content-5618">Java</div></div><div class="tab-content"><div id="tab-group-5615-content-5616" class="tab-pane active" data-group="group_5615" tabindex="-1"><div><span><pre><code class="hljs"><span class="hljs-variable">$</span> pulsar<span class="hljs-literal">-admin</span> namespaces <span class="hljs-built_in">split-bundle</span> -<span class="hljs-literal">-bundle</span> <span class="hljs-number">0</span>x00000000_0xffffffff <span class="hljs-built_in">test-tenant</span>/ns1<br /></code></pre>
<pre><code class="hljs">N/<span class="hljs-keyword">A</span><br /></code></pre>
</span></div></div><div id="tab-group-5615-content-5617" class="tab-pane" data-group="group_5615" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject</span>: endpoint|PUT|<span class="hljs-regexp">/admin/v</span>2/namespaces/<span class="hljs-symbol">:tenant/</span><span class="hljs-symbol">:namespace/</span>{bundle}/split|operation/splitNamespaceBundle?version=[[<span class="hljs-symbol">pulsar:</span>version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5615-content-5618" class="tab-pane" data-group="group_5615" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().splitNamespaceBundle(namespace, bundle)<br /></code></pre>
</span></div></div></div></div>
<h3><a class="anchor" aria-hidden="true" id="configure-message-ttl"></a><a href="#configure-message-ttl" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configure message TTL</h3>
<h4><a class="anchor" aria-hidden="true" id="set-message-ttl"></a><a href="#set-message-ttl" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Set message-ttl</h4>
<p>It configures message’s time to live (in seconds) duration.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5619-tab-5620" class="nav-link active" data-group="group_5619" data-tab="tab-group-5619-content-5620">pulsar-admin</div><div id="tab-group-5619-tab-5621" class="nav-link" data-group="group_5619" data-tab="tab-group-5619-content-5621">REST API</div><div id="tab-group-5619-tab-5622" class="nav-link" data-group="group_5619" data-tab="tab-group-5619-content-5622">Java</div></div><div class="tab-content"><div id="tab-group-5619-content-5620" class="tab-pane active" data-group="group_5619" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-string">namespaces </span><span class="hljs-built_in">set-message-ttl</span> <span class="hljs-built_in">--messageTTL</span> <span class="hljs-string">100 </span><span class="hljs-string">test-tenant/</span><span class="hljs-string">ns1<br /></span></code></pre>
<pre><code class="hljs">N/<span class="hljs-keyword">A</span><br /></code></pre>
</span></div></div><div id="tab-group-5619-content-5621" class="tab-pane" data-group="group_5619" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|POST|/admin/v2/namespaces/:tenant/:namespace/messageTTL|operation/setNamespaceMessageTTL?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5619-content-5622" class="tab-pane" data-group="group_5619" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().setNamespaceMessageTTL(namespace, messageTTL)<br /></code></pre>
</span></div></div></div></div>
<h4><a class="anchor" aria-hidden="true" id="get-message-ttl"></a><a href="#get-message-ttl" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Get message-ttl</h4>
<p>It gives a message ttl of configured namespace.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5623-tab-5624" class="nav-link active" data-group="group_5623" data-tab="tab-group-5623-content-5624">pulsar-admin</div><div id="tab-group-5623-tab-5625" class="nav-link" data-group="group_5623" data-tab="tab-group-5623-content-5625">REST API</div><div id="tab-group-5623-tab-5626" class="nav-link" data-group="group_5623" data-tab="tab-group-5623-content-5626">Java</div></div><div class="tab-content"><div id="tab-group-5623-content-5624" class="tab-pane active" data-group="group_5623" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-string">namespaces </span><span class="hljs-built_in">get-message-ttl</span> <span class="hljs-string">test-tenant/</span><span class="hljs-string">ns1<br /></span></code></pre>
<pre><code class="hljs"><span class="hljs-number">100</span><br /></code></pre>
</span></div></div><div id="tab-group-5623-content-5625" class="tab-pane" data-group="group_5623" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|GET|/admin/v2/namespaces/:tenant/:namespace/messageTTL|operation/getNamespaceMessageTTL?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5623-content-5626" class="tab-pane" data-group="group_5623" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().getNamespaceMessageTTL(namespace)<br /></code></pre>
</span></div></div></div></div>
<h4><a class="anchor" aria-hidden="true" id="remove-message-ttl"></a><a href="#remove-message-ttl" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Remove message-ttl</h4>
<p>Remove a message TTL of the configured namespace.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5627-tab-5628" class="nav-link active" data-group="group_5627" data-tab="tab-group-5627-content-5628">pulsar-admin</div><div id="tab-group-5627-tab-5629" class="nav-link" data-group="group_5627" data-tab="tab-group-5627-content-5629">REST API</div><div id="tab-group-5627-tab-5630" class="nav-link" data-group="group_5627" data-tab="tab-group-5627-content-5630">Java</div></div><div class="tab-content"><div id="tab-group-5627-content-5628" class="tab-pane active" data-group="group_5627" tabindex="-1"><div><span><pre><code class="hljs">$ pulsar-admin namespaces <span class="hljs-keyword">remove</span>-<span class="hljs-keyword">message</span>-ttl <span class="hljs-keyword">test</span>-tenant/ns1<br /></code></pre>
<pre><code class="hljs"><span class="hljs-number">100</span><br /></code></pre>
</span></div></div><div id="tab-group-5627-content-5629" class="tab-pane" data-group="group_5627" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|DELETE|/admin/v2/namespaces/:tenant/:namespace/messageTTL|operation/removeNamespaceMessageTTL?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5627-content-5630" class="tab-pane" data-group="group_5627" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().removeNamespaceMessageTTL(namespace)<br /></code></pre>
</span></div></div></div></div>
<h3><a class="anchor" aria-hidden="true" id="clear-backlog"></a><a href="#clear-backlog" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Clear backlog</h3>
<h4><a class="anchor" aria-hidden="true" id="clear-namespace-backlog"></a><a href="#clear-namespace-backlog" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Clear namespace backlog</h4>
<p>It clears all message backlog for all the topics that belong to a specific namespace. You can also clear backlog for a specific subscription as well.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5631-tab-5632" class="nav-link active" data-group="group_5631" data-tab="tab-group-5631-content-5632">pulsar-admin</div><div id="tab-group-5631-tab-5633" class="nav-link" data-group="group_5631" data-tab="tab-group-5631-content-5633">REST API</div><div id="tab-group-5631-tab-5634" class="nav-link" data-group="group_5631" data-tab="tab-group-5631-content-5634">Java</div></div><div class="tab-content"><div id="tab-group-5631-content-5632" class="tab-pane active" data-group="group_5631" tabindex="-1"><div><span><pre><code class="hljs">$ pulsar-admin namespaces clear-<span class="hljs-keyword">backlog </span>--<span class="hljs-keyword">sub </span>my-<span class="hljs-keyword">subscription </span>test-tenant/ns1<br /></code></pre>
<pre><code class="hljs">N/<span class="hljs-keyword">A</span><br /></code></pre>
</span></div></div><div id="tab-group-5631-content-5633" class="tab-pane" data-group="group_5631" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|POST|/admin/v2/namespaces/:tenant/:namespace/clearBacklog|operation/clearNamespaceBacklogForSubscription?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5631-content-5634" class="tab-pane" data-group="group_5631" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().clearNamespaceBacklogForSubscription(namespace, subscription)<br /></code></pre>
</span></div></div></div></div>
<h4><a class="anchor" aria-hidden="true" id="clear-bundle-backlog"></a><a href="#clear-bundle-backlog" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Clear bundle backlog</h4>
<p>It clears all message backlog for all the topics that belong to a specific NamespaceBundle. You can also clear backlog for a specific subscription as well.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5635-tab-5636" class="nav-link active" data-group="group_5635" data-tab="tab-group-5635-content-5636">pulsar-admin</div><div id="tab-group-5635-tab-5637" class="nav-link" data-group="group_5635" data-tab="tab-group-5635-content-5637">REST API</div><div id="tab-group-5635-tab-5638" class="nav-link" data-group="group_5635" data-tab="tab-group-5635-content-5638">Java</div></div><div class="tab-content"><div id="tab-group-5635-content-5636" class="tab-pane active" data-group="group_5635" tabindex="-1"><div><span><pre><code class="hljs">$ pulsar-admin namespaces clear-<span class="hljs-keyword">backlog </span> --<span class="hljs-keyword">bundle </span><span class="hljs-number">0x00000000</span>_<span class="hljs-number">0xffffffff</span> --<span class="hljs-keyword">sub </span>my-<span class="hljs-keyword">subscription </span>test-tenant/ns1<br /></code></pre>
<pre><code class="hljs">N/<span class="hljs-keyword">A</span><br /></code></pre>
</span></div></div><div id="tab-group-5635-content-5637" class="tab-pane" data-group="group_5635" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject</span>: endpoint|POST|<span class="hljs-regexp">/admin/v</span>2/namespaces/<span class="hljs-symbol">:tenant/</span><span class="hljs-symbol">:namespace/</span>{bundle}/clearBacklog|operation?version=[[<span class="hljs-symbol">pulsar:</span>version_number]]/clearNamespaceBundleBacklogForSubscription}<br /></code></pre>
</span></div></div><div id="tab-group-5635-content-5638" class="tab-pane" data-group="group_5635" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().clearNamespaceBundleBacklogForSubscription(namespace, bundle, subscription)<br /></code></pre>
</span></div></div></div></div>
<h3><a class="anchor" aria-hidden="true" id="configure-retention"></a><a href="#configure-retention" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configure retention</h3>
<h4><a class="anchor" aria-hidden="true" id="set-retention"></a><a href="#set-retention" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Set retention</h4>
<p>Each namespace contains multiple topics and the retention size (storage size) of each topic should not exceed a specific threshold or it should be stored for a certain period. This command helps configure the retention size and time of topics in a given namespace.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5639-tab-5640" class="nav-link active" data-group="group_5639" data-tab="tab-group-5639-content-5640">pulsar-admin</div><div id="tab-group-5639-tab-5641" class="nav-link" data-group="group_5639" data-tab="tab-group-5639-content-5641">REST API</div><div id="tab-group-5639-tab-5642" class="nav-link" data-group="group_5639" data-tab="tab-group-5639-content-5642">Java</div></div><div class="tab-content"><div id="tab-group-5639-content-5640" class="tab-pane active" data-group="group_5639" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-built_in">set-retention</span> <span class="hljs-built_in">--size</span> <span class="hljs-string">100 </span><span class="hljs-built_in">--time</span> <span class="hljs-string">10 </span><span class="hljs-string">test-tenant/</span><span class="hljs-string">ns1<br /></span></code></pre>
<pre><code class="hljs">N/<span class="hljs-keyword">A</span><br /></code></pre>
</span></div></div><div id="tab-group-5639-content-5641" class="tab-pane" data-group="group_5639" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|POST|/admin/v2/namespaces/:tenant/:namespace/retention|operation/setRetention?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5639-content-5642" class="tab-pane" data-group="group_5639" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().setRetention(namespace, <span class="hljs-keyword">new</span> RetentionPolicies(retentionTimeInMin, retentionSizeInMB))<br /></code></pre>
</span></div></div></div></div>
<h4><a class="anchor" aria-hidden="true" id="get-retention"></a><a href="#get-retention" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Get retention</h4>
<p>It shows retention information of a given namespace.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5643-tab-5644" class="nav-link active" data-group="group_5643" data-tab="tab-group-5643-content-5644">pulsar-admin</div><div id="tab-group-5643-tab-5645" class="nav-link" data-group="group_5643" data-tab="tab-group-5643-content-5645">REST API</div><div id="tab-group-5643-tab-5646" class="nav-link" data-group="group_5643" data-tab="tab-group-5643-content-5646">Java</div></div><div class="tab-content"><div id="tab-group-5643-content-5644" class="tab-pane active" data-group="group_5643" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-string">namespaces </span><span class="hljs-built_in">get-retention</span> <span class="hljs-string">test-tenant/</span><span class="hljs-string">ns1<br /></span></code></pre>
<pre><code class="hljs css language-json">{<br /> <span class="hljs-attr">"retentionTimeInMinutes"</span>: <span class="hljs-number">10</span>,<br /> <span class="hljs-attr">"retentionSizeInMB"</span>: <span class="hljs-number">100</span><br />}<br /></code></pre>
</span></div></div><div id="tab-group-5643-content-5645" class="tab-pane" data-group="group_5643" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|GET|/admin/v2/namespaces/:tenant/:namespace/retention|operation/getRetention?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5643-content-5646" class="tab-pane" data-group="group_5643" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().getRetention(namespace)<br /></code></pre>
</span></div></div></div></div>
<h3><a class="anchor" aria-hidden="true" id="configure-dispatch-throttling-for-topics"></a><a href="#configure-dispatch-throttling-for-topics" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configure dispatch throttling for topics</h3>
<h4><a class="anchor" aria-hidden="true" id="set-dispatch-throttling-for-topics"></a><a href="#set-dispatch-throttling-for-topics" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Set dispatch throttling for topics</h4>
<p>It sets message dispatch rate for all the topics under a given namespace.
The dispatch rate can be restricted by the number of messages per X seconds (<code>msg-dispatch-rate</code>) or by the number of message-bytes per X second (<code>byte-dispatch-rate</code>).
dispatch rate is in second and it can be configured with <code>dispatch-rate-period</code>. Default value of <code>msg-dispatch-rate</code> and <code>byte-dispatch-rate</code> is -1 which
disables the throttling.</p>
<blockquote>
<p><strong>Note</strong></p>
<ul>
<li>If neither <code>clusterDispatchRate</code> nor <code>topicDispatchRate</code> is configured, dispatch throttling is disabled.</li>
</ul>
<blockquote>
</blockquote>
<ul>
<li>If <code>topicDispatchRate</code> is not configured, <code>clusterDispatchRate</code> takes effect.</li>
</ul>
<blockquote>
</blockquote>
<ul>
<li>If <code>topicDispatchRate</code> is configured, <code>topicDispatchRate</code> takes effect.</li>
</ul>
</blockquote>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5647-tab-5648" class="nav-link active" data-group="group_5647" data-tab="tab-group-5647-content-5648">pulsar-admin</div><div id="tab-group-5647-tab-5649" class="nav-link" data-group="group_5647" data-tab="tab-group-5647-content-5649">REST API</div><div id="tab-group-5647-tab-5650" class="nav-link" data-group="group_5647" data-tab="tab-group-5647-content-5650">Java</div></div><div class="tab-content"><div id="tab-group-5647-content-5648" class="tab-pane active" data-group="group_5647" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-string">namespaces </span><span class="hljs-built_in">set-dispatch-rate</span> <span class="hljs-string">test-tenant/</span><span class="hljs-string">ns1 </span>\<br /> <span class="hljs-built_in">--msg-dispatch-rate</span> <span class="hljs-string">1000 </span>\<br /> <span class="hljs-built_in">--byte-dispatch-rate</span> <span class="hljs-string">1048576 </span>\<br /> <span class="hljs-built_in">--dispatch-rate-period</span> 1<br /></code></pre>
</span></div></div><div id="tab-group-5647-content-5649" class="tab-pane" data-group="group_5647" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|POST|/admin/v2/namespaces/:tenant/:namespace/dispatchRate|operation/setDispatchRate?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5647-content-5650" class="tab-pane" data-group="group_5647" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().setDispatchRate(namespace, <span class="hljs-keyword">new</span> DispatchRate(<span class="hljs-number">1000</span>, <span class="hljs-number">1048576</span>, <span class="hljs-number">1</span>))<br /></code></pre>
</span></div></div></div></div>
<h4><a class="anchor" aria-hidden="true" id="get-configured-message-rate-for-topics"></a><a href="#get-configured-message-rate-for-topics" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Get configured message-rate for topics</h4>
<p>It shows configured message-rate for the namespace (topics under this namespace can dispatch this many messages per second)</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5651-tab-5652" class="nav-link active" data-group="group_5651" data-tab="tab-group-5651-content-5652">pulsar-admin</div><div id="tab-group-5651-tab-5653" class="nav-link" data-group="group_5651" data-tab="tab-group-5651-content-5653">REST API</div><div id="tab-group-5651-tab-5654" class="nav-link" data-group="group_5651" data-tab="tab-group-5651-content-5654">Java</div></div><div class="tab-content"><div id="tab-group-5651-content-5652" class="tab-pane active" data-group="group_5651" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-string">namespaces </span><span class="hljs-built_in">get-dispatch-rate</span> <span class="hljs-string">test-tenant/</span><span class="hljs-string">ns1<br /></span></code></pre>
<pre><code class="hljs css language-json">{<br /> <span class="hljs-attr">"dispatchThrottlingRatePerTopicInMsg"</span> : <span class="hljs-number">1000</span>,<br /> <span class="hljs-attr">"dispatchThrottlingRatePerTopicInByte"</span> : <span class="hljs-number">1048576</span>,<br /> <span class="hljs-attr">"ratePeriodInSecond"</span> : <span class="hljs-number">1</span><br />}<br /></code></pre>
</span></div></div><div id="tab-group-5651-content-5653" class="tab-pane" data-group="group_5651" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|GET|/admin/v2/namespaces/:tenant/:namespace/dispatchRate|operation/getDispatchRate?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5651-content-5654" class="tab-pane" data-group="group_5651" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().getDispatchRate(namespace)<br /></code></pre>
</span></div></div></div></div>
<h3><a class="anchor" aria-hidden="true" id="configure-dispatch-throttling-for-subscription"></a><a href="#configure-dispatch-throttling-for-subscription" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configure dispatch throttling for subscription</h3>
<h4><a class="anchor" aria-hidden="true" id="set-dispatch-throttling-for-subscription"></a><a href="#set-dispatch-throttling-for-subscription" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Set dispatch throttling for subscription</h4>
<p>It sets message dispatch rate for all the subscription of topics under a given namespace.
The dispatch rate can be restricted by the number of messages per X seconds (<code>msg-dispatch-rate</code>) or by the number of message-bytes per X second (<code>byte-dispatch-rate</code>).
dispatch rate is in second and it can be configured with <code>dispatch-rate-period</code>. Default value of <code>msg-dispatch-rate</code> and <code>byte-dispatch-rate</code> is -1 which
disables the throttling.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5655-tab-5656" class="nav-link active" data-group="group_5655" data-tab="tab-group-5655-content-5656">pulsar-admin</div><div id="tab-group-5655-tab-5657" class="nav-link" data-group="group_5655" data-tab="tab-group-5655-content-5657">REST API</div><div id="tab-group-5655-tab-5658" class="nav-link" data-group="group_5655" data-tab="tab-group-5655-content-5658">Java</div></div><div class="tab-content"><div id="tab-group-5655-content-5656" class="tab-pane active" data-group="group_5655" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-string">namespaces </span><span class="hljs-built_in">set-subscription-dispatch-rate</span> <span class="hljs-string">test-tenant/</span><span class="hljs-string">ns1 </span>\<br /> <span class="hljs-built_in">--msg-dispatch-rate</span> <span class="hljs-string">1000 </span>\<br /> <span class="hljs-built_in">--byte-dispatch-rate</span> <span class="hljs-string">1048576 </span>\<br /> <span class="hljs-built_in">--dispatch-rate-period</span> 1<br /></code></pre>
</span></div></div><div id="tab-group-5655-content-5657" class="tab-pane" data-group="group_5655" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|POST|/admin/v2/namespaces/:tenant/:namespace/subscriptionDispatchRate|operation/setDispatchRate?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5655-content-5658" class="tab-pane" data-group="group_5655" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().setSubscriptionDispatchRate(namespace, <span class="hljs-keyword">new</span> DispatchRate(<span class="hljs-number">1000</span>, <span class="hljs-number">1048576</span>, <span class="hljs-number">1</span>))<br /></code></pre>
</span></div></div></div></div>
<h4><a class="anchor" aria-hidden="true" id="get-configured-message-rate-for-subscription"></a><a href="#get-configured-message-rate-for-subscription" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Get configured message-rate for subscription</h4>
<p>It shows configured message-rate for the namespace (topics under this namespace can dispatch this many messages per second)</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5659-tab-5660" class="nav-link active" data-group="group_5659" data-tab="tab-group-5659-content-5660">pulsar-admin</div><div id="tab-group-5659-tab-5661" class="nav-link" data-group="group_5659" data-tab="tab-group-5659-content-5661">REST API</div><div id="tab-group-5659-tab-5662" class="nav-link" data-group="group_5659" data-tab="tab-group-5659-content-5662">Java</div></div><div class="tab-content"><div id="tab-group-5659-content-5660" class="tab-pane active" data-group="group_5659" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-string">namespaces </span><span class="hljs-built_in">get-subscription-dispatch-rate</span> <span class="hljs-string">test-tenant/</span><span class="hljs-string">ns1<br /></span></code></pre>
<pre><code class="hljs css language-json">{<br /> <span class="hljs-attr">"dispatchThrottlingRatePerTopicInMsg"</span> : <span class="hljs-number">1000</span>,<br /> <span class="hljs-attr">"dispatchThrottlingRatePerTopicInByte"</span> : <span class="hljs-number">1048576</span>,<br /> <span class="hljs-attr">"ratePeriodInSecond"</span> : <span class="hljs-number">1</span><br />}<br /></code></pre>
</span></div></div><div id="tab-group-5659-content-5661" class="tab-pane" data-group="group_5659" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|GET|/admin/v2/namespaces/:tenant/:namespace/subscriptionDispatchRate|operation/getDispatchRate?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5659-content-5662" class="tab-pane" data-group="group_5659" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().getSubscriptionDispatchRate(namespace)<br /></code></pre>
</span></div></div></div></div>
<h3><a class="anchor" aria-hidden="true" id="configure-dispatch-throttling-for-replicator"></a><a href="#configure-dispatch-throttling-for-replicator" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configure dispatch throttling for replicator</h3>
<h4><a class="anchor" aria-hidden="true" id="set-dispatch-throttling-for-replicator"></a><a href="#set-dispatch-throttling-for-replicator" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Set dispatch throttling for replicator</h4>
<p>It sets message dispatch rate for all the replicator between replication clusters under a given namespace.
The dispatch rate can be restricted by the number of messages per X seconds (<code>msg-dispatch-rate</code>) or by the number of message-bytes per X second (<code>byte-dispatch-rate</code>).
dispatch rate is in second and it can be configured with <code>dispatch-rate-period</code>. Default value of <code>msg-dispatch-rate</code> and <code>byte-dispatch-rate</code> is -1 which
disables the throttling.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5663-tab-5664" class="nav-link active" data-group="group_5663" data-tab="tab-group-5663-content-5664">pulsar-admin</div><div id="tab-group-5663-tab-5665" class="nav-link" data-group="group_5663" data-tab="tab-group-5663-content-5665">REST API</div><div id="tab-group-5663-tab-5666" class="nav-link" data-group="group_5663" data-tab="tab-group-5663-content-5666">Java</div></div><div class="tab-content"><div id="tab-group-5663-content-5664" class="tab-pane active" data-group="group_5663" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-string">namespaces </span><span class="hljs-built_in">set-replicator-dispatch-rate</span> <span class="hljs-string">test-tenant/</span><span class="hljs-string">ns1 </span>\<br /> <span class="hljs-built_in">--msg-dispatch-rate</span> <span class="hljs-string">1000 </span>\<br /> <span class="hljs-built_in">--byte-dispatch-rate</span> <span class="hljs-string">1048576 </span>\<br /> <span class="hljs-built_in">--dispatch-rate-period</span> 1<br /></code></pre>
</span></div></div><div id="tab-group-5663-content-5665" class="tab-pane" data-group="group_5663" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|POST|/admin/v2/namespaces/:tenant/:namespace/replicatorDispatchRate|operation/setDispatchRate?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5663-content-5666" class="tab-pane" data-group="group_5663" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().setReplicatorDispatchRate(namespace, <span class="hljs-keyword">new</span> DispatchRate(<span class="hljs-number">1000</span>, <span class="hljs-number">1048576</span>, <span class="hljs-number">1</span>))<br /></code></pre>
</span></div></div></div></div>
<h4><a class="anchor" aria-hidden="true" id="get-configured-message-rate-for-replicator"></a><a href="#get-configured-message-rate-for-replicator" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Get configured message-rate for replicator</h4>
<p>It shows configured message-rate for the namespace (topics under this namespace can dispatch this many messages per second)</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5667-tab-5668" class="nav-link active" data-group="group_5667" data-tab="tab-group-5667-content-5668">pulsar-admin</div><div id="tab-group-5667-tab-5669" class="nav-link" data-group="group_5667" data-tab="tab-group-5667-content-5669">REST API</div><div id="tab-group-5667-tab-5670" class="nav-link" data-group="group_5667" data-tab="tab-group-5667-content-5670">Java</div></div><div class="tab-content"><div id="tab-group-5667-content-5668" class="tab-pane active" data-group="group_5667" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-string">namespaces </span><span class="hljs-built_in">get-replicator-dispatch-rate</span> <span class="hljs-string">test-tenant/</span><span class="hljs-string">ns1<br /></span></code></pre>
<pre><code class="hljs css language-json">{<br /> <span class="hljs-attr">"dispatchThrottlingRatePerTopicInMsg"</span> : <span class="hljs-number">1000</span>,<br /> <span class="hljs-attr">"dispatchThrottlingRatePerTopicInByte"</span> : <span class="hljs-number">1048576</span>,<br /> <span class="hljs-attr">"ratePeriodInSecond"</span> : <span class="hljs-number">1</span><br />}<br /></code></pre>
</span></div></div><div id="tab-group-5667-content-5669" class="tab-pane" data-group="group_5667" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|GET|/admin/v2/namespaces/:tenant/:namespace/replicatorDispatchRate|operation/getDispatchRate?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5667-content-5670" class="tab-pane" data-group="group_5667" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().getReplicatorDispatchRate(namespace)<br /></code></pre>
</span></div></div></div></div>
<h3><a class="anchor" aria-hidden="true" id="configure-deduplication-snapshot-interval"></a><a href="#configure-deduplication-snapshot-interval" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configure deduplication snapshot interval</h3>
<h4><a class="anchor" aria-hidden="true" id="get-deduplication-snapshot-interval"></a><a href="#get-deduplication-snapshot-interval" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Get deduplication snapshot interval</h4>
<p>It shows configured <code>deduplicationSnapshotInterval</code> for a namespace (Each topic under the namespace will take a deduplication snapshot according to this interval)</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5671-tab-5672" class="nav-link active" data-group="group_5671" data-tab="tab-group-5671-content-5672">pulsar-admin</div><div id="tab-group-5671-tab-5673" class="nav-link" data-group="group_5671" data-tab="tab-group-5671-content-5673">REST API</div><div id="tab-group-5671-tab-5674" class="nav-link" data-group="group_5671" data-tab="tab-group-5671-content-5674">Java</div></div><div class="tab-content"><div id="tab-group-5671-content-5672" class="tab-pane active" data-group="group_5671" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-string">namespaces </span><span class="hljs-built_in">get-deduplication-snapshot-interval</span> <span class="hljs-string">test-tenant/</span><span class="hljs-string">ns1<br /></span></code></pre>
</span></div></div><div id="tab-group-5671-content-5673" class="tab-pane" data-group="group_5671" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|GET|/admin/v2/namespaces/:tenant/:namespace/deduplicationSnapshotInterval?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5671-content-5674" class="tab-pane" data-group="group_5671" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().getDeduplicationSnapshotInterval(namespace)<br /></code></pre>
</span></div></div></div></div>
<h4><a class="anchor" aria-hidden="true" id="set-deduplication-snapshot-interval"></a><a href="#set-deduplication-snapshot-interval" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Set deduplication snapshot interval</h4>
<p>Set configured <code>deduplicationSnapshotInterval</code> for a namespace. Each topic under the namespace will take a deduplication snapshot according to this interval.
<code>brokerDeduplicationEnabled</code> must be set to <code>true</code> for this property to take effect.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5675-tab-5676" class="nav-link active" data-group="group_5675" data-tab="tab-group-5675-content-5676">pulsar-admin</div><div id="tab-group-5675-tab-5677" class="nav-link" data-group="group_5675" data-tab="tab-group-5675-content-5677">REST API</div><div id="tab-group-5675-tab-5678" class="nav-link" data-group="group_5675" data-tab="tab-group-5675-content-5678">Java</div></div><div class="tab-content"><div id="tab-group-5675-content-5676" class="tab-pane active" data-group="group_5675" tabindex="-1"><div><span><pre><code class="hljs">$ <span class="hljs-string">pulsar-admin </span><span class="hljs-string">namespaces </span><span class="hljs-built_in">set-deduplication-snapshot-interval</span> <span class="hljs-string">test-tenant/</span><span class="hljs-string">ns1 </span><span class="hljs-built_in">--interval</span> <span class="hljs-string">1000 </span><br /></code></pre>
</span></div></div><div id="tab-group-5675-content-5677" class="tab-pane" data-group="group_5675" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|POST|/admin/v2/namespaces/:tenant/:namespace/deduplicationSnapshotInterval?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
<pre><code class="hljs css language-json">{<br /> <span class="hljs-attr">"interval"</span>: <span class="hljs-number">1000</span><br />}<br /></code></pre>
</span></div></div><div id="tab-group-5675-content-5678" class="tab-pane" data-group="group_5675" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().setDeduplicationSnapshotInterval(namespace, <span class="hljs-number">1000</span>)<br /></code></pre>
</span></div></div></div></div>
<h4><a class="anchor" aria-hidden="true" id="remove-deduplication-snapshot-interval"></a><a href="#remove-deduplication-snapshot-interval" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Remove deduplication snapshot interval</h4>
<p>Remove configured <code>deduplicationSnapshotInterval</code> of a namespace (Each topic under the namespace will take a deduplication snapshot according to this interval)</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5679-tab-5680" class="nav-link active" data-group="group_5679" data-tab="tab-group-5679-content-5680">pulsar-admin</div><div id="tab-group-5679-tab-5681" class="nav-link" data-group="group_5679" data-tab="tab-group-5679-content-5681">REST API</div><div id="tab-group-5679-tab-5682" class="nav-link" data-group="group_5679" data-tab="tab-group-5679-content-5682">Java</div></div><div class="tab-content"><div id="tab-group-5679-content-5680" class="tab-pane active" data-group="group_5679" tabindex="-1"><div><span><pre><code class="hljs">$ pulsar-<span class="hljs-keyword">admin</span> namespaces remove-deduplication-<span class="hljs-keyword">snapshot</span>-<span class="hljs-type">interval</span> test-tenant/ns1<br /></code></pre>
</span></div></div><div id="tab-group-5679-content-5681" class="tab-pane" data-group="group_5679" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|POST|/admin/v2/namespaces/:tenant/:namespace/deduplicationSnapshotInterval?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5679-content-5682" class="tab-pane" data-group="group_5679" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().removeDeduplicationSnapshotInterval(namespace)<br /></code></pre>
</span></div></div></div></div>
<h3><a class="anchor" aria-hidden="true" id="namespace-isolation"></a><a href="#namespace-isolation" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Namespace isolation</h3>
<p>You can use the <a href="/docs/en/2.8.0/administration-isolation">Pulsar isolation policy</a> to allocate resources (broker and bookie) for a namespace.</p>
<h3><a class="anchor" aria-hidden="true" id="unload-namespaces-from-a-broker"></a><a href="#unload-namespaces-from-a-broker" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Unload namespaces from a broker</h3>
<p>You can unload a namespace, or a <a href="/docs/en/2.8.0/reference-terminology#namespace-bundle">namespace bundle</a>, from the Pulsar <a href="/docs/en/2.8.0/reference-terminology#broker">broker</a> that is currently responsible for it.</p>
<h4><a class="anchor" aria-hidden="true" id="pulsar-admin"></a><a href="#pulsar-admin" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>pulsar-admin</h4>
<p>Use the <a href="/docs/en/2.8.0/reference-pulsar-admin#unload"><code>unload</code></a> subcommand of the <a href="/docs/en/2.8.0/reference-pulsar-admin#namespaces"><code>namespaces</code></a> command.</p>
<div class="tabs"><div class="nav-tabs"><div id="tab-group-5683-tab-5684" class="nav-link active" data-group="group_5683" data-tab="tab-group-5683-content-5684">pulsar-admin</div><div id="tab-group-5683-tab-5685" class="nav-link" data-group="group_5683" data-tab="tab-group-5683-content-5685">REST</div><div id="tab-group-5683-tab-5686" class="nav-link" data-group="group_5683" data-tab="tab-group-5683-content-5686">Java</div></div><div class="tab-content"><div id="tab-group-5683-content-5684" class="tab-pane active" data-group="group_5683" tabindex="-1"><div><span><pre><code class="hljs css language-shell"><span class="hljs-meta">$</span><span class="bash"> pulsar-admin namespaces unload my-tenant/my-ns</span><br /></code></pre>
</span></div></div><div id="tab-group-5683-content-5685" class="tab-pane" data-group="group_5683" tabindex="-1"><div><span><pre><code class="hljs">{<span class="hljs-variable">@inject:</span> endpoint|PUT|/admin/v2/namespaces/:tenant/:namespace/unload|operation/unloadNamespace?version=[[<span class="hljs-attribute">pulsar</span>:version_number]]}<br /></code></pre>
</span></div></div><div id="tab-group-5683-content-5686" class="tab-pane" data-group="group_5683" tabindex="-1"><div><span><pre><code class="hljs css language-java">admin.namespaces().unload(namespace)<br /></code></pre>
</span></div></div></div></div>
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/en/2.8.0/admin-api-brokers"><span class="arrow-prev"></span><span>Brokers</span></a><a class="docs-next button" href="/docs/en/2.8.0/admin-api-permissions"><span>Permissions</span><span class="arrow-next"></span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#namespaces-resources">Namespaces resources</a><ul class="toc-headings"><li><a href="#create-namespaces">Create namespaces</a></li><li><a href="#get-policies">Get policies</a></li><li><a href="#list-namespaces">List namespaces</a></li><li><a href="#delete-namespaces">Delete namespaces</a></li><li><a href="#configure-replication-clusters">Configure replication clusters</a></li><li><a href="#configure-backlog-quota-policies">Configure backlog quota policies</a></li><li><a href="#configure-persistence-policies">Configure persistence policies</a></li><li><a href="#configure-namespace-bundles">Configure namespace bundles</a></li><li><a href="#configure-message-ttl">Configure message TTL</a></li><li><a href="#clear-backlog">Clear backlog</a></li><li><a href="#configure-retention">Configure retention</a></li><li><a href="#configure-dispatch-throttling-for-topics">Configure dispatch throttling for topics</a></li><li><a href="#configure-dispatch-throttling-for-subscription">Configure dispatch throttling for subscription</a></li><li><a href="#configure-dispatch-throttling-for-replicator">Configure dispatch throttling for replicator</a></li><li><a href="#configure-deduplication-snapshot-interval">Configure deduplication snapshot interval</a></li><li><a href="#namespace-isolation">Namespace isolation</a></li><li><a href="#unload-namespaces-from-a-broker">Unload namespaces from a broker</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="copyright">Copyright © 2022 The Apache Software Foundation. All Rights Reserved. Apache, Apache Pulsar and the Apache feather logo are trademarks of The Apache Software Foundation.</section><span><script>
const community = document.querySelector("a[href='#community']").parentNode;
const communityMenu =
'<li>' +
'<a id="community-menu" href="#">Community <span style="font-size: 0.75em">&nbsp;▼</span></a>' +
'<div id="community-dropdown" class="hide">' +
'<ul id="community-dropdown-items">' +
'<li><a href="/en/contact">Contact</a></li>' +
'<li><a href="/en/contributing">Contributing</a></li>' +
'<li><a href="/en/coding-guide">Coding guide</a></li>' +
'<li><a href="/en/events">Events</a></li>' +
'<li><a href="https://twitter.com/Apache_Pulsar" target="_blank">Twitter &#x2750</a></li>' +
'<li><a href="https://github.com/apache/pulsar/wiki" target="_blank">Wiki &#x2750</a></li>' +
'<li><a href="https://github.com/apache/pulsar/issues" target="_blank">Issue tracking &#x2750</a></li>' +
'<li><a href="https://pulsar-summit.org/" target="_blank">Pulsar Summit &#x2750</a></li>' +
'<li>&nbsp;</li>' +
'<li><a href="/en/resources">Resources</a></li>' +
'<li><a href="/en/team">Team</a></li>' +
'<li><a href="/en/powered-by">Powered By</a></li>' +
'</ul>' +
'</div>' +
'</li>';
community.innerHTML = communityMenu;
const communityMenuItem = document.getElementById("community-menu");
const communityDropDown = document.getElementById("community-dropdown");
communityMenuItem.addEventListener("click", function(event) {
event.preventDefault();
if (communityDropDown.className == 'hide') {
communityDropDown.className = 'visible';
} else {
communityDropDown.className = 'hide';
}
});
</script></span></footer></div><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script></body></html>