是否可以在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) 我想知道是否可以使用flowfile大小作为routeOnAttribute中的参数,我想这样表达:
${filename.fileSize>500}
Run Code Online (Sandbox Code Playgroud)
但是它告诉我表达式应该返回true并且表达式返回字符串我应该怎么做才能在routeOnAttribute中建立新连接(ps filename是我的flowfile名称)
编辑05/17/2019正确的答案是安迪的。这是我们(Apache NiFi团队)关于该主题的最佳指导。标记为“正确”的答案仅在少数情况下Content-Length
由上游处理器设置。安迪的解决方案fileSize
是普遍适用的。
有没有什么办法可以改变 <root level="INFO">
,以<root level="DEBUG">
在logback.xml如果我没有nifi应用物理连接?我的意思是有任何命令可以帮助我改变这个属性吗?
我有这样的 xml,我想用其他东西替换胡萝卜标签值我使用这个表达式(<.[^(><.)]+>)
但它不能正常工作我应该更改什么来管理获取值并用新值替换它?:
<Monkey xmlns="http://urlhere.com/monkeynamespace">
<foodType>
<vegtables>
<carrots>1</carrots>
</vegtables>
<foodType>
</Monkey>
Run Code Online (Sandbox Code Playgroud)