title: Using AvroSchemaRegistry in Apache NiFi
body: <p>I have 5 different <code>CSVReader</code> controller services. Their configuration is the same except <code>schema text</code> (because different headers) and 1 <code>CSVRecordSetWriter</code>.</p>
  <p>I want to leave only one <code>CSVReader</code> and set <code>schema text</code> dynamically. I read about <code>AvroSchemaRegistry</code> but I didn't clearly understand how to use it.</p>
  <p>Should i create 5 different <code>AvroSchemaRegistry</code> controllers with 2 attributes: <code>name</code> and <code>value</code>?
  F.e. i want to put following schema:</p>
  <pre><code>{
      &quot;type&quot;: &quot;record&quot;,
      &quot;name&quot;: &quot;campaigns&quot;,
      &quot;namespace&quot;: &quot;common&quot;,
      &quot;fields&quot;: [
          {&quot;name&quot;: &quot;campaign_name&quot;, &quot;type&quot;: &quot;string&quot;},
          {&quot;name&quot;: &quot;campaign_id&quot;, &quot;type&quot;: &quot;long&quot;},
          {&quot;name&quot;: &quot;date&quot;, &quot;type&quot; : {&quot;type&quot;: &quot;int&quot;, &quot;logicalType&quot; : &quot;date&quot;}}
      ]
  }
  </code></pre>
  <p>I should create <code>AvroSchemaRegistry</code> with:</p>
  <ul>
  <li><code>name</code> = campaigns;</li>
  <li><code>value</code> = <em>Full Code above</em>.</li>
  </ul>
  <p>For another schema i should create another <code>AvroSchemaResgitry</code> controller with another attributes <code>name</code> and <code>value</code>?</p>
  <p>After that, how to configure <code>CSVReader</code> and <code>CSVRecordSetWriter</code> to work with these schemas? And finally, what should i do with flowfiles? Add additional attributes? What kind of?</p>