[{"data":1,"prerenderedAt":4339},["ShallowReactive",2],{"navigation":3,"\u002Fdocs\u002Fbuilding\u002Fstreams-builder":314,"\u002Fdocs\u002Fbuilding\u002Fstreams-builder-surround":4334},[4,38,86,149,176,219,257,273],{"title":5,"path":6,"stem":7,"children":8,"icon":37},"Getting Started","\u002Fdocs\u002Fgetting-started","1.docs\u002F1.getting-started\u002F1.index",[9,12,17,22,27,32],{"title":10,"path":6,"stem":7,"icon":11},"Getting started","i-lucide-flag",{"title":13,"path":14,"stem":15,"icon":16},"Modules overview","\u002Fdocs\u002Fgetting-started\u002Fmodules-overview","1.docs\u002F1.getting-started\u002F2.modules-overview","i-lucide-boxes",{"title":18,"path":19,"stem":20,"icon":21},"Installation","\u002Fdocs\u002Fgetting-started\u002Finstallation","1.docs\u002F1.getting-started\u002F3.installation","i-lucide-download",{"title":23,"path":24,"stem":25,"icon":26},"License configuration","\u002Fdocs\u002Fgetting-started\u002Flicense-configuration","1.docs\u002F1.getting-started\u002F4.license-configuration","i-lucide-key-round",{"title":28,"path":29,"stem":30,"icon":31},"Your first app","\u002Fdocs\u002Fgetting-started\u002Ffirst-app","1.docs\u002F1.getting-started\u002F5.first-app","i-lucide-square-play",{"title":33,"path":34,"stem":35,"icon":36},"Project setup","\u002Fdocs\u002Fgetting-started\u002Fproject-setup","1.docs\u002F1.getting-started\u002F6.project-setup","i-lucide-package",false,{"title":39,"path":40,"stem":41,"children":42,"icon":45},"Core Concepts","\u002Fdocs\u002Fconcepts","1.docs\u002F2.concepts\u002F1.index",[43,46,51,56,61,66,71,76,81],{"title":44,"path":40,"stem":41,"icon":45},"Core concepts","i-lucide-book-open",{"title":47,"path":48,"stem":49,"icon":50},"Architecture","\u002Fdocs\u002Fconcepts\u002Farchitecture","1.docs\u002F2.concepts\u002F2.architecture","i-lucide-layers",{"title":52,"path":53,"stem":54,"icon":55},"Exactly-once semantics","\u002Fdocs\u002Fconcepts\u002Fexactly-once","1.docs\u002F2.concepts\u002F3.exactly-once","i-lucide-shield-check",{"title":57,"path":58,"stem":59,"icon":60},"Lanes and parallelism","\u002Fdocs\u002Fconcepts\u002Flanes-and-parallelism","1.docs\u002F2.concepts\u002F4.lanes-and-parallelism","i-lucide-split",{"title":62,"path":63,"stem":64,"icon":65},"State and thread-safety","\u002Fdocs\u002Fconcepts\u002Fstate-and-thread-safety","1.docs\u002F2.concepts\u002F5.state-and-thread-safety","i-lucide-lock",{"title":67,"path":68,"stem":69,"icon":70},"Event time and watermarks","\u002Fdocs\u002Fconcepts\u002Fevent-time-and-watermarks","1.docs\u002F2.concepts\u002F6.event-time-and-watermarks","i-lucide-clock",{"title":72,"path":73,"stem":74,"icon":75},"The configuration model","\u002Fdocs\u002Fconcepts\u002Fconfiguration-model","1.docs\u002F2.concepts\u002F7.configuration-model","i-lucide-sliders-horizontal",{"title":77,"path":78,"stem":79,"icon":80},"The error-handling model","\u002Fdocs\u002Fconcepts\u002Ferror-handling-model","1.docs\u002F2.concepts\u002F8.error-handling-model","i-lucide-triangle-alert",{"title":82,"path":83,"stem":84,"icon":85},"How StoatFlow differs from Kafka Streams","\u002Fdocs\u002Fconcepts\u002Fhow-stoatflow-differs-from-ks","1.docs\u002F2.concepts\u002F9.how-stoatflow-differs-from-ks","i-lucide-arrow-left-right",{"title":87,"path":88,"stem":89,"children":90,"icon":93},"Building Topologies","\u002Fdocs\u002Fbuilding","1.docs\u002F3.building\u002F1.index",[91,94,99,104,109,114,119,124,129,134,139,144],{"title":92,"path":88,"stem":89,"icon":93},"Building topologies","i-lucide-blocks",{"title":95,"path":96,"stem":97,"icon":98},"Error handling and DLQ","\u002Fdocs\u002Fbuilding\u002Ferror-handling-dlq","1.docs\u002F3.building\u002F10.error-handling-dlq","i-lucide-circle-x",{"title":100,"path":101,"stem":102,"icon":103},"State stores","\u002Fdocs\u002Fbuilding\u002Fstate-stores","1.docs\u002F3.building\u002F11.state-stores","i-lucide-database",{"title":105,"path":106,"stem":107,"icon":108},"Testing topologies","\u002Fdocs\u002Fbuilding\u002Ftesting","1.docs\u002F3.building\u002F12.testing","i-lucide-flask-conical",{"title":110,"path":111,"stem":112,"icon":113},"Sources and sinks","\u002Fdocs\u002Fbuilding\u002Fstreams-builder","1.docs\u002F3.building\u002F2.streams-builder","i-lucide-import",{"title":115,"path":116,"stem":117,"icon":118},"KStream and KTable operations","\u002Fdocs\u002Fbuilding\u002Fkstream-ktable","1.docs\u002F3.building\u002F3.kstream-ktable","i-lucide-waypoints",{"title":120,"path":121,"stem":122,"icon":123},"Aggregations","\u002Fdocs\u002Fbuilding\u002Faggregations","1.docs\u002F3.building\u002F4.aggregations","i-lucide-sigma",{"title":125,"path":126,"stem":127,"icon":128},"Windowing","\u002Fdocs\u002Fbuilding\u002Fwindowing","1.docs\u002F3.building\u002F5.windowing","i-lucide-calendar-clock",{"title":130,"path":131,"stem":132,"icon":133},"Joins","\u002Fdocs\u002Fbuilding\u002Fjoins","1.docs\u002F3.building\u002F6.joins","i-lucide-git-merge",{"title":135,"path":136,"stem":137,"icon":138},"The Processor API","\u002Fdocs\u002Fbuilding\u002Fprocessor-api","1.docs\u002F3.building\u002F7.processor-api","i-lucide-cpu",{"title":140,"path":141,"stem":142,"icon":143},"Scheduled sources","\u002Fdocs\u002Fbuilding\u002Fscheduled-sources","1.docs\u002F3.building\u002F8.scheduled-sources","i-lucide-timer",{"title":145,"path":146,"stem":147,"icon":148},"Serdes and Avro","\u002Fdocs\u002Fbuilding\u002Fserdes","1.docs\u002F3.building\u002F9.serdes","i-lucide-binary",{"title":150,"path":151,"stem":152,"children":153,"icon":75},"Configuration","\u002Fdocs\u002Fconfiguration","1.docs\u002F4.configuration\u002F1.index",[154,156,161,166,171],{"title":155,"path":151,"stem":152,"icon":75},"How configuration works",{"title":157,"path":158,"stem":159,"icon":160},"Engine configuration (:core)","\u002Fdocs\u002Fconfiguration\u002Fcore-config","1.docs\u002F4.configuration\u002F2.core-config","i-lucide-settings-2",{"title":162,"path":163,"stem":164,"icon":165},"Runtime configuration (:runtime)","\u002Fdocs\u002Fconfiguration\u002Fruntime-config","1.docs\u002F4.configuration\u002F3.runtime-config","i-lucide-server-cog",{"title":167,"path":168,"stem":169,"icon":170},"Defaults, adaptivity, and presets","\u002Fdocs\u002Fconfiguration\u002Fdefaults-and-presets","1.docs\u002F4.configuration\u002F4.defaults-and-presets","i-lucide-gauge",{"title":172,"path":173,"stem":174,"icon":175},"Kafka client configuration","\u002Fdocs\u002Fconfiguration\u002Fkafka-client-config","1.docs\u002F4.configuration\u002F5.kafka-client-config","i-lucide-plug",{"title":177,"path":178,"stem":179,"children":180,"icon":183},"Running in Production","\u002Fdocs\u002Fruntime","1.docs\u002F5.runtime\u002F1.index",[181,184,189,194,199,204,209,214],{"title":182,"path":178,"stem":179,"icon":183},"The runtime","i-lucide-server",{"title":185,"path":186,"stem":187,"icon":188},"The REST API","\u002Fdocs\u002Fruntime\u002Frest-api","1.docs\u002F5.runtime\u002F2.rest-api","i-lucide-globe",{"title":190,"path":191,"stem":192,"icon":193},"Health checks","\u002Fdocs\u002Fruntime\u002Fhealth-checks","1.docs\u002F5.runtime\u002F3.health-checks","i-lucide-heart-pulse",{"title":195,"path":196,"stem":197,"icon":198},"Metrics","\u002Fdocs\u002Fruntime\u002Fmetrics","1.docs\u002F5.runtime\u002F4.metrics","i-lucide-activity",{"title":200,"path":201,"stem":202,"icon":203},"Pause and resume","\u002Fdocs\u002Fruntime\u002Fpause-unpause","1.docs\u002F5.runtime\u002F5.pause-unpause","i-lucide-pause",{"title":205,"path":206,"stem":207,"icon":208},"Plugins and lifecycle hooks","\u002Fdocs\u002Fruntime\u002Fplugins","1.docs\u002F5.runtime\u002F6.plugins","i-lucide-puzzle",{"title":210,"path":211,"stem":212,"icon":213},"Docker images","\u002Fdocs\u002Fruntime\u002Fdocker","1.docs\u002F5.runtime\u002F7.docker","i-lucide-container",{"title":215,"path":216,"stem":217,"icon":218},"GraalVM native image","\u002Fdocs\u002Fruntime\u002Fnative-image","1.docs\u002F5.runtime\u002F8.native-image","i-lucide-zap",{"title":220,"path":221,"stem":222,"children":223,"icon":226},"Deploying & Operating","\u002Fdocs\u002Foperating","1.docs\u002F6.operating\u002F1.index",[224,227,232,237,242,247,252],{"title":225,"path":221,"stem":222,"icon":226},"Deploying and operating","i-lucide-life-buoy",{"title":228,"path":229,"stem":230,"icon":231},"Running on Kubernetes","\u002Fdocs\u002Foperating\u002Fkubernetes","1.docs\u002F6.operating\u002F2.kubernetes","i-lucide-ship",{"title":233,"path":234,"stem":235,"icon":236},"High availability","\u002Fdocs\u002Foperating\u002Fhigh-availability","1.docs\u002F6.operating\u002F3.high-availability","i-lucide-copy",{"title":238,"path":239,"stem":240,"icon":241},"Liveness and readiness probes","\u002Fdocs\u002Foperating\u002Fprobes","1.docs\u002F6.operating\u002F4.probes","i-lucide-stethoscope",{"title":243,"path":244,"stem":245,"icon":246},"Observability","\u002Fdocs\u002Foperating\u002Fobservability","1.docs\u002F6.operating\u002F5.observability","i-lucide-telescope",{"title":248,"path":249,"stem":250,"icon":251},"Tuning under load","\u002Fdocs\u002Foperating\u002Ftuning","1.docs\u002F6.operating\u002F6.tuning","i-lucide-sliders",{"title":253,"path":254,"stem":255,"icon":256},"Production checklist","\u002Fdocs\u002Foperating\u002Fproduction-checklist","1.docs\u002F6.operating\u002F7.production-checklist","i-lucide-clipboard-check",{"title":258,"path":259,"stem":260,"children":261,"icon":85},"Migrating from Kafka Streams","\u002Fdocs\u002Fmigration","1.docs\u002F7.migration\u002F1.index",[262,263,268],{"title":258,"path":259,"stem":260,"icon":85},{"title":264,"path":265,"stem":266,"icon":267},"Migration without carrying state","\u002Fdocs\u002Fmigration\u002Fwithout-data-migration","1.docs\u002F7.migration\u002F2.without-data-migration","i-lucide-sparkles",{"title":269,"path":270,"stem":271,"icon":272},"Migration carrying state","\u002Fdocs\u002Fmigration\u002Fwith-data-migration","1.docs\u002F7.migration\u002F3.with-data-migration","i-lucide-database-backup",{"title":274,"path":275,"stem":276,"children":277,"icon":279},"Reference","\u002Fdocs\u002Freference","1.docs\u002F8.reference\u002F1.index",[278,280,285,290,295,300,305,309],{"title":274,"path":275,"stem":276,"icon":279},"i-lucide-list",{"title":281,"path":282,"stem":283,"icon":284},"Configuration reference","\u002Fdocs\u002Freference\u002Fconfiguration-reference","1.docs\u002F8.reference\u002F2.configuration-reference","i-lucide-table",{"title":286,"path":287,"stem":288,"icon":289},"REST API reference","\u002Fdocs\u002Freference\u002Frest-api-reference","1.docs\u002F8.reference\u002F3.rest-api-reference","i-lucide-network",{"title":291,"path":292,"stem":293,"icon":294},"Gradle plugin reference","\u002Fdocs\u002Freference\u002Fgradle-plugin-reference","1.docs\u002F8.reference\u002F4.gradle-plugin-reference","i-lucide-box",{"title":296,"path":297,"stem":298,"icon":299},"Maven reference","\u002Fdocs\u002Freference\u002Fmaven-reference","1.docs\u002F8.reference\u002F5.maven-reference","i-simple-icons-apachemaven",{"title":301,"path":302,"stem":303,"icon":304},"Kafka Streams compatibility matrix","\u002Fdocs\u002Freference\u002Fks-compatibility-matrix","1.docs\u002F8.reference\u002F6.ks-compatibility-matrix","i-lucide-table-2",{"title":306,"path":307,"stem":308,"icon":170},"Metrics reference","\u002Fdocs\u002Freference\u002Fmetrics-reference","1.docs\u002F8.reference\u002F7.metrics-reference",{"title":310,"path":311,"stem":312,"icon":313},"Glossary","\u002Fdocs\u002Freference\u002Fglossary","1.docs\u002F8.reference\u002F8.glossary","i-lucide-book-a",{"id":315,"title":110,"body":316,"description":4327,"extension":4328,"meta":4329,"navigation":4330,"pageType":4331,"path":111,"seo":4332,"stem":112,"__hash__":4333},"docs\u002F1.docs\u002F3.building\u002F2.streams-builder.md",{"type":317,"value":318,"toc":4306},"minimark",[319,352,363,449,454,466,839,844,853,1103,1125,1129,1158,1655,1672,1676,1683,1766,1778,1784,1794,1865,1939,1945,1966,1970,1986,2043,2312,2315,2319,2338,2733,2760,2769,2779,3081,3117,3121,3136,3453,3457,3468,3665,3699,3702,3715,3978,4004,4008,4028,4242,4246,4302],[320,321,322,323,327,328,331,332,335,336,339,340,343,344,347,348,351],"p",{},"Every topology starts at a source and ends at a sink. ",[324,325,326],"code",{},"StreamsBuilder"," opens source topics — ",[324,329,330],{},"stream"," for an event stream, ",[324,333,334],{},"table"," \u002F ",[324,337,338],{},"globalTable"," for a changelog table — and ",[324,341,342],{},"KStream.to"," writes records back to Kafka. ",[324,345,346],{},"Consumed"," configures the read side (serdes, offset reset, watermarks); ",[324,349,350],{},"Produced"," configures the write side (serdes, partitioner, dynamic topic routing).",[320,353,354,355,359,360,362],{},"This page covers the source and sink methods only. For the operators in between, see ",[356,357,358],"a",{"href":116},"KStream and KTable",". For the engine that runs the topology, see ",[356,361,47],{"href":48},".",[364,365,366],"tldr-panel",{},[367,368,369,384,403,422,435],"ul",{},[370,371,372,376,377,380,381,362],"li",{},[373,374,375],"strong",{},"Read a stream:"," ",[324,378,379],{},"builder.stream\u003CK, V>(\"topic\", consumed)"," returns a ",[324,382,383],{},"KStream\u003CK, V>",[370,385,386,376,389,335,392,395,396,335,399,402],{},[373,387,388],{},"Read a table:",[324,390,391],{},"builder.table(...)",[324,393,394],{},"builder.globalTable(...)"," return a changelog-backed ",[324,397,398],{},"KTable",[324,400,401],{},"GlobalKTable"," — always materialized into a state store.",[370,404,405,376,408,411,412,415,416,415,419,362],{},[373,406,407],{},"Configure the read:",[324,409,410],{},"Consumed.with(keySerde, valueSerde)",", then chain ",[324,413,414],{},".withOffsetResetPolicy(...)",", ",[324,417,418],{},".withWatermarkStrategy(...)",[324,420,421],{},".withName(...)",[370,423,424,376,427,430,431,434],{},[373,425,426],{},"Write a sink:",[324,428,429],{},"stream.to(\"topic\", Produced.with(keySerde, valueSerde))",", or ",[324,432,433],{},"stream.to(topicNameExtractor, produced)"," for per-record routing.",[370,436,437,440,441,444,445,448],{},[373,438,439],{},"Fan-out:"," reuse the same ",[324,442,443],{},"KStream"," reference for multiple branches — never call ",[324,446,447],{},"builder.stream(...)"," twice on the same topic.",[450,451,453],"h2",{"id":452},"reading-a-stream","Reading a stream",[320,455,456,459,460,462,463,465],{},[324,457,458],{},"builder.stream"," subscribes to one or more topics and returns a ",[324,461,383],{},". Pass a ",[324,464,346],{}," to configure deserialization and source behaviour; omit it to fall back to the default serdes from your config.",[467,468,470,611],"code-tabs",{"group":469},"lang",[471,472,478],"pre",{"className":473,"code":474,"filename":475,"language":476,"meta":477,"style":477},"language-kotlin shiki shiki-themes vitesse-light","import io.stoatflow.core.topology.Consumed\nimport io.stoatflow.core.topology.StreamsBuilder\nimport org.apache.kafka.common.serialization.Serdes\n\nfun buildTopology(builder: StreamsBuilder) {\n    val orders =\n        builder.stream(\n            \"orders\",\n            Consumed.with(Serdes.String(), Serdes.String()),\n        )\n    \u002F\u002F orders: KStream\u003CString, String>\n}\n","Kotlin","kotlin","",[324,479,480,493,501,509,516,535,548,559,569,592,598,605],{"__ignoreMap":477},[481,482,485,489],"span",{"class":483,"line":484},"line",1,[481,486,488],{"class":487},"sbBg2","import",[481,490,492],{"class":491},"sySUi"," io.stoatflow.core.topology.Consumed\n",[481,494,496,498],{"class":483,"line":495},2,[481,497,488],{"class":487},[481,499,500],{"class":491}," io.stoatflow.core.topology.StreamsBuilder\n",[481,502,504,506],{"class":483,"line":503},3,[481,505,488],{"class":487},[481,507,508],{"class":491}," org.apache.kafka.common.serialization.Serdes\n",[481,510,512],{"class":483,"line":511},4,[481,513,515],{"emptyLinePlaceholder":514},true,"\n",[481,517,519,522,525,529,532],{"class":483,"line":518},5,[481,520,521],{"class":487},"fun",[481,523,524],{"class":491}," buildTopology",[481,526,528],{"class":527},"suHK_","(builder: ",[481,530,326],{"class":531},"sUxyF",[481,533,534],{"class":527},") {\n",[481,536,538,541,544],{"class":483,"line":537},6,[481,539,540],{"class":487},"    val",[481,542,543],{"class":527}," orders ",[481,545,547],{"class":546},"sYZai","=\n",[481,549,551,554,556],{"class":483,"line":550},7,[481,552,553],{"class":527},"        builder.",[481,555,330],{"class":491},[481,557,558],{"class":527},"(\n",[481,560,562,566],{"class":483,"line":561},8,[481,563,565],{"class":564},"spphp","            \"orders\"",[481,567,568],{"class":527},",\n",[481,570,572,575,578,581,584,587,589],{"class":483,"line":571},9,[481,573,574],{"class":527},"            Consumed.",[481,576,577],{"class":491},"with",[481,579,580],{"class":527},"(Serdes.",[481,582,583],{"class":491},"String",[481,585,586],{"class":527},"(), Serdes.",[481,588,583],{"class":491},[481,590,591],{"class":527},"()),\n",[481,593,595],{"class":483,"line":594},10,[481,596,597],{"class":527},"        )\n",[481,599,601],{"class":483,"line":600},11,[481,602,604],{"class":603},"s8zF2","    \u002F\u002F orders: KStream\u003CString, String>\n",[481,606,608],{"class":483,"line":607},12,[481,609,610],{"class":527},"}\n",[471,612,617],{"className":613,"code":614,"filename":615,"language":616,"meta":477,"style":477},"language-java shiki shiki-themes vitesse-light","import io.stoatflow.core.topology.Consumed;\nimport io.stoatflow.core.topology.KStream;\nimport io.stoatflow.core.topology.StreamsBuilder;\nimport org.apache.kafka.common.serialization.Serdes;\n\nvoid buildTopology(StreamsBuilder builder) {\n    KStream\u003CString, String> orders =\n        builder.stream(\n            \"orders\",\n            Consumed.with(Serdes.String(), Serdes.String()));\n}\n","Java","java",[324,618,619,648,672,696,730,734,754,780,791,805,835],{"__ignoreMap":477},[481,620,621,623,626,628,631,633,636,638,641,643,645],{"class":483,"line":484},[481,622,488],{"class":487},[481,624,625],{"class":527}," io",[481,627,362],{"class":546},[481,629,630],{"class":527},"stoatflow",[481,632,362],{"class":546},[481,634,635],{"class":527},"core",[481,637,362],{"class":546},[481,639,640],{"class":527},"topology",[481,642,362],{"class":546},[481,644,346],{"class":527},[481,646,647],{"class":546},";\n",[481,649,650,652,654,656,658,660,662,664,666,668,670],{"class":483,"line":495},[481,651,488],{"class":487},[481,653,625],{"class":527},[481,655,362],{"class":546},[481,657,630],{"class":527},[481,659,362],{"class":546},[481,661,635],{"class":527},[481,663,362],{"class":546},[481,665,640],{"class":527},[481,667,362],{"class":546},[481,669,443],{"class":527},[481,671,647],{"class":546},[481,673,674,676,678,680,682,684,686,688,690,692,694],{"class":483,"line":503},[481,675,488],{"class":487},[481,677,625],{"class":527},[481,679,362],{"class":546},[481,681,630],{"class":527},[481,683,362],{"class":546},[481,685,635],{"class":527},[481,687,362],{"class":546},[481,689,640],{"class":527},[481,691,362],{"class":546},[481,693,326],{"class":527},[481,695,647],{"class":546},[481,697,698,700,703,705,708,710,713,715,718,720,723,725,728],{"class":483,"line":511},[481,699,488],{"class":487},[481,701,702],{"class":527}," org",[481,704,362],{"class":546},[481,706,707],{"class":527},"apache",[481,709,362],{"class":546},[481,711,712],{"class":527},"kafka",[481,714,362],{"class":546},[481,716,717],{"class":527},"common",[481,719,362],{"class":546},[481,721,722],{"class":527},"serialization",[481,724,362],{"class":546},[481,726,727],{"class":527},"Serdes",[481,729,647],{"class":546},[481,731,732],{"class":483,"line":518},[481,733,515],{"emptyLinePlaceholder":514},[481,735,736,740,742,745,748,751],{"class":483,"line":537},[481,737,739],{"class":738},"si04Y","void",[481,741,524],{"class":491},[481,743,744],{"class":546},"(",[481,746,747],{"class":527},"StreamsBuilder builder",[481,749,750],{"class":546},")",[481,752,753],{"class":546}," {\n",[481,755,756,759,762,764,767,770,773,777],{"class":483,"line":550},[481,757,758],{"class":527},"    KStream",[481,760,761],{"class":546},"\u003C",[481,763,583],{"class":738},[481,765,766],{"class":546},",",[481,768,769],{"class":738}," String",[481,771,772],{"class":546},">",[481,774,776],{"class":775},"svycV"," orders",[481,778,779],{"class":546}," =\n",[481,781,782,785,787,789],{"class":483,"line":561},[481,783,784],{"class":775},"        builder",[481,786,362],{"class":546},[481,788,330],{"class":491},[481,790,558],{"class":546},[481,792,793,797,800,803],{"class":483,"line":571},[481,794,796],{"class":795},"sSP4y","            \"",[481,798,799],{"class":564},"orders",[481,801,802],{"class":795},"\"",[481,804,568],{"class":546},[481,806,807,810,812,814,816,818,820,822,825,828,830,832],{"class":483,"line":594},[481,808,809],{"class":775},"            Consumed",[481,811,362],{"class":546},[481,813,577],{"class":491},[481,815,744],{"class":546},[481,817,727],{"class":775},[481,819,362],{"class":546},[481,821,583],{"class":491},[481,823,824],{"class":546},"(),",[481,826,827],{"class":775}," Serdes",[481,829,362],{"class":546},[481,831,583],{"class":491},[481,833,834],{"class":546},"()));\n",[481,836,837],{"class":483,"line":600},[481,838,610],{"class":546},[840,841,843],"h3",{"id":842},"multiple-topics-and-patterns","Multiple topics and patterns",[320,845,846,848,849,852],{},[324,847,330],{}," also accepts a collection of topic names — all merged into one stream — or a ",[324,850,851],{},"java.util.regex.Pattern"," for dynamic subscription, where new topics matching the pattern are picked up at runtime.",[467,854,855,938],{"group":469},[471,856,858],{"className":473,"code":857,"filename":475,"language":476,"meta":477,"style":477},"import java.util.regex.Pattern\n\n\u002F\u002F Several named topics, merged into one stream\nbuilder.stream(listOf(\"orders-eu\", \"orders-us\"), Consumed.with(keySerde, valueSerde))\n\n\u002F\u002F Pattern subscription — matching topics are added dynamically\nbuilder.stream(Pattern.compile(\"orders-.*\"), Consumed.with(keySerde, valueSerde))\n",[324,859,860,867,871,876,906,910,915],{"__ignoreMap":477},[481,861,862,864],{"class":483,"line":484},[481,863,488],{"class":487},[481,865,866],{"class":491}," java.util.regex.Pattern\n",[481,868,869],{"class":483,"line":495},[481,870,515],{"emptyLinePlaceholder":514},[481,872,873],{"class":483,"line":503},[481,874,875],{"class":603},"\u002F\u002F Several named topics, merged into one stream\n",[481,877,878,881,883,885,888,890,893,895,898,901,903],{"class":483,"line":511},[481,879,880],{"class":527},"builder.",[481,882,330],{"class":491},[481,884,744],{"class":527},[481,886,887],{"class":491},"listOf",[481,889,744],{"class":527},[481,891,892],{"class":564},"\"orders-eu\"",[481,894,415],{"class":527},[481,896,897],{"class":564},"\"orders-us\"",[481,899,900],{"class":527},"), Consumed.",[481,902,577],{"class":491},[481,904,905],{"class":527},"(keySerde, valueSerde))\n",[481,907,908],{"class":483,"line":518},[481,909,515],{"emptyLinePlaceholder":514},[481,911,912],{"class":483,"line":537},[481,913,914],{"class":603},"\u002F\u002F Pattern subscription — matching topics are added dynamically\n",[481,916,917,919,921,924,927,929,932,934,936],{"class":483,"line":550},[481,918,880],{"class":527},[481,920,330],{"class":491},[481,922,923],{"class":527},"(Pattern.",[481,925,926],{"class":491},"compile",[481,928,744],{"class":527},[481,930,931],{"class":564},"\"orders-.*\"",[481,933,900],{"class":527},[481,935,577],{"class":491},[481,937,905],{"class":527},[471,939,941],{"className":613,"code":940,"filename":615,"language":616,"meta":477,"style":477},"import java.util.List;\nimport java.util.regex.Pattern;\n\n\u002F\u002F Several named topics, merged into one stream\nbuilder.stream(List.of(\"orders-eu\", \"orders-us\"), Consumed.with(keySerde, valueSerde));\n\n\u002F\u002F Pattern subscription — matching topics are added dynamically\nbuilder.stream(Pattern.compile(\"orders-.*\"), Consumed.with(keySerde, valueSerde));\n",[324,942,943,962,984,988,992,1052,1056,1060],{"__ignoreMap":477},[481,944,945,947,950,952,955,957,960],{"class":483,"line":484},[481,946,488],{"class":487},[481,948,949],{"class":527}," java",[481,951,362],{"class":546},[481,953,954],{"class":527},"util",[481,956,362],{"class":546},[481,958,959],{"class":527},"List",[481,961,647],{"class":546},[481,963,964,966,968,970,972,974,977,979,982],{"class":483,"line":495},[481,965,488],{"class":487},[481,967,949],{"class":527},[481,969,362],{"class":546},[481,971,954],{"class":527},[481,973,362],{"class":546},[481,975,976],{"class":527},"regex",[481,978,362],{"class":546},[481,980,981],{"class":527},"Pattern",[481,983,647],{"class":546},[481,985,986],{"class":483,"line":503},[481,987,515],{"emptyLinePlaceholder":514},[481,989,990],{"class":483,"line":511},[481,991,875],{"class":603},[481,993,994,997,999,1001,1003,1005,1007,1010,1012,1014,1017,1019,1021,1024,1027,1029,1032,1035,1037,1039,1041,1044,1046,1049],{"class":483,"line":518},[481,995,996],{"class":775},"builder",[481,998,362],{"class":546},[481,1000,330],{"class":491},[481,1002,744],{"class":546},[481,1004,959],{"class":775},[481,1006,362],{"class":546},[481,1008,1009],{"class":491},"of",[481,1011,744],{"class":546},[481,1013,802],{"class":795},[481,1015,1016],{"class":564},"orders-eu",[481,1018,802],{"class":795},[481,1020,766],{"class":546},[481,1022,1023],{"class":795}," \"",[481,1025,1026],{"class":564},"orders-us",[481,1028,802],{"class":795},[481,1030,1031],{"class":546},"),",[481,1033,1034],{"class":775}," Consumed",[481,1036,362],{"class":546},[481,1038,577],{"class":491},[481,1040,744],{"class":546},[481,1042,1043],{"class":527},"keySerde",[481,1045,766],{"class":546},[481,1047,1048],{"class":527}," valueSerde",[481,1050,1051],{"class":546},"));\n",[481,1053,1054],{"class":483,"line":537},[481,1055,515],{"emptyLinePlaceholder":514},[481,1057,1058],{"class":483,"line":550},[481,1059,914],{"class":603},[481,1061,1062,1064,1066,1068,1070,1072,1074,1076,1078,1080,1083,1085,1087,1089,1091,1093,1095,1097,1099,1101],{"class":483,"line":561},[481,1063,996],{"class":775},[481,1065,362],{"class":546},[481,1067,330],{"class":491},[481,1069,744],{"class":546},[481,1071,981],{"class":775},[481,1073,362],{"class":546},[481,1075,926],{"class":491},[481,1077,744],{"class":546},[481,1079,802],{"class":795},[481,1081,1082],{"class":564},"orders-.*",[481,1084,802],{"class":795},[481,1086,1031],{"class":546},[481,1088,1034],{"class":775},[481,1090,362],{"class":546},[481,1092,577],{"class":491},[481,1094,744],{"class":546},[481,1096,1043],{"class":527},[481,1098,766],{"class":546},[481,1100,1048],{"class":527},[481,1102,1051],{"class":546},[1104,1105,1107],"callout",{"color":1106,"icon":80},"warning",[320,1108,1109,1110,1113,1114,1116,1117,1119,1120,1124],{},"A topic may only be registered as a source ",[373,1111,1112],{},"once"," per topology. Subscribing to it from two separate ",[324,1115,447],{}," calls is rejected when the topology is built. To process the same input two ways, reuse one ",[324,1118,443],{}," reference — see ",[356,1121,1123],{"href":1122},"#the-fan-out-rule","The fan-out rule"," below.",[450,1126,1128],{"id":1127},"reading-a-table","Reading a table",[320,1130,1131,1134,1135,1138,1139,1142,1143,1146,1147,1150,1151,1154,1155,1157],{},[324,1132,1133],{},"builder.table"," interprets a topic as a ",[373,1136,1137],{},"changelog"," — the latest value per key is the current state — and returns a ",[324,1140,1141],{},"KTable\u003CK, V>"," backed by a state store. Unlike a plain stream, a table is ",[373,1144,1145],{},"always materialized",": when you don't pass a ",[324,1148,1149],{},"Materialized",", StoatFlow auto-creates a store named ",[324,1152,1153],{},"{topic}-store",". (See ",[356,1156,100],{"href":101}," for store configuration.)",[467,1159,1160,1346],{"group":469},[471,1161,1163],{"className":473,"code":1162,"filename":475,"language":476,"meta":477,"style":477},"import io.stoatflow.core.state.StateStore\nimport io.stoatflow.core.topology.Consumed\nimport io.stoatflow.core.topology.Materialized\n\n\u002F\u002F Auto-materialized into \"customers-store\"\nval customers = builder.table(\"customers\", Consumed.with(Serdes.String(), Serdes.String()))\n\n\u002F\u002F Explicit store name + serdes\nval customersNamed =\n    builder.table(\n        \"customers\",\n        Consumed.`as`(\"customers-source\"),\n        Materialized.`as`\u003CString, String, StateStore>(\"customers\")\n            .withKeySerde(Serdes.String())\n            .withValueSerde(Serdes.String()),\n    )\n",[324,1164,1165,1172,1178,1185,1189,1194,1231,1235,1240,1249,1258,1265,1281,1310,1326,1340],{"__ignoreMap":477},[481,1166,1167,1169],{"class":483,"line":484},[481,1168,488],{"class":487},[481,1170,1171],{"class":491}," io.stoatflow.core.state.StateStore\n",[481,1173,1174,1176],{"class":483,"line":495},[481,1175,488],{"class":487},[481,1177,492],{"class":491},[481,1179,1180,1182],{"class":483,"line":503},[481,1181,488],{"class":487},[481,1183,1184],{"class":491}," io.stoatflow.core.topology.Materialized\n",[481,1186,1187],{"class":483,"line":511},[481,1188,515],{"emptyLinePlaceholder":514},[481,1190,1191],{"class":483,"line":518},[481,1192,1193],{"class":603},"\u002F\u002F Auto-materialized into \"customers-store\"\n",[481,1195,1196,1199,1202,1205,1208,1210,1212,1215,1218,1220,1222,1224,1226,1228],{"class":483,"line":537},[481,1197,1198],{"class":487},"val",[481,1200,1201],{"class":527}," customers ",[481,1203,1204],{"class":546},"=",[481,1206,1207],{"class":527}," builder.",[481,1209,334],{"class":491},[481,1211,744],{"class":527},[481,1213,1214],{"class":564},"\"customers\"",[481,1216,1217],{"class":527},", Consumed.",[481,1219,577],{"class":491},[481,1221,580],{"class":527},[481,1223,583],{"class":491},[481,1225,586],{"class":527},[481,1227,583],{"class":491},[481,1229,1230],{"class":527},"()))\n",[481,1232,1233],{"class":483,"line":550},[481,1234,515],{"emptyLinePlaceholder":514},[481,1236,1237],{"class":483,"line":561},[481,1238,1239],{"class":603},"\u002F\u002F Explicit store name + serdes\n",[481,1241,1242,1244,1247],{"class":483,"line":571},[481,1243,1198],{"class":487},[481,1245,1246],{"class":527}," customersNamed ",[481,1248,547],{"class":546},[481,1250,1251,1254,1256],{"class":483,"line":594},[481,1252,1253],{"class":527},"    builder.",[481,1255,334],{"class":491},[481,1257,558],{"class":527},[481,1259,1260,1263],{"class":483,"line":600},[481,1261,1262],{"class":564},"        \"customers\"",[481,1264,568],{"class":527},[481,1266,1267,1270,1273,1275,1278],{"class":483,"line":607},[481,1268,1269],{"class":527},"        Consumed.",[481,1271,1272],{"class":491},"`as`",[481,1274,744],{"class":527},[481,1276,1277],{"class":564},"\"customers-source\"",[481,1279,1280],{"class":527},"),\n",[481,1282,1284,1287,1289,1291,1293,1295,1297,1299,1302,1305,1307],{"class":483,"line":1283},13,[481,1285,1286],{"class":527},"        Materialized.",[481,1288,1272],{"class":491},[481,1290,761],{"class":527},[481,1292,583],{"class":531},[481,1294,415],{"class":527},[481,1296,583],{"class":531},[481,1298,415],{"class":527},[481,1300,1301],{"class":531},"StateStore",[481,1303,1304],{"class":527},">(",[481,1306,1214],{"class":564},[481,1308,1309],{"class":527},")\n",[481,1311,1313,1316,1319,1321,1323],{"class":483,"line":1312},14,[481,1314,1315],{"class":527},"            .",[481,1317,1318],{"class":491},"withKeySerde",[481,1320,580],{"class":527},[481,1322,583],{"class":491},[481,1324,1325],{"class":527},"())\n",[481,1327,1329,1331,1334,1336,1338],{"class":483,"line":1328},15,[481,1330,1315],{"class":527},[481,1332,1333],{"class":491},"withValueSerde",[481,1335,580],{"class":527},[481,1337,583],{"class":491},[481,1339,591],{"class":527},[481,1341,1343],{"class":483,"line":1342},16,[481,1344,1345],{"class":527},"    )\n",[471,1347,1349],{"className":613,"code":1348,"filename":615,"language":616,"meta":477,"style":477},"import io.stoatflow.core.state.StateStore;\nimport io.stoatflow.core.topology.Consumed;\nimport io.stoatflow.core.topology.KTable;\nimport io.stoatflow.core.topology.Materialized;\n\n\u002F\u002F Auto-materialized into \"customers-store\"\nKTable\u003CString, String> customers =\n    builder.table(\"customers\", Consumed.with(Serdes.String(), Serdes.String()));\n\n\u002F\u002F Explicit store name + serdes\nKTable\u003CString, String> customersNamed =\n    builder.table(\n        \"customers\",\n        Consumed.as(\"customers-source\"),\n        Materialized.\u003CString, String, StateStore>as(\"customers\")\n            .withKeySerde(Serdes.String())\n            .withValueSerde(Serdes.String()));\n",[324,1350,1351,1376,1400,1424,1448,1452,1456,1475,1519,1523,1527,1546,1556,1567,1588,1622,1638],{"__ignoreMap":477},[481,1352,1353,1355,1357,1359,1361,1363,1365,1367,1370,1372,1374],{"class":483,"line":484},[481,1354,488],{"class":487},[481,1356,625],{"class":527},[481,1358,362],{"class":546},[481,1360,630],{"class":527},[481,1362,362],{"class":546},[481,1364,635],{"class":527},[481,1366,362],{"class":546},[481,1368,1369],{"class":527},"state",[481,1371,362],{"class":546},[481,1373,1301],{"class":527},[481,1375,647],{"class":546},[481,1377,1378,1380,1382,1384,1386,1388,1390,1392,1394,1396,1398],{"class":483,"line":495},[481,1379,488],{"class":487},[481,1381,625],{"class":527},[481,1383,362],{"class":546},[481,1385,630],{"class":527},[481,1387,362],{"class":546},[481,1389,635],{"class":527},[481,1391,362],{"class":546},[481,1393,640],{"class":527},[481,1395,362],{"class":546},[481,1397,346],{"class":527},[481,1399,647],{"class":546},[481,1401,1402,1404,1406,1408,1410,1412,1414,1416,1418,1420,1422],{"class":483,"line":503},[481,1403,488],{"class":487},[481,1405,625],{"class":527},[481,1407,362],{"class":546},[481,1409,630],{"class":527},[481,1411,362],{"class":546},[481,1413,635],{"class":527},[481,1415,362],{"class":546},[481,1417,640],{"class":527},[481,1419,362],{"class":546},[481,1421,398],{"class":527},[481,1423,647],{"class":546},[481,1425,1426,1428,1430,1432,1434,1436,1438,1440,1442,1444,1446],{"class":483,"line":511},[481,1427,488],{"class":487},[481,1429,625],{"class":527},[481,1431,362],{"class":546},[481,1433,630],{"class":527},[481,1435,362],{"class":546},[481,1437,635],{"class":527},[481,1439,362],{"class":546},[481,1441,640],{"class":527},[481,1443,362],{"class":546},[481,1445,1149],{"class":527},[481,1447,647],{"class":546},[481,1449,1450],{"class":483,"line":518},[481,1451,515],{"emptyLinePlaceholder":514},[481,1453,1454],{"class":483,"line":537},[481,1455,1193],{"class":603},[481,1457,1458,1460,1462,1464,1466,1468,1470,1473],{"class":483,"line":550},[481,1459,398],{"class":527},[481,1461,761],{"class":546},[481,1463,583],{"class":738},[481,1465,766],{"class":546},[481,1467,769],{"class":738},[481,1469,772],{"class":546},[481,1471,1472],{"class":775}," customers",[481,1474,779],{"class":546},[481,1476,1477,1480,1482,1484,1486,1488,1491,1493,1495,1497,1499,1501,1503,1505,1507,1509,1511,1513,1515,1517],{"class":483,"line":561},[481,1478,1479],{"class":775},"    builder",[481,1481,362],{"class":546},[481,1483,334],{"class":491},[481,1485,744],{"class":546},[481,1487,802],{"class":795},[481,1489,1490],{"class":564},"customers",[481,1492,802],{"class":795},[481,1494,766],{"class":546},[481,1496,1034],{"class":775},[481,1498,362],{"class":546},[481,1500,577],{"class":491},[481,1502,744],{"class":546},[481,1504,727],{"class":775},[481,1506,362],{"class":546},[481,1508,583],{"class":491},[481,1510,824],{"class":546},[481,1512,827],{"class":775},[481,1514,362],{"class":546},[481,1516,583],{"class":491},[481,1518,834],{"class":546},[481,1520,1521],{"class":483,"line":571},[481,1522,515],{"emptyLinePlaceholder":514},[481,1524,1525],{"class":483,"line":594},[481,1526,1239],{"class":603},[481,1528,1529,1531,1533,1535,1537,1539,1541,1544],{"class":483,"line":600},[481,1530,398],{"class":527},[481,1532,761],{"class":546},[481,1534,583],{"class":738},[481,1536,766],{"class":546},[481,1538,769],{"class":738},[481,1540,772],{"class":546},[481,1542,1543],{"class":775}," customersNamed",[481,1545,779],{"class":546},[481,1547,1548,1550,1552,1554],{"class":483,"line":607},[481,1549,1479],{"class":775},[481,1551,362],{"class":546},[481,1553,334],{"class":491},[481,1555,558],{"class":546},[481,1557,1558,1561,1563,1565],{"class":483,"line":1283},[481,1559,1560],{"class":795},"        \"",[481,1562,1490],{"class":564},[481,1564,802],{"class":795},[481,1566,568],{"class":546},[481,1568,1569,1572,1574,1577,1579,1581,1584,1586],{"class":483,"line":1312},[481,1570,1571],{"class":775},"        Consumed",[481,1573,362],{"class":546},[481,1575,1576],{"class":491},"as",[481,1578,744],{"class":546},[481,1580,802],{"class":795},[481,1582,1583],{"class":564},"customers-source",[481,1585,802],{"class":795},[481,1587,1280],{"class":546},[481,1589,1590,1593,1595,1597,1599,1601,1603,1605,1608,1610,1612,1614,1616,1618,1620],{"class":483,"line":1328},[481,1591,1592],{"class":527},"        Materialized",[481,1594,362],{"class":546},[481,1596,761],{"class":738},[481,1598,583],{"class":527},[481,1600,766],{"class":546},[481,1602,769],{"class":527},[481,1604,766],{"class":546},[481,1606,1607],{"class":527}," StateStore",[481,1609,772],{"class":738},[481,1611,1576],{"class":491},[481,1613,744],{"class":546},[481,1615,802],{"class":795},[481,1617,1490],{"class":564},[481,1619,802],{"class":795},[481,1621,1309],{"class":546},[481,1623,1624,1626,1628,1630,1632,1634,1636],{"class":483,"line":1342},[481,1625,1315],{"class":546},[481,1627,1318],{"class":491},[481,1629,744],{"class":546},[481,1631,727],{"class":775},[481,1633,362],{"class":546},[481,1635,583],{"class":491},[481,1637,1325],{"class":546},[481,1639,1641,1643,1645,1647,1649,1651,1653],{"class":483,"line":1640},17,[481,1642,1315],{"class":546},[481,1644,1333],{"class":491},[481,1646,744],{"class":546},[481,1648,727],{"class":775},[481,1650,362],{"class":546},[481,1652,583],{"class":491},[481,1654,834],{"class":546},[320,1656,1657,1659,1660,1662,1663,1665,1666,1668,1669,1671],{},[324,1658,394],{}," has the same signatures and returns a ",[324,1661,401],{},". In StoatFlow's single-instance model all state is already global (see ",[356,1664,47],{"href":48},"), so ",[324,1667,338],{}," is functionally identical to ",[324,1670,334],{}," — it exists for Kafka Streams API compatibility.",[840,1673,1675],{"id":1674},"source-topic-reuse-for-compacted-tables","Source-topic reuse for compacted tables",[320,1677,1678,1679,1682],{},"When the source topic is log-compacted, StoatFlow can restore the table's state directly from the source topic instead of creating a separate changelog topic — avoiding duplicated data. This is automatic by default (controlled globally) and can be forced per-table with ",[324,1680,1681],{},"Consumed.withMaterializeFromSourceTopic(...)",":",[471,1684,1686],{"className":473,"code":1685,"language":476,"meta":477,"style":477},"\u002F\u002F Force source-topic reuse — no separate changelog created\nbuilder.table(\"users\", Consumed.with(Serdes.String(), userSerde).withMaterializeFromSourceTopic(true))\n\n\u002F\u002F Force a dedicated changelog topic even if the source is compacted\nbuilder.table(\"events\", Consumed.with(Serdes.String(), eventSerde).withMaterializeFromSourceTopic(false))\n",[324,1687,1688,1693,1726,1730,1735],{"__ignoreMap":477},[481,1689,1690],{"class":483,"line":484},[481,1691,1692],{"class":603},"\u002F\u002F Force source-topic reuse — no separate changelog created\n",[481,1694,1695,1697,1699,1701,1704,1706,1708,1710,1712,1715,1718,1720,1723],{"class":483,"line":495},[481,1696,880],{"class":527},[481,1698,334],{"class":491},[481,1700,744],{"class":527},[481,1702,1703],{"class":564},"\"users\"",[481,1705,1217],{"class":527},[481,1707,577],{"class":491},[481,1709,580],{"class":527},[481,1711,583],{"class":491},[481,1713,1714],{"class":527},"(), userSerde).",[481,1716,1717],{"class":491},"withMaterializeFromSourceTopic",[481,1719,744],{"class":527},[481,1721,1722],{"class":487},"true",[481,1724,1725],{"class":527},"))\n",[481,1727,1728],{"class":483,"line":503},[481,1729,515],{"emptyLinePlaceholder":514},[481,1731,1732],{"class":483,"line":511},[481,1733,1734],{"class":603},"\u002F\u002F Force a dedicated changelog topic even if the source is compacted\n",[481,1736,1737,1739,1741,1743,1746,1748,1750,1752,1754,1757,1759,1761,1764],{"class":483,"line":518},[481,1738,880],{"class":527},[481,1740,334],{"class":491},[481,1742,744],{"class":527},[481,1744,1745],{"class":564},"\"events\"",[481,1747,1217],{"class":527},[481,1749,577],{"class":491},[481,1751,580],{"class":527},[481,1753,583],{"class":491},[481,1755,1756],{"class":527},"(), eventSerde).",[481,1758,1717],{"class":491},[481,1760,744],{"class":527},[481,1762,1763],{"class":487},"false",[481,1765,1725],{"class":527},[320,1767,1768,1770,1771,1773,1774,1777],{},[324,1769,1722],{}," forces source-topic restoration (no changelog, no compaction check); ",[324,1772,1763],{}," forces a dedicated changelog topic; ",[324,1775,1776],{},"null"," (the default) uses the global setting plus automatic compaction detection.",[450,1779,1781,1782],{"id":1780},"configuring-the-read-consumed","Configuring the read — ",[324,1783,346],{},[320,1785,1786,1789,1790,1793],{},[324,1787,1788],{},"Consumed\u003CK, V>"," carries everything about how a source is read. Create one with a static factory, then chain ",[324,1791,1792],{},"with*"," methods — each returns a new immutable instance.",[334,1795,1796,1809],{},[1797,1798,1799],"thead",{},[1800,1801,1802,1806],"tr",{},[1803,1804,1805],"th",{},"Factory",[1803,1807,1808],{},"Produces",[1810,1811,1812,1822,1835,1845,1855],"tbody",{},[1800,1813,1814,1819],{},[1815,1816,1817],"td",{},[324,1818,410],{},[1815,1820,1821],{},"both serdes set",[1800,1823,1824,1832],{},[1815,1825,1826,335,1829],{},[324,1827,1828],{},"Consumed.keySerde(serde)",[324,1830,1831],{},"Consumed.valueSerde(serde)",[1815,1833,1834],{},"one serde set",[1800,1836,1837,1842],{},[1815,1838,1839],{},[324,1840,1841],{},"Consumed.with(watermarkStrategy)",[1815,1843,1844],{},"watermark strategy set",[1800,1846,1847,1852],{},[1815,1848,1849],{},[324,1850,1851],{},"Consumed.as(\"name\")",[1815,1853,1854],{},"named source, default serdes",[1800,1856,1857,1862],{},[1815,1858,1859],{},[324,1860,1861],{},"Consumed.offsetResetPolicy(policy)",[1815,1863,1864],{},"offset-reset policy set",[334,1866,1867,1877],{},[1797,1868,1869],{},[1800,1870,1871,1874],{},[1803,1872,1873],{},"Builder method",[1803,1875,1876],{},"Effect",[1810,1878,1879,1892,1905,1919,1929],{},[1800,1880,1881,1889],{},[1815,1882,1883,335,1886],{},[324,1884,1885],{},".withKeySerde(serde)",[324,1887,1888],{},".withValueSerde(serde)",[1815,1890,1891],{},"override the key \u002F value deserializer",[1800,1893,1894,1899],{},[1815,1895,1896],{},[324,1897,1898],{},".withName(name)",[1815,1900,1901,1902,750],{},"give the source node a stable name (same as ",[324,1903,1904],{},"Named",[1800,1906,1907,1912],{},[1815,1908,1909],{},[324,1910,1911],{},".withOffsetResetPolicy(AutoOffsetReset.…)",[1815,1913,1914,1915,1918],{},"per-source ",[324,1916,1917],{},"auto.offset.reset"," override",[1800,1920,1921,1926],{},[1815,1922,1923],{},[324,1924,1925],{},".withWatermarkStrategy(strategy)",[1815,1927,1928],{},"per-source event-time + watermark strategy",[1800,1930,1931,1936],{},[1815,1932,1933],{},[324,1934,1935],{},".withMaterializeFromSourceTopic(bool?)",[1815,1937,1938],{},"KTable changelog reuse (tables only)",[320,1940,1941,1942,1944],{},"When a serde is not set on ",[324,1943,346],{},", the source falls back to the default key\u002Fvalue serde configured for the application.",[1104,1946,1949],{"color":1947,"icon":1948},"info","i-lucide-info",[320,1950,1951,1954,1955,1957,1958,1961,1962,1965],{},[324,1952,1953],{},"Consumed.as(...)"," and ",[324,1956,421],{}," give the source a stable name that flows into the topology graph, metrics, and state-store identity. Naming your sources (and operators) makes ",[324,1959,1960],{},"\u002Ftopology"," and your dashboards readable — see how the ",[356,1963,1964],{"href":29},"first app"," names every node.",[840,1967,1969],{"id":1968},"offset-reset-policy","Offset reset policy",[320,1971,1972,1975,1976,1978,1979,1981,1982,1985],{},[324,1973,1974],{},"AutoOffsetReset"," controls where the consumer starts when there is no committed offset for a partition. The per-source override beats the global ",[324,1977,1917],{}," config. It mirrors the KIP-1106 shape of Kafka's ",[324,1980,1974],{},": a sealed type with static factories — in Kotlin you can also reference the objects (",[324,1983,1984],{},"AutoOffsetReset.Earliest",") directly.",[334,1987,1988,1997],{},[1797,1989,1990],{},[1800,1991,1992,1994],{},[1803,1993,1805],{},[1803,1995,1996],{},"Behaviour",[1810,1998,1999,2009,2019,2029],{},[1800,2000,2001,2006],{},[1815,2002,2003],{},[324,2004,2005],{},"AutoOffsetReset.earliest()",[1815,2007,2008],{},"start from the beginning of the partition",[1800,2010,2011,2016],{},[1815,2012,2013],{},[324,2014,2015],{},"AutoOffsetReset.latest()",[1815,2017,2018],{},"start from the end — only records produced after start",[1800,2020,2021,2026],{},[1815,2022,2023],{},[324,2024,2025],{},"AutoOffsetReset.none()",[1815,2027,2028],{},"throw if no committed offset exists",[1800,2030,2031,2036],{},[1815,2032,2033],{},[324,2034,2035],{},"AutoOffsetReset.byDuration(d)",[1815,2037,2038,2039,2042],{},"start from the first offset at\u002Fafter ",[324,2040,2041],{},"now − d"," (KIP-1106)",[467,2044,2045,2150],{"group":469},[471,2046,2048],{"className":473,"code":2047,"filename":475,"language":476,"meta":477,"style":477},"import io.stoatflow.core.topology.AutoOffsetReset\n\n\u002F\u002F Historical\u002Freference data — read everything from the start\nbuilder.stream(\n    \"events\",\n    Consumed.with(Serdes.String(), eventSerde).withOffsetResetPolicy(AutoOffsetReset.Earliest),\n)\n\n\u002F\u002F Real-time commands — only new records\nbuilder.stream(\n    \"commands\",\n    Consumed.with(Serdes.String(), commandSerde).withOffsetResetPolicy(AutoOffsetReset.Latest),\n)\n",[324,2049,2050,2057,2061,2066,2074,2081,2100,2104,2108,2113,2121,2128,2146],{"__ignoreMap":477},[481,2051,2052,2054],{"class":483,"line":484},[481,2053,488],{"class":487},[481,2055,2056],{"class":491}," io.stoatflow.core.topology.AutoOffsetReset\n",[481,2058,2059],{"class":483,"line":495},[481,2060,515],{"emptyLinePlaceholder":514},[481,2062,2063],{"class":483,"line":503},[481,2064,2065],{"class":603},"\u002F\u002F Historical\u002Freference data — read everything from the start\n",[481,2067,2068,2070,2072],{"class":483,"line":511},[481,2069,880],{"class":527},[481,2071,330],{"class":491},[481,2073,558],{"class":527},[481,2075,2076,2079],{"class":483,"line":518},[481,2077,2078],{"class":564},"    \"events\"",[481,2080,568],{"class":527},[481,2082,2083,2086,2088,2090,2092,2094,2097],{"class":483,"line":537},[481,2084,2085],{"class":527},"    Consumed.",[481,2087,577],{"class":491},[481,2089,580],{"class":527},[481,2091,583],{"class":491},[481,2093,1756],{"class":527},[481,2095,2096],{"class":491},"withOffsetResetPolicy",[481,2098,2099],{"class":527},"(AutoOffsetReset.Earliest),\n",[481,2101,2102],{"class":483,"line":550},[481,2103,1309],{"class":527},[481,2105,2106],{"class":483,"line":561},[481,2107,515],{"emptyLinePlaceholder":514},[481,2109,2110],{"class":483,"line":571},[481,2111,2112],{"class":603},"\u002F\u002F Real-time commands — only new records\n",[481,2114,2115,2117,2119],{"class":483,"line":594},[481,2116,880],{"class":527},[481,2118,330],{"class":491},[481,2120,558],{"class":527},[481,2122,2123,2126],{"class":483,"line":600},[481,2124,2125],{"class":564},"    \"commands\"",[481,2127,568],{"class":527},[481,2129,2130,2132,2134,2136,2138,2141,2143],{"class":483,"line":607},[481,2131,2085],{"class":527},[481,2133,577],{"class":491},[481,2135,580],{"class":527},[481,2137,583],{"class":491},[481,2139,2140],{"class":527},"(), commandSerde).",[481,2142,2096],{"class":491},[481,2144,2145],{"class":527},"(AutoOffsetReset.Latest),\n",[481,2147,2148],{"class":483,"line":1283},[481,2149,1309],{"class":527},[471,2151,2153],{"className":613,"code":2152,"filename":615,"language":616,"meta":477,"style":477},"import io.stoatflow.core.topology.AutoOffsetReset;\n\n\u002F\u002F Historical\u002Freference data — read everything from the start\nbuilder.stream(\n    \"events\",\n    Consumed.with(Serdes.String(), eventSerde).withOffsetResetPolicy(AutoOffsetReset.earliest()));\n\n\u002F\u002F Real-time commands — only new records\nbuilder.stream(\n    \"commands\",\n    Consumed.with(Serdes.String(), commandSerde).withOffsetResetPolicy(AutoOffsetReset.latest()));\n",[324,2154,2155,2179,2183,2187,2197,2209,2247,2251,2255,2265,2276],{"__ignoreMap":477},[481,2156,2157,2159,2161,2163,2165,2167,2169,2171,2173,2175,2177],{"class":483,"line":484},[481,2158,488],{"class":487},[481,2160,625],{"class":527},[481,2162,362],{"class":546},[481,2164,630],{"class":527},[481,2166,362],{"class":546},[481,2168,635],{"class":527},[481,2170,362],{"class":546},[481,2172,640],{"class":527},[481,2174,362],{"class":546},[481,2176,1974],{"class":527},[481,2178,647],{"class":546},[481,2180,2181],{"class":483,"line":495},[481,2182,515],{"emptyLinePlaceholder":514},[481,2184,2185],{"class":483,"line":503},[481,2186,2065],{"class":603},[481,2188,2189,2191,2193,2195],{"class":483,"line":511},[481,2190,996],{"class":775},[481,2192,362],{"class":546},[481,2194,330],{"class":491},[481,2196,558],{"class":546},[481,2198,2199,2202,2205,2207],{"class":483,"line":518},[481,2200,2201],{"class":795},"    \"",[481,2203,2204],{"class":564},"events",[481,2206,802],{"class":795},[481,2208,568],{"class":546},[481,2210,2211,2214,2216,2218,2220,2222,2224,2226,2228,2231,2234,2236,2238,2240,2242,2245],{"class":483,"line":537},[481,2212,2213],{"class":775},"    Consumed",[481,2215,362],{"class":546},[481,2217,577],{"class":491},[481,2219,744],{"class":546},[481,2221,727],{"class":775},[481,2223,362],{"class":546},[481,2225,583],{"class":491},[481,2227,824],{"class":546},[481,2229,2230],{"class":527}," eventSerde",[481,2232,2233],{"class":546},").",[481,2235,2096],{"class":491},[481,2237,744],{"class":546},[481,2239,1974],{"class":775},[481,2241,362],{"class":546},[481,2243,2244],{"class":491},"earliest",[481,2246,834],{"class":546},[481,2248,2249],{"class":483,"line":550},[481,2250,515],{"emptyLinePlaceholder":514},[481,2252,2253],{"class":483,"line":561},[481,2254,2112],{"class":603},[481,2256,2257,2259,2261,2263],{"class":483,"line":571},[481,2258,996],{"class":775},[481,2260,362],{"class":546},[481,2262,330],{"class":491},[481,2264,558],{"class":546},[481,2266,2267,2269,2272,2274],{"class":483,"line":594},[481,2268,2201],{"class":795},[481,2270,2271],{"class":564},"commands",[481,2273,802],{"class":795},[481,2275,568],{"class":546},[481,2277,2278,2280,2282,2284,2286,2288,2290,2292,2294,2297,2299,2301,2303,2305,2307,2310],{"class":483,"line":600},[481,2279,2213],{"class":775},[481,2281,362],{"class":546},[481,2283,577],{"class":491},[481,2285,744],{"class":546},[481,2287,727],{"class":775},[481,2289,362],{"class":546},[481,2291,583],{"class":491},[481,2293,824],{"class":546},[481,2295,2296],{"class":527}," commandSerde",[481,2298,2233],{"class":546},[481,2300,2096],{"class":491},[481,2302,744],{"class":546},[481,2304,1974],{"class":775},[481,2306,362],{"class":546},[481,2308,2309],{"class":491},"latest",[481,2311,834],{"class":546},[320,2313,2314],{},"All sources reading the same topic must agree on the offset-reset policy; conflicting policies are rejected when the topology is built.",[840,2316,2318],{"id":2317},"timestamp-extraction-and-watermarks","Timestamp extraction and watermarks",[320,2320,2321,2322,2325,2326,2329,2330,2333,2334,2337],{},"Event time and watermarks are configured ",[373,2323,2324],{},"per source"," through a ",[324,2327,2328],{},"WatermarkStrategy",", set with ",[324,2331,2332],{},"Consumed.withWatermarkStrategy(...)",". The strategy does two jobs: it extracts the event timestamp from each record (via ",[324,2335,2336],{},"withTimestampAssigner","), and it generates watermarks. With no strategy set, the source uses the application's global watermark strategy.",[467,2339,2340,2500],{"group":469},[471,2341,2343],{"className":473,"code":2342,"filename":475,"language":476,"meta":477,"style":477},"import io.stoatflow.core.watermark.WatermarkStrategy\nimport java.time.Duration\n\nval strategy =\n    WatermarkStrategy\n        .forBoundedOutOfOrderness\u003CString, Order>(Duration.ofSeconds(30))\n        .withTimestampAssigner { _, value, _ -> value?.eventTime ?: 0L }\n        .withIdleness(Duration.ofMinutes(2))\n\nbuilder.stream(\n    \"orders\",\n    Consumed.with(Serdes.String(), orderSerde).withWatermarkStrategy(strategy),\n)\n",[324,2344,2345,2352,2359,2363,2372,2377,2408,2438,2458,2462,2470,2477,2496],{"__ignoreMap":477},[481,2346,2347,2349],{"class":483,"line":484},[481,2348,488],{"class":487},[481,2350,2351],{"class":491}," io.stoatflow.core.watermark.WatermarkStrategy\n",[481,2353,2354,2356],{"class":483,"line":495},[481,2355,488],{"class":487},[481,2357,2358],{"class":491}," java.time.Duration\n",[481,2360,2361],{"class":483,"line":503},[481,2362,515],{"emptyLinePlaceholder":514},[481,2364,2365,2367,2370],{"class":483,"line":511},[481,2366,1198],{"class":487},[481,2368,2369],{"class":527}," strategy ",[481,2371,547],{"class":546},[481,2373,2374],{"class":483,"line":518},[481,2375,2376],{"class":527},"    WatermarkStrategy\n",[481,2378,2379,2382,2385,2387,2389,2391,2394,2397,2400,2402,2406],{"class":483,"line":537},[481,2380,2381],{"class":527},"        .",[481,2383,2384],{"class":491},"forBoundedOutOfOrderness",[481,2386,761],{"class":527},[481,2388,583],{"class":531},[481,2390,415],{"class":527},[481,2392,2393],{"class":531},"Order",[481,2395,2396],{"class":527},">(Duration.",[481,2398,2399],{"class":491},"ofSeconds",[481,2401,744],{"class":527},[481,2403,2405],{"class":2404},"s-TwI","30",[481,2407,1725],{"class":527},[481,2409,2410,2412,2414,2417,2420,2423,2426,2429,2432,2435],{"class":483,"line":550},[481,2411,2381],{"class":527},[481,2413,2336],{"class":491},[481,2415,2416],{"class":527}," { _, ",[481,2418,2419],{"class":738},"value",[481,2421,2422],{"class":527},", _ ",[481,2424,2425],{"class":546},"->",[481,2427,2428],{"class":738}," value",[481,2430,2431],{"class":527},"?.eventTime ?: ",[481,2433,2434],{"class":2404},"0L",[481,2436,2437],{"class":527}," }\n",[481,2439,2440,2442,2445,2448,2451,2453,2456],{"class":483,"line":561},[481,2441,2381],{"class":527},[481,2443,2444],{"class":491},"withIdleness",[481,2446,2447],{"class":527},"(Duration.",[481,2449,2450],{"class":491},"ofMinutes",[481,2452,744],{"class":527},[481,2454,2455],{"class":2404},"2",[481,2457,1725],{"class":527},[481,2459,2460],{"class":483,"line":571},[481,2461,515],{"emptyLinePlaceholder":514},[481,2463,2464,2466,2468],{"class":483,"line":594},[481,2465,880],{"class":527},[481,2467,330],{"class":491},[481,2469,558],{"class":527},[481,2471,2472,2475],{"class":483,"line":600},[481,2473,2474],{"class":564},"    \"orders\"",[481,2476,568],{"class":527},[481,2478,2479,2481,2483,2485,2487,2490,2493],{"class":483,"line":607},[481,2480,2085],{"class":527},[481,2482,577],{"class":491},[481,2484,580],{"class":527},[481,2486,583],{"class":491},[481,2488,2489],{"class":527},"(), orderSerde).",[481,2491,2492],{"class":491},"withWatermarkStrategy",[481,2494,2495],{"class":527},"(strategy),\n",[481,2497,2498],{"class":483,"line":1283},[481,2499,1309],{"class":527},[471,2501,2503],{"className":613,"code":2502,"filename":615,"language":616,"meta":477,"style":477},"import io.stoatflow.core.watermark.WatermarkStrategy;\nimport java.time.Duration;\n\nWatermarkStrategy\u003CString, Order> strategy =\n    WatermarkStrategy\n        .\u003CString, Order>forBoundedOutOfOrderness(Duration.ofSeconds(30))\n        .withTimestampAssigner((key, value) -> value != null ? value.eventTime() : 0L)\n        .withIdleness(Duration.ofMinutes(2));\n\nbuilder.stream(\n    \"orders\",\n    Consumed.with(Serdes.String(), orderSerde).withWatermarkStrategy(strategy));\n",[324,2504,2505,2530,2548,2552,2572,2576,2606,2657,2677,2681,2691,2701],{"__ignoreMap":477},[481,2506,2507,2509,2511,2513,2515,2517,2519,2521,2524,2526,2528],{"class":483,"line":484},[481,2508,488],{"class":487},[481,2510,625],{"class":527},[481,2512,362],{"class":546},[481,2514,630],{"class":527},[481,2516,362],{"class":546},[481,2518,635],{"class":527},[481,2520,362],{"class":546},[481,2522,2523],{"class":527},"watermark",[481,2525,362],{"class":546},[481,2527,2328],{"class":527},[481,2529,647],{"class":546},[481,2531,2532,2534,2536,2538,2541,2543,2546],{"class":483,"line":495},[481,2533,488],{"class":487},[481,2535,949],{"class":527},[481,2537,362],{"class":546},[481,2539,2540],{"class":527},"time",[481,2542,362],{"class":546},[481,2544,2545],{"class":527},"Duration",[481,2547,647],{"class":546},[481,2549,2550],{"class":483,"line":503},[481,2551,515],{"emptyLinePlaceholder":514},[481,2553,2554,2556,2558,2560,2562,2565,2567,2570],{"class":483,"line":511},[481,2555,2328],{"class":527},[481,2557,761],{"class":546},[481,2559,583],{"class":738},[481,2561,766],{"class":546},[481,2563,2564],{"class":738}," Order",[481,2566,772],{"class":546},[481,2568,2569],{"class":775}," strategy",[481,2571,779],{"class":546},[481,2573,2574],{"class":483,"line":518},[481,2575,2376],{"class":527},[481,2577,2578,2580,2582,2584,2586,2588,2590,2592,2594,2596,2598,2600,2602,2604],{"class":483,"line":537},[481,2579,2381],{"class":546},[481,2581,761],{"class":738},[481,2583,583],{"class":527},[481,2585,766],{"class":546},[481,2587,2564],{"class":527},[481,2589,772],{"class":738},[481,2591,2384],{"class":491},[481,2593,744],{"class":546},[481,2595,2545],{"class":775},[481,2597,362],{"class":546},[481,2599,2399],{"class":491},[481,2601,744],{"class":546},[481,2603,2405],{"class":2404},[481,2605,1725],{"class":546},[481,2607,2608,2610,2612,2615,2618,2620,2622,2624,2627,2630,2633,2636,2639,2641,2643,2646,2649,2652,2655],{"class":483,"line":550},[481,2609,2381],{"class":546},[481,2611,2336],{"class":491},[481,2613,2614],{"class":546},"((",[481,2616,2617],{"class":527},"key",[481,2619,766],{"class":546},[481,2621,2428],{"class":527},[481,2623,750],{"class":546},[481,2625,2626],{"class":546}," ->",[481,2628,2629],{"class":527}," value ",[481,2631,2632],{"class":738},"!=",[481,2634,2635],{"class":487}," null",[481,2637,2638],{"class":487}," ?",[481,2640,2428],{"class":775},[481,2642,362],{"class":546},[481,2644,2645],{"class":491},"eventTime",[481,2647,2648],{"class":546},"()",[481,2650,2651],{"class":487}," :",[481,2653,2654],{"class":2404}," 0L",[481,2656,1309],{"class":546},[481,2658,2659,2661,2663,2665,2667,2669,2671,2673,2675],{"class":483,"line":561},[481,2660,2381],{"class":546},[481,2662,2444],{"class":491},[481,2664,744],{"class":546},[481,2666,2545],{"class":775},[481,2668,362],{"class":546},[481,2670,2450],{"class":491},[481,2672,744],{"class":546},[481,2674,2455],{"class":2404},[481,2676,1051],{"class":546},[481,2678,2679],{"class":483,"line":571},[481,2680,515],{"emptyLinePlaceholder":514},[481,2682,2683,2685,2687,2689],{"class":483,"line":594},[481,2684,996],{"class":775},[481,2686,362],{"class":546},[481,2688,330],{"class":491},[481,2690,558],{"class":546},[481,2692,2693,2695,2697,2699],{"class":483,"line":600},[481,2694,2201],{"class":795},[481,2696,799],{"class":564},[481,2698,802],{"class":795},[481,2700,568],{"class":546},[481,2702,2703,2705,2707,2709,2711,2713,2715,2717,2719,2722,2724,2726,2728,2731],{"class":483,"line":607},[481,2704,2213],{"class":775},[481,2706,362],{"class":546},[481,2708,577],{"class":491},[481,2710,744],{"class":546},[481,2712,727],{"class":775},[481,2714,362],{"class":546},[481,2716,583],{"class":491},[481,2718,824],{"class":546},[481,2720,2721],{"class":527}," orderSerde",[481,2723,2233],{"class":546},[481,2725,2492],{"class":491},[481,2727,744],{"class":546},[481,2729,2730],{"class":527},"strategy",[481,2732,1051],{"class":546},[320,2734,2735,2736,415,2739,2742,2743,2746,2747,2749,2750,2753,2754,2757,2758,362],{},"The factory methods are ",[324,2737,2738],{},"WatermarkStrategy.forBoundedOutOfOrderness(maxOutOfOrderness)",[324,2740,2741],{},"WatermarkStrategy.forMonotonousTimestamps()",", and ",[324,2744,2745],{},"WatermarkStrategy.noWatermarks()",". In Java, ",[324,2748,2336],{}," also accepts a value-only ",[324,2751,2752],{},"Function\u003CV, Long>"," or a key-and-value ",[324,2755,2756],{},"BiFunction\u003CK, V, Long>",", as shown above. For the full event-time model — watermarks, idleness, late-record handling — see ",[356,2759,67],{"href":68},[450,2761,2763,2764,1954,2767],{"id":2762},"writing-a-sink-to-and-produced","Writing a sink — ",[324,2765,2766],{},"to()",[324,2768,350],{},[320,2770,2771,2774,2775,2778],{},[324,2772,2773],{},"KStream.to(topic, produced)"," writes the stream to a Kafka topic. It's a terminal operation — it returns nothing. ",[324,2776,2777],{},"Produced\u003CK, V>"," configures the write side; when a serde is omitted, the sink falls back to the default serde.",[467,2780,2781,2909],{"group":469},[471,2782,2784],{"className":473,"code":2783,"filename":475,"language":476,"meta":477,"style":477},"import io.stoatflow.core.topology.Produced\n\nstream.to(\n    \"output\",\n    Produced.with(Serdes.String(), Serdes.Long()),\n)\n\n\u002F\u002F Named sink with serdes — readable in the topology graph\nstream.to(\n    \"word-counts\",\n    Produced.`as`\u003CString, Long>(\"sink\")\n        .withKeySerde(Serdes.String())\n        .withValueSerde(Serdes.Long()),\n)\n",[324,2785,2786,2793,2797,2807,2814,2832,2836,2840,2845,2853,2860,2881,2893,2905],{"__ignoreMap":477},[481,2787,2788,2790],{"class":483,"line":484},[481,2789,488],{"class":487},[481,2791,2792],{"class":491}," io.stoatflow.core.topology.Produced\n",[481,2794,2795],{"class":483,"line":495},[481,2796,515],{"emptyLinePlaceholder":514},[481,2798,2799,2802,2805],{"class":483,"line":503},[481,2800,2801],{"class":527},"stream.",[481,2803,2804],{"class":491},"to",[481,2806,558],{"class":527},[481,2808,2809,2812],{"class":483,"line":511},[481,2810,2811],{"class":564},"    \"output\"",[481,2813,568],{"class":527},[481,2815,2816,2819,2821,2823,2825,2827,2830],{"class":483,"line":518},[481,2817,2818],{"class":527},"    Produced.",[481,2820,577],{"class":491},[481,2822,580],{"class":527},[481,2824,583],{"class":491},[481,2826,586],{"class":527},[481,2828,2829],{"class":491},"Long",[481,2831,591],{"class":527},[481,2833,2834],{"class":483,"line":537},[481,2835,1309],{"class":527},[481,2837,2838],{"class":483,"line":550},[481,2839,515],{"emptyLinePlaceholder":514},[481,2841,2842],{"class":483,"line":561},[481,2843,2844],{"class":603},"\u002F\u002F Named sink with serdes — readable in the topology graph\n",[481,2846,2847,2849,2851],{"class":483,"line":571},[481,2848,2801],{"class":527},[481,2850,2804],{"class":491},[481,2852,558],{"class":527},[481,2854,2855,2858],{"class":483,"line":594},[481,2856,2857],{"class":564},"    \"word-counts\"",[481,2859,568],{"class":527},[481,2861,2862,2864,2866,2868,2870,2872,2874,2876,2879],{"class":483,"line":600},[481,2863,2818],{"class":527},[481,2865,1272],{"class":491},[481,2867,761],{"class":527},[481,2869,583],{"class":531},[481,2871,415],{"class":527},[481,2873,2829],{"class":531},[481,2875,1304],{"class":527},[481,2877,2878],{"class":564},"\"sink\"",[481,2880,1309],{"class":527},[481,2882,2883,2885,2887,2889,2891],{"class":483,"line":607},[481,2884,2381],{"class":527},[481,2886,1318],{"class":491},[481,2888,580],{"class":527},[481,2890,583],{"class":491},[481,2892,1325],{"class":527},[481,2894,2895,2897,2899,2901,2903],{"class":483,"line":1283},[481,2896,2381],{"class":527},[481,2898,1333],{"class":491},[481,2900,580],{"class":527},[481,2902,2829],{"class":491},[481,2904,591],{"class":527},[481,2906,2907],{"class":483,"line":1312},[481,2908,1309],{"class":527},[471,2910,2912],{"className":613,"code":2911,"filename":615,"language":616,"meta":477,"style":477},"import io.stoatflow.core.topology.Produced;\n\nstream.to(\n    \"output\",\n    Produced.with(Serdes.String(), Serdes.Long()));\n\n\u002F\u002F Named sink with serdes — readable in the topology graph\nstream.to(\n    \"word-counts\",\n    Produced.\u003CString, Long>as(\"sink\")\n        .withKeySerde(Serdes.String())\n        .withValueSerde(Serdes.Long()));\n",[324,2913,2914,2938,2942,2952,2963,2990,2994,2998,3008,3019,3049,3065],{"__ignoreMap":477},[481,2915,2916,2918,2920,2922,2924,2926,2928,2930,2932,2934,2936],{"class":483,"line":484},[481,2917,488],{"class":487},[481,2919,625],{"class":527},[481,2921,362],{"class":546},[481,2923,630],{"class":527},[481,2925,362],{"class":546},[481,2927,635],{"class":527},[481,2929,362],{"class":546},[481,2931,640],{"class":527},[481,2933,362],{"class":546},[481,2935,350],{"class":527},[481,2937,647],{"class":546},[481,2939,2940],{"class":483,"line":495},[481,2941,515],{"emptyLinePlaceholder":514},[481,2943,2944,2946,2948,2950],{"class":483,"line":503},[481,2945,330],{"class":775},[481,2947,362],{"class":546},[481,2949,2804],{"class":491},[481,2951,558],{"class":546},[481,2953,2954,2956,2959,2961],{"class":483,"line":511},[481,2955,2201],{"class":795},[481,2957,2958],{"class":564},"output",[481,2960,802],{"class":795},[481,2962,568],{"class":546},[481,2964,2965,2968,2970,2972,2974,2976,2978,2980,2982,2984,2986,2988],{"class":483,"line":518},[481,2966,2967],{"class":775},"    Produced",[481,2969,362],{"class":546},[481,2971,577],{"class":491},[481,2973,744],{"class":546},[481,2975,727],{"class":775},[481,2977,362],{"class":546},[481,2979,583],{"class":491},[481,2981,824],{"class":546},[481,2983,827],{"class":775},[481,2985,362],{"class":546},[481,2987,2829],{"class":491},[481,2989,834],{"class":546},[481,2991,2992],{"class":483,"line":537},[481,2993,515],{"emptyLinePlaceholder":514},[481,2995,2996],{"class":483,"line":550},[481,2997,2844],{"class":603},[481,2999,3000,3002,3004,3006],{"class":483,"line":561},[481,3001,330],{"class":775},[481,3003,362],{"class":546},[481,3005,2804],{"class":491},[481,3007,558],{"class":546},[481,3009,3010,3012,3015,3017],{"class":483,"line":571},[481,3011,2201],{"class":795},[481,3013,3014],{"class":564},"word-counts",[481,3016,802],{"class":795},[481,3018,568],{"class":546},[481,3020,3021,3023,3025,3027,3029,3031,3034,3036,3038,3040,3042,3045,3047],{"class":483,"line":594},[481,3022,2967],{"class":527},[481,3024,362],{"class":546},[481,3026,761],{"class":738},[481,3028,583],{"class":527},[481,3030,766],{"class":546},[481,3032,3033],{"class":527}," Long",[481,3035,772],{"class":738},[481,3037,1576],{"class":491},[481,3039,744],{"class":546},[481,3041,802],{"class":795},[481,3043,3044],{"class":564},"sink",[481,3046,802],{"class":795},[481,3048,1309],{"class":546},[481,3050,3051,3053,3055,3057,3059,3061,3063],{"class":483,"line":600},[481,3052,2381],{"class":546},[481,3054,1318],{"class":491},[481,3056,744],{"class":546},[481,3058,727],{"class":775},[481,3060,362],{"class":546},[481,3062,583],{"class":491},[481,3064,1325],{"class":546},[481,3066,3067,3069,3071,3073,3075,3077,3079],{"class":483,"line":607},[481,3068,2381],{"class":546},[481,3070,1333],{"class":491},[481,3072,744],{"class":546},[481,3074,727],{"class":775},[481,3076,362],{"class":546},[481,3078,2829],{"class":491},[481,3080,834],{"class":546},[320,3082,3083,3085,3086,3088,3089,415,3092,415,3095,415,3098,2742,3101,3104,3105,415,3108,415,3111,2742,3114,362],{},[324,3084,350],{}," factories mirror ",[324,3087,346],{},": ",[324,3090,3091],{},"Produced.with(keySerde, valueSerde)",[324,3093,3094],{},"Produced.keySerde(serde)",[324,3096,3097],{},"Produced.valueSerde(serde)",[324,3099,3100],{},"Produced.streamPartitioner(partitioner)",[324,3102,3103],{},"Produced.as(\"name\")",". The chainable builders are ",[324,3106,3107],{},".withKeySerde",[324,3109,3110],{},".withValueSerde",[324,3112,3113],{},".withStreamPartitioner",[324,3115,3116],{},".withName",[840,3118,3120],{"id":3119},"custom-partitioning","Custom partitioning",[320,3122,3123,3124,3127,3128,3131,3132,3135],{},"By default the producer partitions by key. Supply a ",[324,3125,3126],{},"StreamPartitioner\u003CK, V>"," to control the target partition yourself — it receives the topic, key, value, and partition count, and returns an ",[324,3129,3130],{},"Optional\u003CSet\u003CInteger>>"," of 0-indexed partitions (KIP-837): ",[324,3133,3134],{},"Optional.empty()"," falls back to the default partitioner, a single-element set routes to that partition, an empty set drops the record, and multiple elements multicast (sink path only).",[467,3137,3138,3249],{"group":469},[471,3139,3141],{"className":473,"code":3140,"filename":475,"language":476,"meta":477,"style":477},"import io.stoatflow.core.topology.StreamPartitioner\nimport java.util.Optional\n\nstream.to(\n    \"output\",\n    Produced.with(Serdes.String(), valueSerde)\n        .withStreamPartitioner(\n            StreamPartitioner { _, key, _, numPartitions ->\n                Optional.of(setOf(Math.floorMod(key.hashCode(), numPartitions)))\n            },\n        ),\n)\n",[324,3142,3143,3150,3157,3161,3169,3175,3188,3197,3208,3235,3240,3245],{"__ignoreMap":477},[481,3144,3145,3147],{"class":483,"line":484},[481,3146,488],{"class":487},[481,3148,3149],{"class":491}," io.stoatflow.core.topology.StreamPartitioner\n",[481,3151,3152,3154],{"class":483,"line":495},[481,3153,488],{"class":487},[481,3155,3156],{"class":491}," java.util.Optional\n",[481,3158,3159],{"class":483,"line":503},[481,3160,515],{"emptyLinePlaceholder":514},[481,3162,3163,3165,3167],{"class":483,"line":511},[481,3164,2801],{"class":527},[481,3166,2804],{"class":491},[481,3168,558],{"class":527},[481,3170,3171,3173],{"class":483,"line":518},[481,3172,2811],{"class":564},[481,3174,568],{"class":527},[481,3176,3177,3179,3181,3183,3185],{"class":483,"line":537},[481,3178,2818],{"class":527},[481,3180,577],{"class":491},[481,3182,580],{"class":527},[481,3184,583],{"class":491},[481,3186,3187],{"class":527},"(), valueSerde)\n",[481,3189,3190,3192,3195],{"class":483,"line":550},[481,3191,2381],{"class":527},[481,3193,3194],{"class":491},"withStreamPartitioner",[481,3196,558],{"class":527},[481,3198,3199,3202,3205],{"class":483,"line":561},[481,3200,3201],{"class":491},"            StreamPartitioner",[481,3203,3204],{"class":527}," { _, key, _, numPartitions ",[481,3206,3207],{"class":546},"->\n",[481,3209,3210,3213,3215,3217,3220,3223,3226,3229,3232],{"class":483,"line":571},[481,3211,3212],{"class":527},"                Optional.",[481,3214,1009],{"class":491},[481,3216,744],{"class":527},[481,3218,3219],{"class":491},"setOf",[481,3221,3222],{"class":527},"(Math.",[481,3224,3225],{"class":491},"floorMod",[481,3227,3228],{"class":527},"(key.",[481,3230,3231],{"class":491},"hashCode",[481,3233,3234],{"class":527},"(), numPartitions)))\n",[481,3236,3237],{"class":483,"line":594},[481,3238,3239],{"class":527},"            },\n",[481,3241,3242],{"class":483,"line":600},[481,3243,3244],{"class":527},"        ),\n",[481,3246,3247],{"class":483,"line":607},[481,3248,1309],{"class":527},[471,3250,3252],{"className":613,"code":3251,"filename":615,"language":616,"meta":477,"style":477},"import io.stoatflow.core.topology.StreamPartitioner;\nimport java.util.Optional;\nimport java.util.Set;\n\nstream.to(\n    \"output\",\n    Produced.with(Serdes.String(), valueSerde)\n        .withStreamPartitioner(\n            (StreamPartitioner\u003CString, Value>) (topic, key, value, numPartitions) ->\n                Optional.of(Set.of(Math.floorMod(key.hashCode(), numPartitions)))));\n",[324,3253,3254,3279,3296,3313,3317,3327,3337,3359,3367,3412],{"__ignoreMap":477},[481,3255,3256,3258,3260,3262,3264,3266,3268,3270,3272,3274,3277],{"class":483,"line":484},[481,3257,488],{"class":487},[481,3259,625],{"class":527},[481,3261,362],{"class":546},[481,3263,630],{"class":527},[481,3265,362],{"class":546},[481,3267,635],{"class":527},[481,3269,362],{"class":546},[481,3271,640],{"class":527},[481,3273,362],{"class":546},[481,3275,3276],{"class":527},"StreamPartitioner",[481,3278,647],{"class":546},[481,3280,3281,3283,3285,3287,3289,3291,3294],{"class":483,"line":495},[481,3282,488],{"class":487},[481,3284,949],{"class":527},[481,3286,362],{"class":546},[481,3288,954],{"class":527},[481,3290,362],{"class":546},[481,3292,3293],{"class":527},"Optional",[481,3295,647],{"class":546},[481,3297,3298,3300,3302,3304,3306,3308,3311],{"class":483,"line":503},[481,3299,488],{"class":487},[481,3301,949],{"class":527},[481,3303,362],{"class":546},[481,3305,954],{"class":527},[481,3307,362],{"class":546},[481,3309,3310],{"class":527},"Set",[481,3312,647],{"class":546},[481,3314,3315],{"class":483,"line":511},[481,3316,515],{"emptyLinePlaceholder":514},[481,3318,3319,3321,3323,3325],{"class":483,"line":518},[481,3320,330],{"class":775},[481,3322,362],{"class":546},[481,3324,2804],{"class":491},[481,3326,558],{"class":546},[481,3328,3329,3331,3333,3335],{"class":483,"line":537},[481,3330,2201],{"class":795},[481,3332,2958],{"class":564},[481,3334,802],{"class":795},[481,3336,568],{"class":546},[481,3338,3339,3341,3343,3345,3347,3349,3351,3353,3355,3357],{"class":483,"line":550},[481,3340,2967],{"class":775},[481,3342,362],{"class":546},[481,3344,577],{"class":491},[481,3346,744],{"class":546},[481,3348,727],{"class":775},[481,3350,362],{"class":546},[481,3352,583],{"class":491},[481,3354,824],{"class":546},[481,3356,1048],{"class":527},[481,3358,1309],{"class":546},[481,3360,3361,3363,3365],{"class":483,"line":561},[481,3362,2381],{"class":546},[481,3364,3194],{"class":491},[481,3366,558],{"class":546},[481,3368,3369,3372,3374,3376,3378,3380,3383,3385,3387,3390,3393,3395,3398,3400,3402,3404,3407,3409],{"class":483,"line":571},[481,3370,3371],{"class":546},"            (",[481,3373,3276],{"class":527},[481,3375,761],{"class":738},[481,3377,583],{"class":527},[481,3379,766],{"class":546},[481,3381,3382],{"class":527}," Value",[481,3384,772],{"class":738},[481,3386,750],{"class":546},[481,3388,3389],{"class":546}," (",[481,3391,3392],{"class":527},"topic",[481,3394,766],{"class":546},[481,3396,3397],{"class":527}," key",[481,3399,766],{"class":546},[481,3401,2428],{"class":527},[481,3403,766],{"class":546},[481,3405,3406],{"class":527}," numPartitions",[481,3408,750],{"class":546},[481,3410,3411],{"class":546}," ->\n",[481,3413,3414,3417,3419,3421,3423,3425,3427,3429,3431,3434,3436,3438,3440,3442,3444,3446,3448,3450],{"class":483,"line":594},[481,3415,3416],{"class":775},"                Optional",[481,3418,362],{"class":546},[481,3420,1009],{"class":491},[481,3422,744],{"class":546},[481,3424,3310],{"class":775},[481,3426,362],{"class":546},[481,3428,1009],{"class":491},[481,3430,744],{"class":546},[481,3432,3433],{"class":775},"Math",[481,3435,362],{"class":546},[481,3437,3225],{"class":491},[481,3439,744],{"class":546},[481,3441,2617],{"class":775},[481,3443,362],{"class":546},[481,3445,3231],{"class":491},[481,3447,824],{"class":546},[481,3449,3406],{"class":527},[481,3451,3452],{"class":546},")))));\n",[840,3454,3456],{"id":3455},"dynamic-topic-routing","Dynamic topic routing",[320,3458,3459,3460,3463,3464,3467],{},"To pick the destination topic per record, pass a ",[324,3461,3462],{},"TopicNameExtractor\u003CK, V>"," instead of a topic name. The extractor receives the key, value, and a ",[324,3465,3466],{},"RecordContext"," (source topic, partition, offset, timestamp, headers) and returns the topic name.",[467,3469,3470,3543],{"group":469},[471,3471,3473],{"className":473,"code":3472,"filename":475,"language":476,"meta":477,"style":477},"import io.stoatflow.core.topology.TopicNameExtractor\n\nstream.to(\n    TopicNameExtractor { _, value, _ -> \"orders-${value.region}\" },\n    Produced.with(Serdes.String(), orderSerde),\n)\n",[324,3474,3475,3482,3486,3494,3526,3539],{"__ignoreMap":477},[481,3476,3477,3479],{"class":483,"line":484},[481,3478,488],{"class":487},[481,3480,3481],{"class":491}," io.stoatflow.core.topology.TopicNameExtractor\n",[481,3483,3484],{"class":483,"line":495},[481,3485,515],{"emptyLinePlaceholder":514},[481,3487,3488,3490,3492],{"class":483,"line":503},[481,3489,2801],{"class":527},[481,3491,2804],{"class":491},[481,3493,558],{"class":527},[481,3495,3496,3499,3501,3503,3505,3507,3510,3513,3515,3518,3521,3523],{"class":483,"line":511},[481,3497,3498],{"class":491},"    TopicNameExtractor",[481,3500,2416],{"class":527},[481,3502,2419],{"class":738},[481,3504,2422],{"class":527},[481,3506,2425],{"class":546},[481,3508,3509],{"class":564}," \"orders-",[481,3511,3512],{"class":487},"${",[481,3514,2419],{"class":738},[481,3516,3517],{"class":564},".region",[481,3519,3520],{"class":487},"}",[481,3522,802],{"class":564},[481,3524,3525],{"class":527}," },\n",[481,3527,3528,3530,3532,3534,3536],{"class":483,"line":518},[481,3529,2818],{"class":527},[481,3531,577],{"class":491},[481,3533,580],{"class":527},[481,3535,583],{"class":491},[481,3537,3538],{"class":527},"(), orderSerde),\n",[481,3540,3541],{"class":483,"line":537},[481,3542,1309],{"class":527},[471,3544,3546],{"className":613,"code":3545,"filename":615,"language":616,"meta":477,"style":477},"import io.stoatflow.core.topology.TopicNameExtractor;\n\nstream.to(\n    (TopicNameExtractor\u003CString, Order>) (key, value, ctx) -> \"orders-\" + value.region(),\n    Produced.with(Serdes.String(), orderSerde));\n",[324,3547,3548,3573,3577,3587,3643],{"__ignoreMap":477},[481,3549,3550,3552,3554,3556,3558,3560,3562,3564,3566,3568,3571],{"class":483,"line":484},[481,3551,488],{"class":487},[481,3553,625],{"class":527},[481,3555,362],{"class":546},[481,3557,630],{"class":527},[481,3559,362],{"class":546},[481,3561,635],{"class":527},[481,3563,362],{"class":546},[481,3565,640],{"class":527},[481,3567,362],{"class":546},[481,3569,3570],{"class":527},"TopicNameExtractor",[481,3572,647],{"class":546},[481,3574,3575],{"class":483,"line":495},[481,3576,515],{"emptyLinePlaceholder":514},[481,3578,3579,3581,3583,3585],{"class":483,"line":503},[481,3580,330],{"class":775},[481,3582,362],{"class":546},[481,3584,2804],{"class":491},[481,3586,558],{"class":546},[481,3588,3589,3592,3594,3596,3598,3600,3602,3604,3606,3608,3610,3612,3614,3616,3619,3621,3623,3625,3628,3630,3633,3635,3637,3640],{"class":483,"line":511},[481,3590,3591],{"class":546},"    (",[481,3593,3570],{"class":527},[481,3595,761],{"class":738},[481,3597,583],{"class":527},[481,3599,766],{"class":546},[481,3601,2564],{"class":527},[481,3603,772],{"class":738},[481,3605,750],{"class":546},[481,3607,3389],{"class":546},[481,3609,2617],{"class":527},[481,3611,766],{"class":546},[481,3613,2428],{"class":527},[481,3615,766],{"class":546},[481,3617,3618],{"class":527}," ctx",[481,3620,750],{"class":546},[481,3622,2626],{"class":546},[481,3624,1023],{"class":795},[481,3626,3627],{"class":564},"orders-",[481,3629,802],{"class":795},[481,3631,3632],{"class":738}," +",[481,3634,2428],{"class":775},[481,3636,362],{"class":546},[481,3638,3639],{"class":491},"region",[481,3641,3642],{"class":546},"(),\n",[481,3644,3645,3647,3649,3651,3653,3655,3657,3659,3661,3663],{"class":483,"line":518},[481,3646,2967],{"class":775},[481,3648,362],{"class":546},[481,3650,577],{"class":491},[481,3652,744],{"class":546},[481,3654,727],{"class":775},[481,3656,362],{"class":546},[481,3658,583],{"class":491},[481,3660,824],{"class":546},[481,3662,2721],{"class":527},[481,3664,1051],{"class":546},[1104,3666,3667],{"color":1947,"icon":1948},[320,3668,3669,3670,3672,3673,3675,3676,2742,3678,335,3681,3684,3685,3389,3688,335,3691,3694,3695,3698],{},"For records that originate inside the topology (for example, results emitted as a window closes), the ",[324,3671,3466],{}," source fields may be unknown: ",[324,3674,3392],{}," is ",[324,3677,1776],{},[324,3679,3680],{},"partition",[324,3682,3683],{},"offset"," are ",[324,3686,3687],{},"-1",[324,3689,3690],{},"RecordContext.UNKNOWN_PARTITION",[324,3692,3693],{},"UNKNOWN_OFFSET","). The ",[324,3696,3697],{},"timestamp"," is always available. Handle those cases when your routing depends on source metadata. Dynamic-sink topics are not part of the topology's static sink-topic set.",[450,3700,1123],{"id":3701},"the-fan-out-rule",[320,3703,3704,3705,3711,3712,3714],{},"To process one source two (or more) ways, ",[373,3706,3707,3708,3710],{},"reuse the ",[324,3709,443],{}," reference"," — do not call ",[324,3713,447],{}," twice on the same topic. A topic may only back one source node; a second subscription is rejected when the topology is built.",[467,3716,3717,3823],{"group":469},[471,3718,3720],{"className":473,"code":3719,"filename":475,"language":476,"meta":477,"style":477},"val orders = builder.stream(\"orders\", Consumed.with(Serdes.String(), orderSerde))\n\n\u002F\u002F Branch 1\norders.filter { _, v -> v.isHighValue }.to(\"high-value-orders\")\n\n\u002F\u002F Branch 2 — same reference, no second subscription\norders.mapValues { v -> v.summary() }.to(\"order-summaries\")\n",[324,3721,3722,3750,3754,3759,3784,3788,3793],{"__ignoreMap":477},[481,3723,3724,3726,3728,3730,3732,3734,3736,3739,3741,3743,3745,3747],{"class":483,"line":484},[481,3725,1198],{"class":487},[481,3727,543],{"class":527},[481,3729,1204],{"class":546},[481,3731,1207],{"class":527},[481,3733,330],{"class":491},[481,3735,744],{"class":527},[481,3737,3738],{"class":564},"\"orders\"",[481,3740,1217],{"class":527},[481,3742,577],{"class":491},[481,3744,580],{"class":527},[481,3746,583],{"class":491},[481,3748,3749],{"class":527},"(), orderSerde))\n",[481,3751,3752],{"class":483,"line":495},[481,3753,515],{"emptyLinePlaceholder":514},[481,3755,3756],{"class":483,"line":503},[481,3757,3758],{"class":603},"\u002F\u002F Branch 1\n",[481,3760,3761,3764,3767,3770,3772,3775,3777,3779,3782],{"class":483,"line":511},[481,3762,3763],{"class":527},"orders.",[481,3765,3766],{"class":491},"filter",[481,3768,3769],{"class":527}," { _, v ",[481,3771,2425],{"class":546},[481,3773,3774],{"class":527}," v.isHighValue }.",[481,3776,2804],{"class":491},[481,3778,744],{"class":527},[481,3780,3781],{"class":564},"\"high-value-orders\"",[481,3783,1309],{"class":527},[481,3785,3786],{"class":483,"line":518},[481,3787,515],{"emptyLinePlaceholder":514},[481,3789,3790],{"class":483,"line":537},[481,3791,3792],{"class":603},"\u002F\u002F Branch 2 — same reference, no second subscription\n",[481,3794,3795,3797,3800,3803,3805,3808,3811,3814,3816,3818,3821],{"class":483,"line":550},[481,3796,3763],{"class":527},[481,3798,3799],{"class":491},"mapValues",[481,3801,3802],{"class":527}," { v ",[481,3804,2425],{"class":546},[481,3806,3807],{"class":527}," v.",[481,3809,3810],{"class":491},"summary",[481,3812,3813],{"class":527},"() }.",[481,3815,2804],{"class":491},[481,3817,744],{"class":527},[481,3819,3820],{"class":564},"\"order-summaries\"",[481,3822,1309],{"class":527},[471,3824,3826],{"className":613,"code":3825,"filename":615,"language":616,"meta":477,"style":477},"KStream\u003CString, Order> orders = builder.stream(\"orders\", Consumed.with(Serdes.String(), orderSerde));\n\n\u002F\u002F Branch 1\norders.filter((k, v) -> v.isHighValue()).to(\"high-value-orders\");\n\n\u002F\u002F Branch 2 — same reference, no second subscription\norders.mapValues(Order::summary).to(\"order-summaries\");\n",[324,3827,3828,3884,3888,3892,3938,3942,3946],{"__ignoreMap":477},[481,3829,3830,3832,3834,3836,3838,3840,3842,3844,3847,3850,3852,3854,3856,3858,3860,3862,3864,3866,3868,3870,3872,3874,3876,3878,3880,3882],{"class":483,"line":484},[481,3831,443],{"class":527},[481,3833,761],{"class":546},[481,3835,583],{"class":738},[481,3837,766],{"class":546},[481,3839,2564],{"class":738},[481,3841,772],{"class":546},[481,3843,776],{"class":775},[481,3845,3846],{"class":546}," =",[481,3848,3849],{"class":775}," builder",[481,3851,362],{"class":546},[481,3853,330],{"class":491},[481,3855,744],{"class":546},[481,3857,802],{"class":795},[481,3859,799],{"class":564},[481,3861,802],{"class":795},[481,3863,766],{"class":546},[481,3865,1034],{"class":775},[481,3867,362],{"class":546},[481,3869,577],{"class":491},[481,3871,744],{"class":546},[481,3873,727],{"class":775},[481,3875,362],{"class":546},[481,3877,583],{"class":491},[481,3879,824],{"class":546},[481,3881,2721],{"class":527},[481,3883,1051],{"class":546},[481,3885,3886],{"class":483,"line":495},[481,3887,515],{"emptyLinePlaceholder":514},[481,3889,3890],{"class":483,"line":503},[481,3891,3758],{"class":603},[481,3893,3894,3896,3898,3900,3902,3905,3907,3910,3912,3914,3916,3918,3921,3924,3926,3928,3930,3933,3935],{"class":483,"line":511},[481,3895,799],{"class":775},[481,3897,362],{"class":546},[481,3899,3766],{"class":491},[481,3901,2614],{"class":546},[481,3903,3904],{"class":527},"k",[481,3906,766],{"class":546},[481,3908,3909],{"class":527}," v",[481,3911,750],{"class":546},[481,3913,2626],{"class":546},[481,3915,3909],{"class":775},[481,3917,362],{"class":546},[481,3919,3920],{"class":491},"isHighValue",[481,3922,3923],{"class":546},"()).",[481,3925,2804],{"class":491},[481,3927,744],{"class":546},[481,3929,802],{"class":795},[481,3931,3932],{"class":564},"high-value-orders",[481,3934,802],{"class":795},[481,3936,3937],{"class":546},");\n",[481,3939,3940],{"class":483,"line":518},[481,3941,515],{"emptyLinePlaceholder":514},[481,3943,3944],{"class":483,"line":537},[481,3945,3792],{"class":603},[481,3947,3948,3950,3952,3954,3956,3958,3961,3963,3965,3967,3969,3971,3974,3976],{"class":483,"line":550},[481,3949,799],{"class":775},[481,3951,362],{"class":546},[481,3953,3799],{"class":491},[481,3955,744],{"class":546},[481,3957,2393],{"class":527},[481,3959,3960],{"class":487},"::",[481,3962,3810],{"class":527},[481,3964,2233],{"class":546},[481,3966,2804],{"class":491},[481,3968,744],{"class":546},[481,3970,802],{"class":795},[481,3972,3973],{"class":564},"order-summaries",[481,3975,802],{"class":795},[481,3977,3937],{"class":546},[320,3979,3980,3981,415,3983,3985,3986,3989,3990,3993,3994,335,3997,4000,4001,4003],{},"The same rule applies to ",[324,3982,334],{},[324,3984,338],{},", and any other source. To merge two streams into one, use ",[324,3987,3988],{},"KStream.merge(...)"," (see the ",[356,3991,3992],{"href":116},"stock-tick-filter example","); to split one stream into named branches by predicate, use ",[324,3995,3996],{},"split",[324,3998,3999],{},"branch",". Fan-out and merge happen in-memory between processing lanes — no broker round-trip, no repartition topic. See ",[356,4002,57],{"href":58}," for the routing model.",[450,4005,4007],{"id":4006},"worked-example","Worked example",[320,4009,4010,4011,4014,4015,4018,4019,4021,4022,4024,4025,4027],{},"The runtime ",[356,4012,4013],{"href":29},"word count"," reads ",[324,4016,4017],{},"text-lines",", counts by word, and writes ",[324,4020,3014],{}," — a ",[324,4023,583],{}," source and a ",[324,4026,2829],{}," sink:",[471,4029,4031],{"className":473,"code":4030,"language":476,"meta":477,"style":477},"builder\n    .stream\u003CString, String>(\"text-lines\", Consumed.`as`(\"source\"))\n    .flatMapValues { line -> line.lowercase().split(Regex(\"\\\\s+\")).filter { it.isNotBlank() } }\n    .groupBy({ _, word -> word })\n    .count(Materialized.`as`\u003CString, Long, StateStore>(\"word-counts\"))\n    .toStream()\n    .to(\n        \"word-counts\",\n        Produced.`as`\u003CString, Long>(\"sink\")\n            .withKeySerde(Serdes.String())\n            .withValueSerde(Serdes.Long()),\n    )\n",[324,4032,4033,4038,4069,4122,4137,4168,4178,4186,4193,4214,4226,4238],{"__ignoreMap":477},[481,4034,4035],{"class":483,"line":484},[481,4036,4037],{"class":527},"builder\n",[481,4039,4040,4043,4045,4047,4049,4051,4053,4055,4058,4060,4062,4064,4067],{"class":483,"line":495},[481,4041,4042],{"class":527},"    .",[481,4044,330],{"class":491},[481,4046,761],{"class":527},[481,4048,583],{"class":531},[481,4050,415],{"class":527},[481,4052,583],{"class":531},[481,4054,1304],{"class":527},[481,4056,4057],{"class":564},"\"text-lines\"",[481,4059,1217],{"class":527},[481,4061,1272],{"class":491},[481,4063,744],{"class":527},[481,4065,4066],{"class":564},"\"source\"",[481,4068,1725],{"class":527},[481,4070,4071,4073,4076,4079,4081,4084,4087,4090,4092,4094,4097,4099,4101,4105,4108,4111,4113,4116,4119],{"class":483,"line":503},[481,4072,4042],{"class":527},[481,4074,4075],{"class":491},"flatMapValues",[481,4077,4078],{"class":527}," { line ",[481,4080,2425],{"class":546},[481,4082,4083],{"class":527}," line.",[481,4085,4086],{"class":491},"lowercase",[481,4088,4089],{"class":527},"().",[481,4091,3996],{"class":491},[481,4093,744],{"class":527},[481,4095,4096],{"class":491},"Regex",[481,4098,744],{"class":527},[481,4100,802],{"class":564},[481,4102,4104],{"class":4103},"sEi1f","\\\\",[481,4106,4107],{"class":564},"s+\"",[481,4109,4110],{"class":527},")).",[481,4112,3766],{"class":491},[481,4114,4115],{"class":527}," { it.",[481,4117,4118],{"class":491},"isNotBlank",[481,4120,4121],{"class":527},"() } }\n",[481,4123,4124,4126,4129,4132,4134],{"class":483,"line":511},[481,4125,4042],{"class":527},[481,4127,4128],{"class":491},"groupBy",[481,4130,4131],{"class":527},"({ _, word ",[481,4133,2425],{"class":546},[481,4135,4136],{"class":527}," word })\n",[481,4138,4139,4141,4144,4147,4149,4151,4153,4155,4157,4159,4161,4163,4166],{"class":483,"line":518},[481,4140,4042],{"class":527},[481,4142,4143],{"class":491},"count",[481,4145,4146],{"class":527},"(Materialized.",[481,4148,1272],{"class":491},[481,4150,761],{"class":527},[481,4152,583],{"class":531},[481,4154,415],{"class":527},[481,4156,2829],{"class":531},[481,4158,415],{"class":527},[481,4160,1301],{"class":531},[481,4162,1304],{"class":527},[481,4164,4165],{"class":564},"\"word-counts\"",[481,4167,1725],{"class":527},[481,4169,4170,4172,4175],{"class":483,"line":537},[481,4171,4042],{"class":527},[481,4173,4174],{"class":491},"toStream",[481,4176,4177],{"class":527},"()\n",[481,4179,4180,4182,4184],{"class":483,"line":550},[481,4181,4042],{"class":527},[481,4183,2804],{"class":491},[481,4185,558],{"class":527},[481,4187,4188,4191],{"class":483,"line":561},[481,4189,4190],{"class":564},"        \"word-counts\"",[481,4192,568],{"class":527},[481,4194,4195,4198,4200,4202,4204,4206,4208,4210,4212],{"class":483,"line":571},[481,4196,4197],{"class":527},"        Produced.",[481,4199,1272],{"class":491},[481,4201,761],{"class":527},[481,4203,583],{"class":531},[481,4205,415],{"class":527},[481,4207,2829],{"class":531},[481,4209,1304],{"class":527},[481,4211,2878],{"class":564},[481,4213,1309],{"class":527},[481,4215,4216,4218,4220,4222,4224],{"class":483,"line":594},[481,4217,1315],{"class":527},[481,4219,1318],{"class":491},[481,4221,580],{"class":527},[481,4223,583],{"class":491},[481,4225,1325],{"class":527},[481,4227,4228,4230,4232,4234,4236],{"class":483,"line":600},[481,4229,1315],{"class":527},[481,4231,1333],{"class":491},[481,4233,580],{"class":527},[481,4235,2829],{"class":491},[481,4237,591],{"class":527},[481,4239,4240],{"class":483,"line":607},[481,4241,1345],{"class":527},[450,4243,4245],{"id":4244},"next-steps","Next steps",[367,4247,4248,4266,4273,4286,4293],{},[370,4249,4250,4254,4255,415,4258,415,4260,415,4263,4265],{},[373,4251,4252],{},[356,4253,358],{"href":116}," — the operators between source and sink: ",[324,4256,4257],{},"map",[324,4259,3766],{},[324,4261,4262],{},"merge",[324,4264,3996],{},", table conversions.",[370,4267,4268,4272],{},[373,4269,4270],{},[356,4271,727],{"href":146}," — choosing and configuring serializers for keys and values.",[370,4274,4275,4279,4280,4282,4283,4285],{},[373,4276,4277],{},[356,4278,100],{"href":101}," — ",[324,4281,1149],{}," and the store types behind ",[324,4284,334],{}," and the aggregations.",[370,4287,4288,4292],{},[373,4289,4290],{},[356,4291,140],{"href":141}," — emit records on an interval or cron schedule without reading from Kafka.",[370,4294,4295,4299,4300,362],{},[373,4296,4297],{},[356,4298,67],{"href":68}," — the full event-time model behind ",[324,4301,2492],{},[4303,4304,4305],"style",{},"html pre.shiki code .sbBg2, html code.shiki .sbBg2{--shiki-default:#1E754F}html pre.shiki code .sySUi, html code.shiki .sySUi{--shiki-default:#59873A}html pre.shiki code .suHK_, html code.shiki .suHK_{--shiki-default:#393A34}html pre.shiki code .sUxyF, html code.shiki .sUxyF{--shiki-default:#2E8F82}html pre.shiki code .sYZai, html code.shiki .sYZai{--shiki-default:#999999}html pre.shiki code .spphp, html code.shiki .spphp{--shiki-default:#B56959}html pre.shiki code .s8zF2, html code.shiki .s8zF2{--shiki-default:#A0ADA0}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .si04Y, html code.shiki .si04Y{--shiki-default:#AB5959}html pre.shiki code .svycV, html code.shiki .svycV{--shiki-default:#B07D48}html pre.shiki code .sSP4y, html code.shiki .sSP4y{--shiki-default:#B5695977}html pre.shiki code .s-TwI, html code.shiki .s-TwI{--shiki-default:#2F798A}html pre.shiki code .sEi1f, html code.shiki .sEi1f{--shiki-default:#A65E2B}",{"title":477,"searchDepth":495,"depth":495,"links":4307},[4308,4311,4314,4319,4324,4325,4326],{"id":452,"depth":495,"text":453,"children":4309},[4310],{"id":842,"depth":503,"text":843},{"id":1127,"depth":495,"text":1128,"children":4312},[4313],{"id":1674,"depth":503,"text":1675},{"id":1780,"depth":495,"text":4315,"children":4316},"Configuring the read — Consumed",[4317,4318],{"id":1968,"depth":503,"text":1969},{"id":2317,"depth":503,"text":2318},{"id":2762,"depth":495,"text":4320,"children":4321},"Writing a sink — to() and Produced",[4322,4323],{"id":3119,"depth":503,"text":3120},{"id":3455,"depth":503,"text":3456},{"id":3701,"depth":495,"text":1123},{"id":4006,"depth":495,"text":4007},{"id":4244,"depth":495,"text":4245},"Read records into a topology with builder.stream \u002F table \u002F globalTable and Consumed, and write them back out with to() and Produced — serdes, offset reset, watermarks, partitioners, and the fan-out rule.","md",{},{"icon":113},"how-to",{"title":110,"description":4327},"usN4b1WDMlQeLRn7mYcIg_3An0QQIwgy6FbU7mPL3LI",[4335,4337],{"title":105,"path":106,"stem":107,"description":4336,"icon":108,"children":-1},"Unit-test a StoatFlow topology in-memory with TopologyTestDriver — pipe records, advance time and watermarks, read state stores, and drive YAML config through StoatFlowTestDriver. No broker required.",{"title":115,"path":116,"stem":117,"description":4338,"icon":118,"children":-1},"Stateless stream transforms (map, filter, flatMap, selectKey, branch, merge) and KTable basics — with the rules for when a key change forces records onto a different lane.",1783713357845]