PageSourceSearch

https://opal.ac/assets/js/71b54771.0a3f99f5.js

js opal.ac collected 2026-10-04 00:21:18 UTC 4,005 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkdocumentation=globalThis.webpackChunkdocumentation||[]).push([[955],{2424(t,e,n){n.r(e),n.d(e,{assets:()=>l,contentTitle:()=>r,default:()=>p,frontMatter:()=>o,metadata:()=>i,toc:()=>c});const i=JSON.parse('{"id":"getting-started/running-opal/run-opal-client/data-topics","title":"Subscribe to Data Topics","description":"Step 4: Client config - data topics (Optional)","source":"@site/docs/getting-started/running-opal/run-opal-client/data-topics.mdx","sourceDirName":"getting-started/running-opal/run-opal-client","slug":"/getting-started/running-opal/run-opal-client/data-topics","permalink":"/getting-started/running-opal/run-opal-client/data-topics","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{},"sidebar":"opalSidebar","previous":{"title":"Server URI","permalink":"/getting-started/running-opal/run-opal-client/server-uri"},"next":{"title":"OPA Runner Parameters","permalink":"/getting-started/running-opal/run-opal-client/opa-runner-parameters"}}');var a=n(1684),s=n(506);const o={},r="Subscribe to Data Topics",l={},c=[{value:"Step 4: Client config - data topics (Optional)",id:"step-4-client-config---data-topics-optional",level:3}];function d(t){const e={code:"code",h1:"h1",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...t.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(e.header,{children:(0,a.jsx)(e.h1,{id:"subscribe-to-data-topics",children:"Subscribe to Data Topics"})}),"\n",(0,a.jsx)(e.h3,{id:"step-4-client-config---data-topics-optional",children:"Step 4: Client config - data topics (Optional)"}),"\n",(0,a.jsx)(e.p,{children:"You can configure which topics for data updates the client will subscribe to. This is great if you want more granularity in your data model, for example:"}),"\n",(0,a.jsxs)(e.ul,{children:["\n",(0,a.jsxs)(e.li,{children:[(0,a.jsx)(e.strong,{children:"Enabling multi-tenancy:"})," you deploy each customer (tenant) with his own OPA agent, each agent's OPAL client will subscribe only to the relevant tenant's topic."]}),"\n",(0,a.jsxs)(e.li,{children:[(0,a.jsx)(e.strong,{children:"Sharding large datasets:"})," you split a big data set (i.e: policies based on user attributes and you have ",(0,a.jsx)(e.strong,{children:"many"})," users) to many instances of OPA agent, each agent's OPAL client will subscribe only to the relevant's shard topic."]}),"\n"]}),"\n",(0,a.jsxs)(e.p,{children:["If you do not specify data topics in your configuration, OPAL client will automatically subscribe to a single topic: ",(0,a.jsx)(e.code,{children:"policy_data"})," (the default)."]}),"\n",(0,a.jsx)(e.p,{children:"Use this env var to control which topics the client will subscribe to:"}),"\n",(0,a.jsxs)(e.table,{children:[(0,a.jsx)(e.thead,{children:(0,a.jsxs)(e.tr,{children:[(0,a.jsx)(e.th,{style:{textAlign:"left"},children:"Env Var Name"}),(0,a.jsx)(e.th,{style:{textAlign:"left"},children:"Function"})]})}),(0,a.jsx)(e.tbody,{children:(0,a.jsxs)(e.tr,{children:[(0,a.jsx)(e.td,{style:{textAlign:"left"},children:"OPAL_DATA_TOPICS"}),(0,a.jsxs)(e.td,{style:{textAlign:"left"},children:["data topics delimited by comma (i,e: ",(0,a.jsx)(e.code,{children:","}),")"]})]})})]}),"\n",(0,a.jsx)(e.p,{children:"Example value:"}),"\n",(0,a.jsx)(e.pre,{children:(0,a.jsx)(e.code,{className:"language-sh",children:"export OPAL_DATA_TOPICS=topic1,topic2,topic3\n"})})]})}function p(t={}){const{wrapper:e}={...(0,s.R)(),...t.components};return e?(0,a.jsx)(e,{...t,children:(0,a.jsx)(d,{...t})}):d(t)}},506(t,e,n){n.d(e,{R:()=>o,x:()=>r});var i=n(2888);const a={},s=i.createContext(a);function o(t){const e=i.useContext(s);return i.useMemo(function(){return"function"==typeof t?t(e):{...e,...t}},[e,t])}function r(t){let e;return e=t.disableParentContext?"function"==typeof t.components?t.components(a):t.components||a:o(t.components),i.createElement(s.Provider,{value:e},t.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.