Re: FTP not streaming to JMS

2024-02-06 Thread Claus Ibsen
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  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 
> 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
>> :?filename=SmallFile.data=true=true=false")
>> from("ftp:admin:admin@localhost
>> :?filename=BigFile.data=true=true=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) % 100 == 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

2024-02-05 Thread Claus Ibsen
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 
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
> :?filename=SmallFile.data=true=true=false")
> from("ftp:admin:admin@localhost
> :?filename=BigFile.data=true=true=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) % 100 == 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


FTP not streaming to JMS

2024-02-05 Thread Michael Rambichler
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:?filename=SmallFile.data=true=true=false")

from("ftp:admin:admin@localhost:?filename=BigFile.data=true=true=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) % 100 == 0) {
exchange.getIn().getBody(String.class);
log.info("streamed Line {}: {}", lineNumber + 1,
exchange.getIn().getBody(String.class));
}
})
.end()
.log("Finished");




}