本文介绍了在评估jsonpath处理器的nifi usgae中,由于创建属性会影响性能影响的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将nifi REST API与我的应用程序集成.因此,通过映射应用程序的输入和输出,我试图调用nifi REST api进行流创建.因此,在大多数情况下,我会提取JSON值并应用表达式语言.

I'm trying to integrate nifi REST API's with my application. So by mapping input and output from my application, I am trying to call nifi REST api for flow creation. So, in my use case most of the times I will extract the JSON values and will apply expression languages.

因此,为了简化所有用例,我正在使用评估JSONpath处理器来使用jsonpath提取所有属性,并在提取处理器中对此应用表达式语言功能.下面是与此有关的流程图.

So, for simplifying all the use-cases I am using evaluate JSONpath processor for fetching all attributes using jsonpath and apply expression language function on that in extract processor. Below is the flow diagram regarding that.

这是正确的方法,因为对于具有30个键的JSON到JSON操作,这是最简单的方法,并且由于我尝试将nifi REST API与我的应用程序集成,因此无法基于用户映射动态生成JOLT转换逻辑.

Is it the right approach because for JSON to JSON manipulation having 30 keys this is the simplest way, and as I am trying to integrate nifi REST API's with my application I cannot generate JOLT transformation logic dynamically based on the user mapping.

因此,在这种情况下,评估JSONpath处理器的使用是否会使用不同的转换逻辑在大约50个用例中造成任何性能问题,因为正如我在文档属性使用中所看到的那样,

So, in this case, does the usage of evaluating JSONpath processor creates any performance issues for about 50 use case with different transformation logic because as I saw in documentation attribute usage creates performance(regarding memory) issues.

推荐答案

您对内存中的属性过多的担心在这里不应该成为问题;每个流文件具有30个属性的属性比平时要高,但是,如果这些字符串都是介于0-〜100-200个字符之间的字符串,那么影响应该很小.如果您开始尝试从流文件内容到每个流文件的属性中提取KB值的数据,则会看到堆使用量增加,但是框架应该能够处理此问题,直到达到非常高的吞吐量(每秒1000个流文件)在诸如现代笔记本电脑之类的商品硬件上).

Your concern about having too many attributes in memory should not be an issue here; having 30 attributes per flowfile is higher than usual, but if these are all strings between 0 - ~100-200 characters, there should be minimal impact. If you start trying to extract KB worth of data from the flowfile content to the attributes on each flowfile, you will see increased heap usage, but the framework should still be able to handle this until you reach very high throughput (1000's of flowfiles per second on commodity hardware like a modern laptop).

您可能想调查 ReplaceTextWithMapping ,因为该处理器可以从定义文件加载并使用单个处理器处理许多 replace 操作.

You may want to investigate ReplaceTextWithMapping, as that processor can load from a definition file and handle many replace operations using a single processor.

通常是流设计的气味",它具有相同的流过程的多个副本,具有不同的配置值(数据库交互偶有例外).而是查看是否有一种方法可以使用变量填充(根据传入的流文件属性,变量注册表,环境变量等).

It is usually a flow design "smell" to have multiple copies of the same flow process with different configuration values (with the occasional exception of database interaction). Rather, see if there is a way you can genericize the process and populate the relevant values for each flowfile using variable population (from the incoming flowfile attributes, the variable registry, environment variables, etc.).

这篇关于在评估jsonpath处理器的nifi usgae中,由于创建属性会影响性能影响的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 20:06