Support Questions

Find answers, ask questions, and share your expertise

NIFI performing slow while calling Https Endpoint

avatar
Explorer

Hi Team,

 

I have created an rest endpoint on NIFI as per below Screen.

The purpose of this endpoint is to fetch data from https://jsonplaceholder.typicode.com/todos/2 and present as http response of my API.

 

deepak123_0-1669709843029.png

 

Below is my template code -

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template encoding-version="1.3">
<description></description>
<groupId>be506fdd-0184-1000-83e1-c82d0bfe4cb7</groupId>
<name>SampleTemplatetoCallHttpsEndpoint</name>
<snippet>
<processGroups>
<id>78122aea-0a0d-3713-0000-000000000000</id>
<parentGroupId>f175ed29-51e9-3358-0000-000000000000</parentGroupId>
<position>
<x>0.0</x>
<y>0.0</y>
</position>
<versionedComponentId>78122aea-0a0d-3713-ba11-a970a91b757e</versionedComponentId>
<comments></comments>
<contents>
<connections>
<id>00ded3d7-2d46-349b-0000-000000000000</id>
<parentGroupId>78122aea-0a0d-3713-0000-000000000000</parentGroupId>
<versionedComponentId>00ded3d7-2d46-349b-961f-70dea30221a0</versionedComponentId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
<backPressureObjectThreshold>10000</backPressureObjectThreshold>
<destination>
<groupId>78122aea-0a0d-3713-0000-000000000000</groupId>
<id>ee78f8d2-3236-3a63-0000-000000000000</id>
<type>FUNNEL</type>
<versionedComponentId>ee78f8d2-3236-3a63-b432-78a440bb8729</versionedComponentId>
</destination>
<flowFileExpiration>0 sec</flowFileExpiration>
<labelIndex>1</labelIndex>
<loadBalanceCompression>DO_NOT_COMPRESS</loadBalanceCompression>
<loadBalancePartitionAttribute></loadBalancePartitionAttribute>
<loadBalanceStatus>LOAD_BALANCE_NOT_CONFIGURED</loadBalanceStatus>
<loadBalanceStrategy>DO_NOT_LOAD_BALANCE</loadBalanceStrategy>
<name></name>
<selectedRelationships>failure</selectedRelationships>
<selectedRelationships>success</selectedRelationships>
<source>
<groupId>78122aea-0a0d-3713-0000-000000000000</groupId>
<id>3b9d7ee3-9200-333f-0000-000000000000</id>
<type>PROCESSOR</type>
<versionedComponentId>3b9d7ee3-9200-333f-8adb-3eb333f68939</versionedComponentId>
</source>
<zIndex>0</zIndex>
</connections>
<connections>
<id>93d70ed0-dd42-3a22-0000-000000000000</id>
<parentGroupId>78122aea-0a0d-3713-0000-000000000000</parentGroupId>
<versionedComponentId>93d70ed0-dd42-3a22-a36e-41b221e29208</versionedComponentId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
<backPressureObjectThreshold>10000</backPressureObjectThreshold>
<destination>
<groupId>78122aea-0a0d-3713-0000-000000000000</groupId>
<id>8f168363-7317-3d50-0000-000000000000</id>
<type>PROCESSOR</type>
<versionedComponentId>8f168363-7317-3d50-ba9f-39c59db70b0b</versionedComponentId>
</destination>
<flowFileExpiration>0 sec</flowFileExpiration>
<labelIndex>1</labelIndex>
<loadBalanceCompression>DO_NOT_COMPRESS</loadBalanceCompression>
<loadBalancePartitionAttribute></loadBalancePartitionAttribute>
<loadBalanceStatus>LOAD_BALANCE_NOT_CONFIGURED</loadBalanceStatus>
<loadBalanceStrategy>DO_NOT_LOAD_BALANCE</loadBalanceStrategy>
<name></name>
<selectedRelationships>success</selectedRelationships>
<source>
<groupId>78122aea-0a0d-3713-0000-000000000000</groupId>
<id>3bd96804-913b-3f17-0000-000000000000</id>
<type>PROCESSOR</type>
<versionedComponentId>3bd96804-913b-3f17-9130-1ba70c4e74cc</versionedComponentId>
</source>
<zIndex>0</zIndex>
</connections>
<connections>
<id>9f9438da-0a20-3e45-0000-000000000000</id>
<parentGroupId>78122aea-0a0d-3713-0000-000000000000</parentGroupId>
<versionedComponentId>9f9438da-0a20-3e45-94ff-89dda93f087f</versionedComponentId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
<backPressureObjectThreshold>10000</backPressureObjectThreshold>
<destination>
<groupId>78122aea-0a0d-3713-0000-000000000000</groupId>
<id>27a101f8-d89c-3019-0000-000000000000</id>
<type>FUNNEL</type>
<versionedComponentId>27a101f8-d89c-3019-8925-19d9af051bb9</versionedComponentId>
</destination>
<flowFileExpiration>0 sec</flowFileExpiration>
<labelIndex>1</labelIndex>
<loadBalanceCompression>DO_NOT_COMPRESS</loadBalanceCompression>
<loadBalancePartitionAttribute></loadBalancePartitionAttribute>
<loadBalanceStatus>LOAD_BALANCE_NOT_CONFIGURED</loadBalanceStatus>
<loadBalanceStrategy>DO_NOT_LOAD_BALANCE</loadBalanceStrategy>
<name></name>
<selectedRelationships>Failure</selectedRelationships>
<selectedRelationships>No Retry</selectedRelationships>
<selectedRelationships>Original</selectedRelationships>
<selectedRelationships>Retry</selectedRelationships>
<source>
<groupId>78122aea-0a0d-3713-0000-000000000000</groupId>
<id>8f168363-7317-3d50-0000-000000000000</id>
<type>PROCESSOR</type>
<versionedComponentId>8f168363-7317-3d50-ba9f-39c59db70b0b</versionedComponentId>
</source>
<zIndex>0</zIndex>
</connections>
<connections>
<id>dcdc230b-25da-3c22-0000-000000000000</id>
<parentGroupId>78122aea-0a0d-3713-0000-000000000000</parentGroupId>
<versionedComponentId>dcdc230b-25da-3c22-aced-9ddf1abe65c2</versionedComponentId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
<backPressureObjectThreshold>10000</backPressureObjectThreshold>
<destination>
<groupId>78122aea-0a0d-3713-0000-000000000000</groupId>
<id>3b9d7ee3-9200-333f-0000-000000000000</id>
<type>PROCESSOR</type>
<versionedComponentId>3b9d7ee3-9200-333f-8adb-3eb333f68939</versionedComponentId>
</destination>
<flowFileExpiration>0 sec</flowFileExpiration>
<labelIndex>1</labelIndex>
<loadBalanceCompression>DO_NOT_COMPRESS</loadBalanceCompression>
<loadBalancePartitionAttribute></loadBalancePartitionAttribute>
<loadBalanceStatus>LOAD_BALANCE_NOT_CONFIGURED</loadBalanceStatus>
<loadBalanceStrategy>DO_NOT_LOAD_BALANCE</loadBalanceStrategy>
<name></name>
<selectedRelationships>Response</selectedRelationships>
<source>
<groupId>78122aea-0a0d-3713-0000-000000000000</groupId>
<id>8f168363-7317-3d50-0000-000000000000</id>
<type>PROCESSOR</type>
<versionedComponentId>8f168363-7317-3d50-ba9f-39c59db70b0b</versionedComponentId>
</source>
<zIndex>0</zIndex>
</connections>
<controllerServices>
<id>15effe06-a97d-3d0b-0000-000000000000</id>
<parentGroupId>78122aea-0a0d-3713-0000-000000000000</parentGroupId>
<versionedComponentId>15effe06-a97d-3d0b-b779-57e0fe9b6df6</versionedComponentId>
<bulletinLevel>WARN</bulletinLevel>
<bundle>
<artifact>nifi-http-context-map-nar</artifact>
<group>org.apache.nifi</group>
<version>1.18.0</version>
</bundle>
<descriptors>
<entry>
<key>Maximum Outstanding Requests</key>
<value>
<name>Maximum Outstanding Requests</name>
</value>
</entry>
<entry>
<key>Request Expiration</key>
<value>
<name>Request Expiration</name>
</value>
</entry>
</descriptors>
<name>StandardHttpContextMapnewservice</name>
<persistsState>false</persistsState>
<properties>
<entry>
<key>Maximum Outstanding Requests</key>
<value>5000</value>
</entry>
<entry>
<key>Request Expiration</key>
<value>1 min</value>
</entry>
</properties>
<state>ENABLED</state>
<type>org.apache.nifi.http.StandardHttpContextMap</type>
</controllerServices>
<controllerServices>
<id>759e504f-c10a-3cd2-0000-000000000000</id>
<parentGroupId>78122aea-0a0d-3713-0000-000000000000</parentGroupId>
<versionedComponentId>759e504f-c10a-3cd2-ad22-6eb7a72e5203</versionedComponentId>
<bulletinLevel>WARN</bulletinLevel>
<bundle>
<artifact>nifi-ssl-context-service-nar</artifact>
<group>org.apache.nifi</group>
<version>1.18.0</version>
</bundle>
<comments></comments>
<descriptors>
<entry>
<key>Keystore Filename</key>
<value>
<name>Keystore Filename</name>
</value>
</entry>
<entry>
<key>Keystore Password</key>
<value>
<name>Keystore Password</name>
</value>
</entry>
<entry>
<key>key-password</key>
<value>
<name>key-password</name>
</value>
</entry>
<entry>
<key>Keystore Type</key>
<value>
<name>Keystore Type</name>
</value>
</entry>
<entry>
<key>Truststore Filename</key>
<value>
<name>Truststore Filename</name>
</value>
</entry>
<entry>
<key>Truststore Password</key>
<value>
<name>Truststore Password</name>
</value>
</entry>
<entry>
<key>Truststore Type</key>
<value>
<name>Truststore Type</name>
</value>
</entry>
<entry>
<key>SSL Protocol</key>
<value>
<name>SSL Protocol</name>
</value>
</entry>
</descriptors>
<name>StandardSSLContextService</name>
<persistsState>false</persistsState>
<properties>
<entry>
<key>Keystore Filename</key>
</entry>
<entry>
<key>Keystore Password</key>
</entry>
<entry>
<key>key-password</key>
</entry>
<entry>
<key>Keystore Type</key>
</entry>
<entry>
<key>Truststore Filename</key>
<value>/usr/local/openjdk-8/lib/security/cacerts</value>
</entry>
<entry>
<key>Truststore Password</key>
</entry>
<entry>
<key>Truststore Type</key>
<value>JKS</value>
</entry>
<entry>
<key>SSL Protocol</key>
<value>TLS</value>
</entry>
</properties>
<state>ENABLED</state>
<type>org.apache.nifi.ssl.StandardSSLContextService</type>
</controllerServices>
<funnels>
<id>27a101f8-d89c-3019-0000-000000000000</id>
<parentGroupId>78122aea-0a0d-3713-0000-000000000000</parentGroupId>
<position>
<x>904.0</x>
<y>56.0</y>
</position>
<versionedComponentId>27a101f8-d89c-3019-8925-19d9af051bb9</versionedComponentId>
</funnels>
<funnels>
<id>ee78f8d2-3236-3a63-0000-000000000000</id>
<parentGroupId>78122aea-0a0d-3713-0000-000000000000</parentGroupId>
<position>
<x>1424.0</x>
<y>496.0</y>
</position>
<versionedComponentId>ee78f8d2-3236-3a63-b432-78a440bb8729</versionedComponentId>
</funnels>
<processors>
<id>3b9d7ee3-9200-333f-0000-000000000000</id>
<parentGroupId>78122aea-0a0d-3713-0000-000000000000</parentGroupId>
<position>
<x>1272.0</x>
<y>232.0</y>
</position>
<versionedComponentId>3b9d7ee3-9200-333f-8adb-3eb333f68939</versionedComponentId>
<bundle>
<artifact>nifi-standard-nar</artifact>
<group>org.apache.nifi</group>
<version>1.18.0</version>
</bundle>
<config>
<backoffMechanism>PENALIZE_FLOWFILE</backoffMechanism>
<bulletinLevel>WARN</bulletinLevel>
<comments></comments>
<concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
<descriptors>
<entry>
<key>HTTP Status Code</key>
<value>
<name>HTTP Status Code</name>
</value>
</entry>
<entry>
<key>HTTP Context Map</key>
<value>
<identifiesControllerService>org.apache.nifi.http.HttpContextMap</identifiesControllerService>
<name>HTTP Context Map</name>
</value>
</entry>
<entry>
<key>Attributes to add to the HTTP Response (Regex)</key>
<value>
<name>Attributes to add to the HTTP Response (Regex)</name>
</value>
</entry>
</descriptors>
<executionNode>ALL</executionNode>
<lossTolerant>false</lossTolerant>
<maxBackoffPeriod>10 mins</maxBackoffPeriod>
<penaltyDuration>30 sec</penaltyDuration>
<properties>
<entry>
<key>HTTP Status Code</key>
<value>200</value>
</entry>
<entry>
<key>HTTP Context Map</key>
<value>15effe06-a97d-3d0b-0000-000000000000</value>
</entry>
<entry>
<key>Attributes to add to the HTTP Response (Regex)</key>
</entry>
</properties>
<retryCount>10</retryCount>
<runDurationMillis>0</runDurationMillis>
<schedulingPeriod>0 sec</schedulingPeriod>
<schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
<yieldDuration>1 sec</yieldDuration>
</config>
<executionNodeRestricted>false</executionNodeRestricted>
<name>HandleHttpResponse</name>
<relationships>
<autoTerminate>false</autoTerminate>
<name>failure</name>
<retry>false</retry>
</relationships>
<relationships>
<autoTerminate>false</autoTerminate>
<name>success</name>
<retry>false</retry>
</relationships>
<state>STOPPED</state>
<style/>
<type>org.apache.nifi.processors.standard.HandleHttpResponse</type>
</processors>
<processors>
<id>3bd96804-913b-3f17-0000-000000000000</id>
<parentGroupId>78122aea-0a0d-3713-0000-000000000000</parentGroupId>
<position>
<x>248.0</x>
<y>232.0</y>
</position>
<versionedComponentId>3bd96804-913b-3f17-9130-1ba70c4e74cc</versionedComponentId>
<bundle>
<artifact>nifi-standard-nar</artifact>
<group>org.apache.nifi</group>
<version>1.18.0</version>
</bundle>
<config>
<backoffMechanism>PENALIZE_FLOWFILE</backoffMechanism>
<bulletinLevel>WARN</bulletinLevel>
<comments></comments>
<concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
<descriptors>
<entry>
<key>Listening Port</key>
<value>
<name>Listening Port</name>
</value>
</entry>
<entry>
<key>Hostname</key>
<value>
<name>Hostname</name>
</value>
</entry>
<entry>
<key>SSL Context Service</key>
<value>
<identifiesControllerService>org.apache.nifi.ssl.RestrictedSSLContextService</identifiesControllerService>
<name>SSL Context Service</name>
</value>
</entry>
<entry>
<key>HTTP Protocols</key>
<value>
<dependencies>
<propertyName>SSL Context Service</propertyName>
</dependencies>
<name>HTTP Protocols</name>
</value>
</entry>
<entry>
<key>HTTP Context Map</key>
<value>
<identifiesControllerService>org.apache.nifi.http.HttpContextMap</identifiesControllerService>
<name>HTTP Context Map</name>
</value>
</entry>
<entry>
<key>Allowed Paths</key>
<value>
<name>Allowed Paths</name>
</value>
</entry>
<entry>
<key>Default URL Character Set</key>
<value>
<name>Default URL Character Set</name>
</value>
</entry>
<entry>
<key>Allow GET</key>
<value>
<name>Allow GET</name>
</value>
</entry>
<entry>
<key>Allow POST</key>
<value>
<name>Allow POST</name>
</value>
</entry>
<entry>
<key>Allow PUT</key>
<value>
<name>Allow PUT</name>
</value>
</entry>
<entry>
<key>Allow DELETE</key>
<value>
<name>Allow DELETE</name>
</value>
</entry>
<entry>
<key>Allow HEAD</key>
<value>
<name>Allow HEAD</name>
</value>
</entry>
<entry>
<key>Allow OPTIONS</key>
<value>
<name>Allow OPTIONS</name>
</value>
</entry>
<entry>
<key>Additional HTTP Methods</key>
<value>
<name>Additional HTTP Methods</name>
</value>
</entry>
<entry>
<key>Client Authentication</key>
<value>
<name>Client Authentication</name>
</value>
</entry>
<entry>
<key>container-queue-size</key>
<value>
<name>container-queue-size</name>
</value>
</entry>
<entry>
<key>multipart-request-max-size</key>
<value>
<name>multipart-request-max-size</name>
</value>
</entry>
<entry>
<key>multipart-read-buffer-size</key>
<value>
<name>multipart-read-buffer-size</name>
</value>
</entry>
<entry>
<key>parameters-to-attributes</key>
<value>
<name>parameters-to-attributes</name>
</value>
</entry>
</descriptors>
<executionNode>ALL</executionNode>
<lossTolerant>false</lossTolerant>
<maxBackoffPeriod>10 mins</maxBackoffPeriod>
<penaltyDuration>30 sec</penaltyDuration>
<properties>
<entry>
<key>Listening Port</key>
<value>8084</value>
</entry>
<entry>
<key>Hostname</key>
</entry>
<entry>
<key>SSL Context Service</key>
</entry>
<entry>
<key>HTTP Protocols</key>
<value>HTTP_1_1</value>
</entry>
<entry>
<key>HTTP Context Map</key>
<value>15effe06-a97d-3d0b-0000-000000000000</value>
</entry>
<entry>
<key>Allowed Paths</key>
<value>/evcharge</value>
</entry>
<entry>
<key>Default URL Character Set</key>
<value>UTF-8</value>
</entry>
<entry>
<key>Allow GET</key>
<value>true</value>
</entry>
<entry>
<key>Allow POST</key>
<value>true</value>
</entry>
<entry>
<key>Allow PUT</key>
<value>true</value>
</entry>
<entry>
<key>Allow DELETE</key>
<value>true</value>
</entry>
<entry>
<key>Allow HEAD</key>
<value>false</value>
</entry>
<entry>
<key>Allow OPTIONS</key>
<value>false</value>
</entry>
<entry>
<key>Additional HTTP Methods</key>
</entry>
<entry>
<key>Client Authentication</key>
<value>No Authentication</value>
</entry>
<entry>
<key>container-queue-size</key>
<value>50</value>
</entry>
<entry>
<key>multipart-request-max-size</key>
<value>1 MB</value>
</entry>
<entry>
<key>multipart-read-buffer-size</key>
<value>512 KB</value>
</entry>
<entry>
<key>parameters-to-attributes</key>
</entry>
</properties>
<retryCount>10</retryCount>
<runDurationMillis>0</runDurationMillis>
<schedulingPeriod>0 sec</schedulingPeriod>
<schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
<yieldDuration>1 sec</yieldDuration>
</config>
<executionNodeRestricted>false</executionNodeRestricted>
<name>HandleHttpRequest</name>
<relationships>
<autoTerminate>false</autoTerminate>
<name>success</name>
<retry>false</retry>
</relationships>
<state>STOPPED</state>
<style/>
<type>org.apache.nifi.processors.standard.HandleHttpRequest</type>
</processors>
<processors>
<id>8f168363-7317-3d50-0000-000000000000</id>
<parentGroupId>78122aea-0a0d-3713-0000-000000000000</parentGroupId>
<position>
<x>768.0</x>
<y>224.0</y>
</position>
<versionedComponentId>8f168363-7317-3d50-ba9f-39c59db70b0b</versionedComponentId>
<bundle>
<artifact>nifi-standard-nar</artifact>
<group>org.apache.nifi</group>
<version>1.18.0</version>
</bundle>
<config>
<backoffMechanism>PENALIZE_FLOWFILE</backoffMechanism>
<bulletinLevel>WARN</bulletinLevel>
<comments></comments>
<concurrentlySchedulableTaskCount>1</concurrentlySchedulableTaskCount>
<descriptors>
<entry>
<key>HTTP Method</key>
<value>
<name>HTTP Method</name>
</value>
</entry>
<entry>
<key>Remote URL</key>
<value>
<name>Remote URL</name>
</value>
</entry>
<entry>
<key>disable-http2</key>
<value>
<name>disable-http2</name>
</value>
</entry>
<entry>
<key>SSL Context Service</key>
<value>
<identifiesControllerService>org.apache.nifi.ssl.SSLContextService</identifiesControllerService>
<name>SSL Context Service</name>
</value>
</entry>
<entry>
<key>Connection Timeout</key>
<value>
<name>Connection Timeout</name>
</value>
</entry>
<entry>
<key>Read Timeout</key>
<value>
<name>Read Timeout</name>
</value>
</entry>
<entry>
<key>idle-timeout</key>
<value>
<name>idle-timeout</name>
</value>
</entry>
<entry>
<key>max-idle-connections</key>
<value>
<name>max-idle-connections</name>
</value>
</entry>
<entry>
<key>proxy-configuration-service</key>
<value>
<identifiesControllerService>org.apache.nifi.proxy.ProxyConfigurationService</identifiesControllerService>
<name>proxy-configuration-service</name>
</value>
</entry>
<entry>
<key>Proxy Host</key>
<value>
<name>Proxy Host</name>
</value>
</entry>
<entry>
<key>Proxy Port</key>
<value>
<dependencies>
<propertyName>Proxy Host</propertyName>
</dependencies>
<name>Proxy Port</name>
</value>
</entry>
<entry>
<key>Proxy Type</key>
<value>
<dependencies>
<propertyName>Proxy Host</propertyName>
</dependencies>
<name>Proxy Type</name>
</value>
</entry>
<entry>
<key>invokehttp-proxy-user</key>
<value>
<dependencies>
<propertyName>Proxy Host</propertyName>
</dependencies>
<name>invokehttp-proxy-user</name>
</value>
</entry>
<entry>
<key>invokehttp-proxy-password</key>
<value>
<dependencies>
<propertyName>Proxy Host</propertyName>
</dependencies>
<name>invokehttp-proxy-password</name>
</value>
</entry>
<entry>
<key>oauth2-access-token-provider</key>
<value>
<identifiesControllerService>org.apache.nifi.oauth2.OAuth2AccessTokenProvider</identifiesControllerService>
<name>oauth2-access-token-provider</name>
</value>
</entry>
<entry>
<key>Basic Authentication Username</key>
<value>
<name>Basic Authentication Username</name>
</value>
</entry>
<entry>
<key>Basic Authentication Password</key>
<value>
<name>Basic Authentication Password</name>
</value>
</entry>
<entry>
<key>Digest Authentication</key>
<value>
<dependencies>
<propertyName>Basic Authentication Username</propertyName>
</dependencies>
<name>Digest Authentication</name>
</value>
</entry>
<entry>
<key>Penalize on "No Retry"</key>
<value>
<name>Penalize on "No Retry"</name>
</value>
</entry>
<entry>
<key>send-message-body</key>
<value>
<dependencies>
<dependentValues>POST</dependentValues>
<dependentValues>PATCH</dependentValues>
<dependentValues>PUT</dependentValues>
<propertyName>HTTP Method</propertyName>
</dependencies>
<name>send-message-body</name>
</value>
</entry>
<entry>
<key>form-body-form-name</key>
<value>
<dependencies>
<dependentValues>true</dependentValues>
<propertyName>send-message-body</propertyName>
</dependencies>
<name>form-body-form-name</name>
</value>
</entry>
<entry>
<key>set-form-filename</key>
<value>
<dependencies>
<propertyName>form-body-form-name</propertyName>
</dependencies>
<name>set-form-filename</name>
</value>
</entry>
<entry>
<key>Use Chunked Encoding</key>
<value>
<dependencies>
<dependentValues>POST</dependentValues>
<dependentValues>PATCH</dependentValues>
<dependentValues>PUT</dependentValues>
<propertyName>HTTP Method</propertyName>
</dependencies>
<name>Use Chunked Encoding</name>
</value>
</entry>
<entry>
<key>Content-Encoding</key>
<value>
<dependencies>
<dependentValues>POST</dependentValues>
<dependentValues>PATCH</dependentValues>
<dependentValues>PUT</dependentValues>
<propertyName>HTTP Method</propertyName>
</dependencies>
<name>Content-Encoding</name>
</value>
</entry>
<entry>
<key>Content-Type</key>
<value>
<dependencies>
<dependentValues>POST</dependentValues>
<dependentValues>PATCH</dependentValues>
<dependentValues>PUT</dependentValues>
<propertyName>HTTP Method</propertyName>
</dependencies>
<name>Content-Type</name>
</value>
</entry>
<entry>
<key>Include Date Header</key>
<value>
<name>Include Date Header</name>
</value>
</entry>
<entry>
<key>Attributes to Send</key>
<value>
<name>Attributes to Send</name>
</value>
</entry>
<entry>
<key>Useragent</key>
<value>
<name>Useragent</name>
</value>
</entry>
<entry>
<key>Put Response Body In Attribute</key>
<value>
<name>Put Response Body In Attribute</name>
</value>
</entry>
<entry>
<key>Max Length To Put In Attribute</key>
<value>
<dependencies>
<propertyName>Put Response Body In Attribute</propertyName>
</dependencies>
<name>Max Length To Put In Attribute</name>
</value>
</entry>
<entry>
<key>ignore-response-content</key>
<value>
<name>ignore-response-content</name>
</value>
</entry>
<entry>
<key>use-etag</key>
<value>
<name>use-etag</name>
</value>
</entry>
<entry>
<key>etag-max-cache-size</key>
<value>
<dependencies>
<dependentValues>true</dependentValues>
<propertyName>use-etag</propertyName>
</dependencies>
<name>etag-max-cache-size</name>
</value>
</entry>
<entry>
<key>cookie-strategy</key>
<value>
<name>cookie-strategy</name>
</value>
</entry>
<entry>
<key>Always Output Response</key>
<value>
<name>Always Output Response</name>
</value>
</entry>
<entry>
<key>flow-file-naming-strategy</key>
<value>
<name>flow-file-naming-strategy</name>
</value>
</entry>
<entry>
<key>Add Response Headers to Request</key>
<value>
<name>Add Response Headers to Request</name>
</value>
</entry>
<entry>
<key>Follow Redirects</key>
<value>
<name>Follow Redirects</name>
</value>
</entry>
</descriptors>
<executionNode>ALL</executionNode>
<lossTolerant>false</lossTolerant>
<maxBackoffPeriod>10 mins</maxBackoffPeriod>
<penaltyDuration>30 sec</penaltyDuration>
<properties>
<entry>
<key>HTTP Method</key>
<value>GET</value>
</entry>
<entry>
<key>Remote URL</key>
<value>https://jsonplaceholder.typicode.com/todos/2</value>
</entry>
<entry>
<key>disable-http2</key>
<value>True</value>
</entry>
<entry>
<key>SSL Context Service</key>
<value>759e504f-c10a-3cd2-0000-000000000000</value>
</entry>
<entry>
<key>Connection Timeout</key>
<value>5 secs</value>
</entry>
<entry>
<key>Read Timeout</key>
<value>15 secs</value>
</entry>
<entry>
<key>idle-timeout</key>
<value>5 mins</value>
</entry>
<entry>
<key>max-idle-connections</key>
<value>5</value>
</entry>
<entry>
<key>proxy-configuration-service</key>
</entry>
<entry>
<key>Proxy Host</key>
</entry>
<entry>
<key>Proxy Port</key>
</entry>
<entry>
<key>Proxy Type</key>
<value>http</value>
</entry>
<entry>
<key>invokehttp-proxy-user</key>
</entry>
<entry>
<key>invokehttp-proxy-password</key>
</entry>
<entry>
<key>oauth2-access-token-provider</key>
</entry>
<entry>
<key>Basic Authentication Username</key>
</entry>
<entry>
<key>Basic Authentication Password</key>
</entry>
<entry>
<key>Digest Authentication</key>
<value>false</value>
</entry>
<entry>
<key>Penalize on "No Retry"</key>
<value>false</value>
</entry>
<entry>
<key>send-message-body</key>
<value>true</value>
</entry>
<entry>
<key>form-body-form-name</key>
</entry>
<entry>
<key>set-form-filename</key>
<value>true</value>
</entry>
<entry>
<key>Use Chunked Encoding</key>
<value>false</value>
</entry>
<entry>
<key>Content-Encoding</key>
<value>DISABLED</value>
</entry>
<entry>
<key>Content-Type</key>
<value>${mime.type}</value>
</entry>
<entry>
<key>Include Date Header</key>
<value>True</value>
</entry>
<entry>
<key>Attributes to Send</key>
</entry>
<entry>
<key>Useragent</key>
</entry>
<entry>
<key>Put Response Body In Attribute</key>
</entry>
<entry>
<key>Max Length To Put In Attribute</key>
<value>256</value>
</entry>
<entry>
<key>ignore-response-content</key>
<value>false</value>
</entry>
<entry>
<key>use-etag</key>
<value>false</value>
</entry>
<entry>
<key>etag-max-cache-size</key>
<value>10MB</value>
</entry>
<entry>
<key>cookie-strategy</key>
<value>DISABLED</value>
</entry>
<entry>
<key>Always Output Response</key>
<value>true</value>
</entry>
<entry>
<key>flow-file-naming-strategy</key>
<value>RANDOM</value>
</entry>
<entry>
<key>Add Response Headers to Request</key>
<value>false</value>
</entry>
<entry>
<key>Follow Redirects</key>
<value>True</value>
</entry>
</properties>
<retryCount>10</retryCount>
<runDurationMillis>0</runDurationMillis>
<schedulingPeriod>0 sec</schedulingPeriod>
<schedulingStrategy>TIMER_DRIVEN</schedulingStrategy>
<yieldDuration>1 sec</yieldDuration>
</config>
<executionNodeRestricted>false</executionNodeRestricted>
<name>InvokeHTTP</name>
<relationships>
<autoTerminate>false</autoTerminate>
<name>Failure</name>
<retry>false</retry>
</relationships>
<relationships>
<autoTerminate>false</autoTerminate>
<name>No Retry</name>
<retry>false</retry>
</relationships>
<relationships>
<autoTerminate>false</autoTerminate>
<name>Original</name>
<retry>false</retry>
</relationships>
<relationships>
<autoTerminate>false</autoTerminate>
<name>Response</name>
<retry>false</retry>
</relationships>
<relationships>
<autoTerminate>false</autoTerminate>
<name>Retry</name>
<retry>false</retry>
</relationships>
<state>STOPPED</state>
<style/>
<type>org.apache.nifi.processors.standard.InvokeHTTP</type>
</processors>
</contents>
<defaultBackPressureDataSizeThreshold>1 GB</defaultBackPressureDataSizeThreshold>
<defaultBackPressureObjectThreshold>10000</defaultBackPressureObjectThreshold>
<defaultFlowFileExpiration>0 sec</defaultFlowFileExpiration>
<flowfileConcurrency>UNBOUNDED</flowfileConcurrency>
<flowfileOutboundPolicy>STREAM_WHEN_AVAILABLE</flowfileOutboundPolicy>
<name>Sample</name>
<variables/>
</processGroups>
</snippet>
<timestamp>11/29/2022 08:14:53 UTC</timestamp>
</template>

Tenplate code completed .................................

Issue -  My API is responding slow as compare to remote api which i am calling into my implementation.

 

Any suggestion or guide so that i can improve my API's perfomance?

 

Thanks

 

 

 

4 REPLIES 4

avatar
Explorer

hi guys,

 

please suggest me on same?

 

thanks

avatar

Hi @deepak123 , what do you mean by Nifi is performing slow? Based on your question, it is not very clear in which point you encountering performance issue. When waiting for an answer from your InvokeHTTP endpoint or when doing some actions on the result of the API call?

avatar
Explorer

Hi @cotopaul ,

 

Thanks for reply,

Below is my answer for your queries-

It is slower if invokehttp processor calls https endpoint while there in no perfomance issue if invokehttp processor calls http endpoint (non secured endpoint).

 

Steps which i followed to investigate for same-

Suppose i have two rest endpoint REMOTE-REST-ENDPOINT1 (Non Https) and REMOTE-REST-ENDPOINT2 (https).

Step 1 - Now i tested perfomance of both REST Endpoint(REMOTE-REST-ENDPOINT1 & REMOTE-REST-ENDPOINT2) with jmeter and found throughput of each REST Endpoint about 60 req/sec.

Step2 -  Create a rest api suppose NIFI-REST-API1 in same manner as nifi template attached in this question. but invokeHttp processor will hit REMOTE-REST-ENDPOINT1 (Non Https) .

Step3 - Create another rest api suppose NIFI-REST-API2 in same manner as nifi template attached in this question. But  invokeHttp processor will hit REMOTE-REST-ENDPOINT2 (Https).

Step4 - Now while i am checking performance of NIFI-REST-API1NIFI-REST-API2 then the result is surprsing as below-

  Throughput of NIFI-REST-API1 - is approx 58 req/sec

  Throughput of NIFI-REST-API2 -  is approx 6 req/sec (big difference although the remote api (REMOTE-REST-ENDPOINT1 & REMOTE-REST-ENDPOINT1) were performing same while tested into step1 )

 

Note - i am using same NIFI instance to deploy both APIS NIFI-REST-API1 & NIFI-REST-API2. 

 

Please let me know for any query or comment.

 

please suggest me for same.

 

Thanks

 

avatar
Explorer

Please suggest me for same