<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Chnzhoujun on Medium]]></title>
        <description><![CDATA[Stories by Chnzhoujun on Medium]]></description>
        <link>https://medium.com/@chnzhoujun?source=rss-ccb55bd68f30------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*5oGzIP9MDKHlBQnv.jpg</url>
            <title>Stories by Chnzhoujun on Medium</title>
            <link>https://medium.com/@chnzhoujun?source=rss-ccb55bd68f30------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 06:12:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chnzhoujun/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Avoid Updating Distribution Columns When Writing to Greenplum with NiFi]]></title>
            <link>https://medium.com/@chnzhoujun/how-to-avoid-updating-distribution-columns-when-writing-to-greenplum-with-nifi-8ed9ad49d378?source=rss-ccb55bd68f30------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ed9ad49d378</guid>
            <dc:creator><![CDATA[Chnzhoujun]]></dc:creator>
            <pubDate>Sun, 01 Mar 2026 17:03:10 GMT</pubDate>
            <atom:updated>2026-03-01T17:03:10.849Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>How to Avoid Updating Distribution Columns</strong> <strong>When Writing to Greenplum with NiFi</strong></p><p>The <strong>PutDatabaseRecord</strong> component converts records into SQL statements in NiFi, which include updates to the primary key (i.e., the distributed key). This is not allowed in Greenplum. Therefore, we developed a custom component <strong>PutGreenplumRecord</strong> to avoid this issue.</p><pre>16:18:02 UTC  ERROR PutDatabaseRecord[id=aa301889-019c-1000-8e4e-3d3bf98c7e8f] Failed to put Records to database for FlowFile[filename=d071e61b-8153-47d8-9d9d-c95094a04055]. Routing to failure.: java.sql.BatchUpdateException: Batch entry 0 INSERT INTO nifi.test_upsert_compound1(id, name, remark) VALUES ((&#39;1&#39;::numeric), (&#39;nifi_upsert1&#39;), (&#39;xx11&#39;)) ON CONFLICT (name, id) DO UPDATE SET (id, name, remark) = (EXCLUDED.id, EXCLUDED.name, EXCLUDED.remark) was aborted: ERROR: modification of distribution columns in OnConflictUpdate is not supported  Call getNextException to see other errors in the batch.<br>- Caused by: org.postgresql.util.PSQLException: ERROR: modification of distribution columns in OnConflictUpdate is not supportedFor example, when writing the following test data to the Greenplum table nifi.test_upsert_compound1:</pre><p>For example, when writing the following test data to the Greenplum table nifi.test_upsert_compound1:</p><pre>[ <br>  {&quot;id&quot;: 1, &quot;name&quot;: &quot;nifi_upsert1&quot;, &quot;remark&quot;: &quot;xx1001&quot;}, <br>  {&quot;id&quot;: 3, &quot;name&quot;: &quot;nifi_upsert3&quot;, &quot;remark&quot;: &quot;xx3003&quot;}<br>]</pre><p>Table Structure in Greenplum:</p><pre>Table &quot;nifi.test_upsert_compound1&quot;<br>Column | Type                   | Nullable <br>-------+------------------------+----------<br>id     | numeric                | not null <br>name   | character varying(20)  | not null <br>remark | character varying(40)  | <br>Indexes: <br>    &quot;test_upsert_compound1_pkey&quot; PRIMARY KEY, btree (id, name)<br>Distributed by: (id, name)</pre><p><strong>Solution:</strong></p><p>Replace PutDatabaseRecord with a custom component PutGreenplumRecord.</p><p><strong>Test Comparison:</strong></p><ul><li>Left: PutGreenplumRecord → <strong>Success</strong> (data updated).</li><li>Right: PutDatabaseRecord → <strong>Failure</strong> (error thrown).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VauS8pdM2Oa_TqHV96P61g.png" /></figure><p>Post-Update Data Verification:</p><pre>id | name          | remark<br>---+---------------+--------<br>1  | nifi_upsert1  | xx1001<br>3  | nifi_upsert3  | xx3003</pre><p>If you need this component, please provide your email address. We have used NiFi in production for over 5 years across 7 clusters (largest cluster &gt;10,000 components) and are happy to share experiences.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ed9ad49d378" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to resolve SNI issue when upgrading to NiFi 2.0]]></title>
            <link>https://medium.com/@chnzhoujun/how-to-resolve-sni-issue-when-upgrading-to-nifi-2-0-907e07d465c5?source=rss-ccb55bd68f30------2</link>
            <guid isPermaLink="false">https://medium.com/p/907e07d465c5</guid>
            <category><![CDATA[nifi]]></category>
            <category><![CDATA[apache-nifi]]></category>
            <dc:creator><![CDATA[Chnzhoujun]]></dc:creator>
            <pubDate>Mon, 18 Mar 2024 03:36:28 GMT</pubDate>
            <atom:updated>2024-03-18T03:36:28.449Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Resolve SNI issue when upgrading to NiFi 2.0</h3><p><strong>1 NiFi Cluster Topology<br></strong>Below is the topology diagram of our NiFi testing environment. Users access the NiFi cluster by accessing the domain <a href="https://nifitest.gz.cvt.cn/nifi">https://nifitest.gz.cvt.cn/nifi</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*epfo8ZFbrj_7AxLbV_RAew.png" /><figcaption>NiFi cluster</figcaption></figure><p><strong>2 Upgrade Certificates<br></strong>Due to the upgrade to Jetty 10 and the requirement of JDK version 21 in NiFi 2.0, it is necessary for the accessed domain name to match the one in the certificate when accessing the node. Otherwise, an error 400: Invalid SNI will occur. Although the NiFi software can be successfully upgraded, accessing it through a reverse proxy domain will result in the following error, which is a common issue encountered during the 2.0 upgrade.</p><pre>HTTP ERROR 400 Invalid SNI<br>URI:    /<br>STATUS:    400<br>MESSAGE:    Invalid SNI<br>SERVLET:    -<br>CAUSED BY:    org.eclipse.jetty.http.BadMessageException: 400: Invalid SNI<br>Caused by:<br>org.eclipse.jetty.http.BadMessageException: 400: Invalid SNI<br>    at org.eclipse.jetty.server.SecureRequestCustomizer.customize(SecureRequestCustomizer.java:266)<br>    at org.eclipse.jetty.server.SecureRequestCustomizer.customize(SecureRequestCustomizer.java:207)<br>    at org.eclipse.jetty.server.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1594)<br>    at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:753)<br>    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:501)<br>    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:287)<br>    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314)<br>    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)<br>    at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:558)<br>    at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:379)<br>    at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:146)<br>    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)<br>    at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)<br>    at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421)<br>    at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390)<br>    at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277)<br>    at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:199)<br>    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411)<br>    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:969)<br>    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1194)<br>    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1149)<br>    at java.base/java.lang.Thread.run(Thread.java:1583)</pre><p>One important aspect of the generated certificate is that the IP addresses, domain names, and proxy domain names of the cluster nodes need to be included in the Subject Alternative Name (SAN). Otherwise, after going through the proxy, a similar error will be prompted. In this case, the NiFi tls-toolkit tool was used to generate certificates in Server-Client mode. Previous tests have shown that even when generating certificates for three standalone nodes, the same error message still appears.</p><pre>javax.net.ssl.SSLPeerUnverifiedException: Hostname t-edi-nifi-002 not verified: certificate: sha256/7HGquzS/I7NGdT2WUMEbMHa2c5/iKjuG1lkx/gb+G5U= DN: CN=t-edi-nifi-002, OU=NIFI subjectAltNames: [t-edi-nifi-002, 10.10.11.101, 10.10.11.102, 10.10.11.103, t-edi-nifi-001, t-edi-nifi-003, nifitest.gz.cvte.cn]</pre><p>Below is the script for generating the certificate.</p><pre>// CA Server side, here we use &quot;t-edi-nifi-001&quot; as the CA Server<br>sh /usr/share/nifi-toolkit-1.25.0/bin/tls-toolkit.sh server -c t-edi-nifi-001 -t djailjfoiqnvbuu4 -p 9999<br><br>// On the client side, execute the following commands on &quot;t-edi-nifi-001&quot;, &quot;t-edi-nifi-002&quot;, and &quot;t-edi-nifi-003&quot; respectively.<br>sh /usr/share/nifi-toolkit-1.25.0/bin/tls-toolkit.sh client -c t-edi-nifi-001 -t djailjfoiqnvbuu4 -p 9999 --subjectAlternativeNames &#39;10.10.11.101,10.10.11.102,10.10.11.103,t-edi-nifi-001,t-edi-nifi-002,t-edi-nifi-003,nifitest.gz.cvte.cn&#39;<br><br>// Replace the security configuration in the &quot;nifi.properties&quot; file with the content generated from the &quot;config.json&quot; file of each node.<br>nifi.security.keystore=./conf/keystore.jks<br>nifi.security.keystoreType=jks<br>nifi.security.keystorePasswd=YHIP3BeUbxwobhzPJJpXg5+9enVMLRVvZ1d0HOBBEIc<br>nifi.security.keyPasswd=YHIP3BeUbxwobhzPJJpXg5+9enVMLRVvZ1d0HOBBEIc<br>nifi.security.truststore=./conf/truststore.jks<br>nifi.security.truststoreType=jks<br>nifi.security.truststorePasswd=5uY/tPli3Rlbc3hBLcc4oDlniijNmcVbzttXT5UiYPE<br><br>The following is the content of &quot;config.json&quot; on &quot;t-edi-nifi-001&quot;:<br>{<br>  &quot;days&quot; : 825,<br>  &quot;keySize&quot; : 2048,<br>  &quot;keyPairAlgorithm&quot; : &quot;RSA&quot;,<br>  &quot;signingAlgorithm&quot; : &quot;SHA256WITHRSA&quot;,<br>  &quot;dn&quot; : &quot;CN=t-edi-nifi-001, OU=NIFI&quot;,<br>  &quot;keyStore&quot; : &quot;keystore.jks&quot;,<br>  &quot;keyStoreType&quot; : &quot;jks&quot;,<br>  &quot;keyStorePassword&quot; : &quot;YHIP3BeUbxwobhzPJJpXg5+9enVMLRVvZ1d0HOBBEIc&quot;,<br>  &quot;keyPassword&quot; : &quot;YHIP3BeUbxwobhzPJJpXg5+9enVMLRVvZ1d0HOBBEIc&quot;,<br>  &quot;token&quot; : &quot;djailjfoiqnvbuu4&quot;,<br>  &quot;caHostname&quot; : &quot;t-edi-nifi-001&quot;,<br>  &quot;port&quot; : 9999,<br>  &quot;dnPrefix&quot; : &quot;CN=&quot;,<br>  &quot;dnSuffix&quot; : &quot;, OU=NIFI&quot;,<br>  &quot;additionalCACertificate&quot; : &quot;&quot;,<br>  &quot;domainAlternativeNames&quot; : [ &quot;10.10.11.101&quot;, &quot;10.10.11.102&quot;, &quot;10.10.11.103&quot;, &quot;t-edi-nifi-001&quot;, &quot;t-edi-nifi-002&quot;, &quot;t-edi-nifi-003&quot;, &quot;nifitest.gz.cvte.cn&quot; ],<br>  &quot;trustStore&quot; : &quot;truststore.jks&quot;,<br>  &quot;trustStorePassword&quot; : &quot;5uY/tPli3Rlbc3hBLcc4oDlniijNmcVbzttXT5UiYPE&quot;,<br>  &quot;trustStoreType&quot; : &quot;jks&quot;<br>}</pre><p><strong>Access NiFi<br></strong><a href="https://nifitest.gz.cvte.cn/nifi">https://nifitest.gz.cvte.cn/nifi</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eCJkZIRt9tne6TIULd_VEA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=907e07d465c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>