Re: How does Apache Camel (un)marshal with 'gzipDeflater' work?

2024-02-06 Thread Claus Ibsen
Hi

The doc is outdated, you need to have camel-zip-deflater JAR

On Tue, Feb 6, 2024 at 3:57 PM Quirin Ertl 
wrote:

> In this code snippet I want to unzip a gzip body using Camel. According to
> the Camel documentation, no other dependencies are needed apart from
> camel-core.
>
> Link:
> https://camel.apache.org/components/4.0.x/dataformats/gzipDeflater-dataformat.html#_dependencies
>
>
> public static void main(final String[] args) throws Exception {
> try (final CamelContext context = new DefaultCamelContext()) {
> context.addRoutes(new RouteBuilder() {
> @Override
> public void configure() {
>
> this.from("direct:test").unmarshal().gzipDeflater().to("seda:test2");
> }
> });
> context.start();
> context.createProducerTemplate().sendBody("direct:test", "this is
> not gzip but it does not matter.");
> Thread.currentThread().join();
> }
> }
>
>
> When I run the code I get this error:
>
> Caused by: java.lang.IllegalArgumentException: Data format 'gzipDeflater'
> could not be created. Ensure that the data format is valid and the
> associated Camel component is present on the classpath
> at
> org.apache.camel.reifier.dataformat.DataFormatReifier.createDataFormat(DataFormatReifier.java:279)
> at
> org.apache.camel.reifier.dataformat.DataFormatReifier.getDataFormat(DataFormatReifier.java:152)
> at
> org.apache.camel.reifier.dataformat.DataFormatReifier.getDataFormat(DataFormatReifier.java:112)
> at
> org.apache.camel.reifier.UnmarshalReifier.createProcessor(UnmarshalReifier.java:35)
> at
> org.apache.camel.reifier.ProcessorReifier.makeProcessor(ProcessorReifier.java:870)
> at
> org.apache.camel.reifier.ProcessorReifier.addRoutes(ProcessorReifier.java:610)
> at
> org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:213)
> ... 11 more
>
> The error message says I need another dependency, but the Camel
> documentation says I don't need one. How is this supposed to work?
>
>
>

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


Re: Camel 4.3.0 and OpenTelemetry - nothing happens

2024-02-06 Thread David Ecker

OK,

after retrying the example and creating everything from scratch - it 
works now. Was a layer 8 problem.


Thanks,
David

On 2/6/24 16:10, David Ecker wrote:

Hi,

yes, that's exactly where I got the FlightBook example from.

bye
David

On 2/6/24 16:05, Federico Mariani wrote:

Hi, did you check this example
 


?

Il giorno mar 6 feb 2024 alle ore 16:02 David Ecker 


ha scritto:


Hi,

I tried several combinations in a small mock project, but no otel trace
is being sent anywhere. Does anybody know what I am doing wrong?!? I am
somehow at loss here. Could somebody help me, please.

-- pom.xml ---


 org.apache.camel.springboot
camel-opentelemetry-starter
4.3.0 



-- app.java --


@CamelOpenTelemetry @SpringBootApplication public class
OtelCamelTest02Application {

  public static void main(String[] args) {
SpringApplication.run(OtelCamelTest02Application.class, args);
  }

}




-- Route.java --


@Component public class Route01extends RouteBuilder {
  @Override public void configure()throws Exception {
  from("timer://foo?delay=5000")
  .to("log:test");
  }
}




I played with different setting of:

camel.opentelemetry.enabled=true camel.springboot.use-mdc-logging=true
otel.traces.exporter=otel otel.service.name=HelloWorld
otel.exporter.otlp.endpoint=http://127.0.0.1:4317 otel.log.level=debug

nothing

I also added the java agent manually - then only thing I can change is
the log message:

MDC logging is enabled on CamelContext: camel-1
OpenTelemetryTracer enabled using instrumentation-name: camel

So disabeling mdc will remove the first log line.

I also tried the example project FlightBooking from the github repo
camel-spring-boot-examples - nope, did not work either.

I also checked using tcpdump trying to capture those traces - nothing.

Thank you,
David









OpenPGP_0x9D91B831B345A721.asc
Description: OpenPGP public key


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: Camel 4.3.0 and OpenTelemetry - nothing happens

2024-02-06 Thread David Ecker

Hi,

yes, that's exactly where I got the FlightBook example from.

bye
David

On 2/6/24 16:05, Federico Mariani wrote:

Hi, did you check this example

?

Il giorno mar 6 feb 2024 alle ore 16:02 David Ecker 
ha scritto:


Hi,

I tried several combinations in a small mock project, but no otel trace
is being sent anywhere. Does anybody know what I am doing wrong?!? I am
somehow at loss here. Could somebody help me, please.

-- pom.xml ---


 org.apache.camel.springboot
camel-opentelemetry-starter
4.3.0 



-- app.java --


@CamelOpenTelemetry @SpringBootApplication public class
OtelCamelTest02Application {

  public static void main(String[] args) {
  SpringApplication.run(OtelCamelTest02Application.class, args);
  }

}




-- Route.java --


@Component public class Route01extends RouteBuilder {
  @Override public void configure()throws Exception {
  from("timer://foo?delay=5000")
  .to("log:test");
  }
}




I played with different setting of:

camel.opentelemetry.enabled=true camel.springboot.use-mdc-logging=true
otel.traces.exporter=otel otel.service.name=HelloWorld
otel.exporter.otlp.endpoint=http://127.0.0.1:4317 otel.log.level=debug

nothing

I also added the java agent manually - then only thing I can change is
the log message:

MDC logging is enabled on CamelContext: camel-1
OpenTelemetryTracer enabled using instrumentation-name: camel

So disabeling mdc will remove the first log line.

I also tried the example project FlightBooking from the github repo
camel-spring-boot-examples - nope, did not work either.

I also checked using tcpdump trying to capture those traces - nothing.

Thank you,
David







OpenPGP_0x9D91B831B345A721.asc
Description: OpenPGP public key


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: Camel 4.3.0 and OpenTelemetry - nothing happens

2024-02-06 Thread Federico Mariani
Hi, did you check this example

?

Il giorno mar 6 feb 2024 alle ore 16:02 David Ecker 
ha scritto:

> Hi,
>
> I tried several combinations in a small mock project, but no otel trace
> is being sent anywhere. Does anybody know what I am doing wrong?!? I am
> somehow at loss here. Could somebody help me, please.
>
> -- pom.xml ---
> 
>
>  org.apache.camel.springboot
> camel-opentelemetry-starter
> 4.3.0 
>
> 
>
> -- app.java --
> 
>
> @CamelOpenTelemetry @SpringBootApplication public class
> OtelCamelTest02Application {
>
>  public static void main(String[] args) {
>  SpringApplication.run(OtelCamelTest02Application.class, args);
>  }
>
> }
>
> 
>
>
> -- Route.java --
> 
>
> @Component public class Route01extends RouteBuilder {
>  @Override public void configure()throws Exception {
>  from("timer://foo?delay=5000")
>  .to("log:test");
>  }
> }
>
> 
>
>
> I played with different setting of:
>
> camel.opentelemetry.enabled=true camel.springboot.use-mdc-logging=true
> otel.traces.exporter=otel otel.service.name=HelloWorld
> otel.exporter.otlp.endpoint=http://127.0.0.1:4317 otel.log.level=debug
>
> nothing
>
> I also added the java agent manually - then only thing I can change is
> the log message:
>
> MDC logging is enabled on CamelContext: camel-1
> OpenTelemetryTracer enabled using instrumentation-name: camel
>
> So disabeling mdc will remove the first log line.
>
> I also tried the example project FlightBooking from the github repo
> camel-spring-boot-examples - nope, did not work either.
>
> I also checked using tcpdump trying to capture those traces - nothing.
>
> Thank you,
> David
>
>
>


Camel 4.3.0 and OpenTelemetry - nothing happens

2024-02-06 Thread David Ecker

Hi,

I tried several combinations in a small mock project, but no otel trace 
is being sent anywhere. Does anybody know what I am doing wrong?!? I am 
somehow at loss here. Could somebody help me, please.


-- pom.xml ---


 org.apache.camel.springboot 
camel-opentelemetry-starter 4.3.0 



-- app.java --


@CamelOpenTelemetry @SpringBootApplication public class 
OtelCamelTest02Application {

public static void main(String[] args) {
SpringApplication.run(OtelCamelTest02Application.class, args);
}

}




-- Route.java --


@Component public class Route01extends RouteBuilder {
@Override public void configure()throws Exception {
from("timer://foo?delay=5000")
.to("log:test");
}
}




I played with different setting of:

camel.opentelemetry.enabled=true camel.springboot.use-mdc-logging=true 
otel.traces.exporter=otel otel.service.name=HelloWorld 
otel.exporter.otlp.endpoint=http://127.0.0.1:4317 otel.log.level=debug


nothing

I also added the java agent manually - then only thing I can change is 
the log message:


MDC logging is enabled on CamelContext: camel-1
OpenTelemetryTracer enabled using instrumentation-name: camel

So disabeling mdc will remove the first log line.

I also tried the example project FlightBooking from the github repo 
camel-spring-boot-examples - nope, did not work either.


I also checked using tcpdump trying to capture those traces - nothing.

Thank you,
David




OpenPGP_0x9D91B831B345A721.asc
Description: OpenPGP public key


OpenPGP_signature.asc
Description: OpenPGP digital signature


Re: How does Apache Camel (un)marshal with 'gzipDeflater' work?

2024-02-06 Thread Andrea Cosentino
I guess it's an error in documentation.

Il mar 6 feb 2024, 15:57 Quirin Ertl  ha
scritto:

> In this code snippet I want to unzip a gzip body using Camel. According to
> the Camel documentation, no other dependencies are needed apart from
> camel-core.
>
> Link:
> https://camel.apache.org/components/4.0.x/dataformats/gzipDeflater-dataformat.html#_dependencies
>
>
> public static void main(final String[] args) throws Exception {
> try (final CamelContext context = new DefaultCamelContext()) {
> context.addRoutes(new RouteBuilder() {
> @Override
> public void configure() {
>
> this.from("direct:test").unmarshal().gzipDeflater().to("seda:test2");
> }
> });
> context.start();
> context.createProducerTemplate().sendBody("direct:test", "this is
> not gzip but it does not matter.");
> Thread.currentThread().join();
> }
> }
>
>
> When I run the code I get this error:
>
> Caused by: java.lang.IllegalArgumentException: Data format 'gzipDeflater'
> could not be created. Ensure that the data format is valid and the
> associated Camel component is present on the classpath
> at
> org.apache.camel.reifier.dataformat.DataFormatReifier.createDataFormat(DataFormatReifier.java:279)
> at
> org.apache.camel.reifier.dataformat.DataFormatReifier.getDataFormat(DataFormatReifier.java:152)
> at
> org.apache.camel.reifier.dataformat.DataFormatReifier.getDataFormat(DataFormatReifier.java:112)
> at
> org.apache.camel.reifier.UnmarshalReifier.createProcessor(UnmarshalReifier.java:35)
> at
> org.apache.camel.reifier.ProcessorReifier.makeProcessor(ProcessorReifier.java:870)
> at
> org.apache.camel.reifier.ProcessorReifier.addRoutes(ProcessorReifier.java:610)
> at
> org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:213)
> ... 11 more
>
> The error message says I need another dependency, but the Camel
> documentation says I don't need one. How is this supposed to work?
>
>
>


How does Apache Camel (un)marshal with 'gzipDeflater' work?

2024-02-06 Thread Quirin Ertl
In this code snippet I want to unzip a gzip body using Camel. According to the 
Camel documentation, no other dependencies are needed apart from camel-core.

Link: 
https://camel.apache.org/components/4.0.x/dataformats/gzipDeflater-dataformat.html#_dependencies


public static void main(final String[] args) throws Exception {
try (final CamelContext context = new DefaultCamelContext()) {
context.addRoutes(new RouteBuilder() {
@Override
public void configure() {

this.from("direct:test").unmarshal().gzipDeflater().to("seda:test2");
}
});
context.start();
context.createProducerTemplate().sendBody("direct:test", "this is not 
gzip but it does not matter.");
Thread.currentThread().join();
}
}


When I run the code I get this error:

Caused by: java.lang.IllegalArgumentException: Data format 'gzipDeflater' could 
not be created. Ensure that the data format is valid and the associated Camel 
component is present on the classpath
at 
org.apache.camel.reifier.dataformat.DataFormatReifier.createDataFormat(DataFormatReifier.java:279)
at 
org.apache.camel.reifier.dataformat.DataFormatReifier.getDataFormat(DataFormatReifier.java:152)
at 
org.apache.camel.reifier.dataformat.DataFormatReifier.getDataFormat(DataFormatReifier.java:112)
at 
org.apache.camel.reifier.UnmarshalReifier.createProcessor(UnmarshalReifier.java:35)
at 
org.apache.camel.reifier.ProcessorReifier.makeProcessor(ProcessorReifier.java:870)
at 
org.apache.camel.reifier.ProcessorReifier.addRoutes(ProcessorReifier.java:610)
at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:213)
... 11 more

The error message says I need another dependency, but the Camel documentation 
says I don't need one. How is this supposed to work?




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