You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Michael Rambichler <mi...@rambichler.at> on 2024/02/05 10:52:38 UTC

FTP not streaming to JMS

Dear Camel group,

Maybe I missed something.
But in my testcase/environment the JMS Endpoint does not stream and throws
an Java Heap Exception:

I have used a simple Apache Camel 3.22.0 Spring boot Route:
My JMS is a current: Red Hat AMQ Broker 7.11.0 (locally setup as cluster)
The FTP is local org.apache.ftpserver

In the example below it throws an Java Heap error. If I replace JMS with
direct it works.

Any help would be appreciated.

public void configure() {

    //from("ftp:admin:admin@localhost:9999?filename=SmallFile.data&noop=true&streamDownload=true&stepwise=false")
    from("ftp:admin:admin@localhost:9999?filename=BigFile.data&noop=true&streamDownload=true&stepwise=false")
            .routeId("Sending")
            .doTry()
                .to("jms:testjms_q?streamMessageTypeEnabled=true")
            .doCatch(Throwable.class)
            .process(exchange -> {
                System.err.println("ERROR:" + exceptionMessage());
            })
            //.to("direct:process")
            .log("Successfully finished exchange");

    from("jms:testjms_q")
    //from("direct:process")
            .routeId("Receiving Route")
            .split().tokenize(",").streaming()
            .process(exchange -> {
                Long lineNumber =
exchange.getProperty("CamelSplitIndex", Long.class);
                if ((lineNumber + 1) % 1000000 == 0) {
                    exchange.getIn().getBody(String.class);
                    log.info("streamed Line {}: {}", lineNumber + 1,
exchange.getIn().getBody(String.class));
                }
            })
            .end()
            .log("Finished");




}

Re: FTP not streaming to JMS

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

btw there are some streaming and artemis options in camel-jms if you have
not seen that.

On Mon, Feb 5, 2024 at 12:19 PM Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> If you use the Red Hat Camel / Messaging product then you can contact that
> vendor to get support.
>
>
> On Mon, Feb 5, 2024 at 11:52 AM Michael Rambichler <mi...@rambichler.at>
> wrote:
>
>> Dear Camel group,
>>
>> Maybe I missed something.
>> But in my testcase/environment the JMS Endpoint does not stream and throws
>> an Java Heap Exception:
>>
>> I have used a simple Apache Camel 3.22.0 Spring boot Route:
>> My JMS is a current: Red Hat AMQ Broker 7.11.0 (locally setup as cluster)
>> The FTP is local org.apache.ftpserver
>>
>> In the example below it throws an Java Heap error. If I replace JMS with
>> direct it works.
>>
>> Any help would be appreciated.
>>
>> public void configure() {
>>
>>     //from("ftp:admin:admin@localhost
>> :9999?filename=SmallFile.data&noop=true&streamDownload=true&stepwise=false")
>>     from("ftp:admin:admin@localhost
>> :9999?filename=BigFile.data&noop=true&streamDownload=true&stepwise=false")
>>             .routeId("Sending")
>>             .doTry()
>>                 .to("jms:testjms_q?streamMessageTypeEnabled=true")
>>             .doCatch(Throwable.class)
>>             .process(exchange -> {
>>                 System.err.println("ERROR:" + exceptionMessage());
>>             })
>>             //.to("direct:process")
>>             .log("Successfully finished exchange");
>>
>>     from("jms:testjms_q")
>>     //from("direct:process")
>>             .routeId("Receiving Route")
>>             .split().tokenize(",").streaming()
>>             .process(exchange -> {
>>                 Long lineNumber =
>> exchange.getProperty("CamelSplitIndex", Long.class);
>>                 if ((lineNumber + 1) % 1000000 == 0) {
>>                     exchange.getIn().getBody(String.class);
>>                     log.info("streamed Line {}: {}", lineNumber + 1,
>> exchange.getIn().getBody(String.class));
>>                 }
>>             })
>>             .end()
>>             .log("Finished");
>>
>>
>>
>>
>> }
>>
>
>
> --
> Claus Ibsen
> -----------------
> @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>


-- 
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: FTP not streaming to JMS

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

If you use the Red Hat Camel / Messaging product then you can contact that
vendor to get support.


On Mon, Feb 5, 2024 at 11:52 AM Michael Rambichler <mi...@rambichler.at>
wrote:

> Dear Camel group,
>
> Maybe I missed something.
> But in my testcase/environment the JMS Endpoint does not stream and throws
> an Java Heap Exception:
>
> I have used a simple Apache Camel 3.22.0 Spring boot Route:
> My JMS is a current: Red Hat AMQ Broker 7.11.0 (locally setup as cluster)
> The FTP is local org.apache.ftpserver
>
> In the example below it throws an Java Heap error. If I replace JMS with
> direct it works.
>
> Any help would be appreciated.
>
> public void configure() {
>
>     //from("ftp:admin:admin@localhost
> :9999?filename=SmallFile.data&noop=true&streamDownload=true&stepwise=false")
>     from("ftp:admin:admin@localhost
> :9999?filename=BigFile.data&noop=true&streamDownload=true&stepwise=false")
>             .routeId("Sending")
>             .doTry()
>                 .to("jms:testjms_q?streamMessageTypeEnabled=true")
>             .doCatch(Throwable.class)
>             .process(exchange -> {
>                 System.err.println("ERROR:" + exceptionMessage());
>             })
>             //.to("direct:process")
>             .log("Successfully finished exchange");
>
>     from("jms:testjms_q")
>     //from("direct:process")
>             .routeId("Receiving Route")
>             .split().tokenize(",").streaming()
>             .process(exchange -> {
>                 Long lineNumber =
> exchange.getProperty("CamelSplitIndex", Long.class);
>                 if ((lineNumber + 1) % 1000000 == 0) {
>                     exchange.getIn().getBody(String.class);
>                     log.info("streamed Line {}: {}", lineNumber + 1,
> exchange.getIn().getBody(String.class));
>                 }
>             })
>             .end()
>             .log("Finished");
>
>
>
>
> }
>


-- 
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2