Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache camel 有没有办法使流的输出文件:file?fileName=动态?_Apache Camel - Fatal编程技术网

Apache camel 有没有办法使流的输出文件:file?fileName=动态?

Apache camel 有没有办法使流的输出文件:file?fileName=动态?,apache-camel,Apache Camel,给定一条这样简单的路线 route.from("direct:foo") .split() .tokenize("\n") .streaming() .to("stream:file?fileName=target/streaming${header.count}.txt&closeOnDone=true"); 然后用这个触发 @Test public void splitAndStreamToFile() { StringBuilder builder

给定一条这样简单的路线

route.from("direct:foo")
   .split()
   .tokenize("\n")
   .streaming()
   .to("stream:file?fileName=target/streaming${header.count}.txt&closeOnDone=true");
然后用这个触发

@Test
public void splitAndStreamToFile() {
    StringBuilder builder = new StringBuilder();
    for(int i = 0; i < 500; i++) {
        builder.append(i);
        builder.append("\n");
    }

    for(int i = 0; i < 10; i++) {
        template.sendBodyAndHeader(builder.toString(), "count", i);
    }

}

StreamProducer
的源代码似乎还不支持Camel的任何表达式语言:

private OutputStream resolveStreamFromFile() throws IOException {
    String fileName = endpoint.getFileName();
    ObjectHelper.notEmpty(fileName, "fileName");
    LOG.debug("About to write to file: {}", fileName);
    File f = new File(fileName);
    // will create a new file if missing or append to existing
    f.getParentFile().mkdirs();
    f.createNewFile();
    return new FileOutputStream(f, true);
}


如果需要动态文件名,请查看,它支持和
CamelFileName
标题。

StreamProducer的源代码似乎还不支持Camel的任何表达式语言:

private OutputStream resolveStreamFromFile() throws IOException {
    String fileName = endpoint.getFileName();
    ObjectHelper.notEmpty(fileName, "fileName");
    LOG.debug("About to write to file: {}", fileName);
    File f = new File(fileName);
    // will create a new file if missing or append to existing
    f.getParentFile().mkdirs();
    f.createNewFile();
    return new FileOutputStream(f, true);
}


如果需要动态文件名,请查看,它支持和
CamelFileName
标题。

StreamProducer的源代码似乎还不支持Camel的任何表达式语言:

private OutputStream resolveStreamFromFile() throws IOException {
    String fileName = endpoint.getFileName();
    ObjectHelper.notEmpty(fileName, "fileName");
    LOG.debug("About to write to file: {}", fileName);
    File f = new File(fileName);
    // will create a new file if missing or append to existing
    f.getParentFile().mkdirs();
    f.createNewFile();
    return new FileOutputStream(f, true);
}


如果需要动态文件名,请查看,它支持和
CamelFileName
标题。

StreamProducer的源代码似乎还不支持Camel的任何表达式语言:

private OutputStream resolveStreamFromFile() throws IOException {
    String fileName = endpoint.getFileName();
    ObjectHelper.notEmpty(fileName, "fileName");
    LOG.debug("About to write to file: {}", fileName);
    File f = new File(fileName);
    // will create a new file if missing or append to existing
    f.getParentFile().mkdirs();
    f.createNewFile();
    return new FileOutputStream(f, true);
}

如果您需要动态文件名,您应该查看,它支持和
CamelFileName
头。

它是一个动态文件,其中有一个EIP模式用于:

但是,在fileName选项上支持file/simple语言可能是一个好主意,就像常规文件组件那样。免费记录JIRA关于这一改进的记录。

这是一个动态,其中有一个EIP模式:

但是,在fileName选项上支持file/simple语言可能是一个好主意,就像常规文件组件那样。免费记录JIRA关于这一改进的记录。

这是一个动态,其中有一个EIP模式:

但是,在fileName选项上支持file/simple语言可能是一个好主意,就像常规文件组件那样。免费记录JIRA关于这一改进的记录。

这是一个动态,其中有一个EIP模式:

但是,在fileName选项上支持file/simple语言可能是一个好主意,就像常规文件组件那样。自由地记录关于这一改进的JIRA记录。

简言之

D
uri=stream:file…

我会的

“toD”基本上是在到达流组件代码之前翻译“
simple
”或“
file language
”,因此简而言之,这适用于
“fileName=…”

D
uri=stream:file…

我会的

“toD”基本上是在到达流组件代码之前翻译“
simple
”或“
file language
”,因此简而言之,这适用于
“fileName=…”

D
uri=stream:file…

我会的

“toD”基本上是在到达流组件代码之前翻译“
simple
”或“
file language
”,因此简而言之,这适用于
“fileName=…”

D
uri=stream:file…

我会的


“toD”基本上是在到达流组件代码之前翻译“
simple
”或“
file language
”,因此这适用于
“fileName=…”

,谢谢。我对骆驼还是新手,所以我不知道我能用那种方式让它工作。谢谢。我对骆驼还是新手,所以我不知道我能用那种方式让它工作。谢谢。我对骆驼还是新手,所以我不知道我能用那种方式让它工作。谢谢。我对骆驼还是个新手,所以我不知道我能用那种方式让它工作。