小编Sal*_*ili的帖子

如何在NiFi中调用远程REST服务

是否可以在NIFI处理器中使用xmlHttpRequest来调用远程休息服务?在我的情况下,ExecuteScript处理器(使用Javascript)无法评估XMLHttpRequest; 我可以使用任何类似的解决方案来获取响应数据吗?

var OutputStreamCallback = Java.type("org.apache.nifi.processor.io.OutputStreamCallback");
var StandardCharsets = Java.type("java.nio.charset.StandardCharsets");

Date.prototype.isValid = function () {
    return (Object.prototype.toString.call(this) === "[object Date]")
        && !isNaN(this.getTime());
};

var flowFile = session.get();

if (flowFile != null) {
    var fromDate = flowFile.getAttribute('fromDate')
    var uid = flowFile.getAttribute('uid')

    var xmlhttp = null;
    var result = null;

        xmlhttp = new XMLHttpRequest();
        if (typeof xmlhttp.overrideMimeType != 'undefined') {
            xmlhttp.overrideMimeType('application/json');

    } else if (window.ActiveXObject) {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.open('GET', "similar url here WorkInfo?dateFrom=?&uid=?", true);
    xmlhttp.send(dateFrom, …
Run Code Online (Sandbox Code Playgroud)

javascript rest apache-nifi

5
推荐指数
1
解决办法
1019
查看次数

在FlowOnAttribute nifi中将流文件大小用作参数

我想知道是否可以使用flowfile大小作为routeOnAttribute中的参数,我想这样表达:

${filename.fileSize>500}
Run Code Online (Sandbox Code Playgroud)

但是它告诉我表达式应该返回true并且表达式返回字符串我应该怎么做才能在routeOnAttribute中建立新连接(ps filename是我的flowfile名称)

编辑05/17/2019正确的答案是安迪的。这是我们(Apache NiFi团队)关于该主题的最佳指导。标记为“正确”的答案仅在少数情况下Content-Length由上游处理器设置。安迪的解决方案fileSize是普遍适用的。

apache-nifi

2
推荐指数
2
解决办法
2328
查看次数

logback.xml:如何在nifi中制作'debug'日志

有没有什么办法可以改变 <root level="INFO">,以<root level="DEBUG"> 在logback.xml如果我没有nifi应用物理连接?我的意思是有任何命令可以帮助我改变这个属性吗?

apache-nifi

0
推荐指数
1
解决办法
292
查看次数

用正则表达式替换 xml 标签值

我有这样的 xml,我想用其他东西替换胡萝卜标签值我使用这个表达式(<.[^(><.)]+>)但它不能正常工作我应该更改什么来管理获取值并用新值替换它?:

<Monkey xmlns="http://urlhere.com/monkeynamespace">
 <foodType>
  <vegtables>
   <carrots>1</carrots>
  </vegtables>
 <foodType>   
</Monkey>
Run Code Online (Sandbox Code Playgroud)

regex xml apache-nifi

0
推荐指数
1
解决办法
8221
查看次数

标签 统计

apache-nifi ×4

javascript ×1

regex ×1

rest ×1

xml ×1