Re: Camel JMS Logging question

2017-12-19 Thread Claus Ibsen
Hi

I think you can configure a custom errorHandler on the JMS endpoint /
component and there you can log only what you want. See details at
https://github.com/apache/camel/blob/master/components/camel-jms/src/main/docs/jms-component.adoc

On Tue, Dec 19, 2017 at 6:54 PM, Кристина Солдатко  wrote:
> Hi.
>
> My service use MQ and receives some data from it. When connection to MQ is
> broken - I can see in logs following situation: error report is logged as
> multiple line text like:
> December 19, 2017 5:32:47 PM UTC[Camel (camel-1) thread #0 -
> JmsConsumer[ROUTER]]
> com.ibm.msg.client.jms.internal.JmsProviderExceptionListener
> An exception has been delivered to the connection's exception listener: '
>Message :
> com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ1107: A problem with
> this connection has occurred.
> An error has occurred with the IBM MQ JMS connection.
> Use the linked exception to determine the cause of this error.
>  Class : class
> com.ibm.msg.client.jms.DetailedJMSException
>
>  and after that correct exception messages
> {"@timestamp":"2017-12-19T17:32:48.043+00:00","@version":1,"message":"Listener
> exception overridden by rollback
> exception","logger_name":"org.apache.camel.component.jms.DefaultJmsMessageListenerContainer","thread_name":"Camel
> (camel-1) thread #1 -
> JmsConsumer[ROUTER]","level":"ERROR","level_value":4,"stack_trace":"com.ibm.msg.client.jms.DetailedJMSException:
> JMSWMQ2002: Failed to get a message from destination 'ROUTER'.\n\tat
> etc
>
>
> I would like to suppress the first unedited message and receive only
> JSON-formed messages. Is it possible to configure Camel to suppress such
> crush reports?
> Thank you in advance.
> --
> Best regards, Kristina Soldatko.



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


Re: Invoke Camel Backlog Tracer

2017-12-19 Thread Claus Ibsen
Hi

If you just want to have tracing to log files, then using "trace=true"
in  is not deprecated and you can use that.


On Tue, Dec 19, 2017 at 5:09 PM, Joery Vreijsen  wrote:
> Hi There!
>
> First of all this is my first time posting in the the mailing list, so
> any feedback is appreciated.
>
> Im currently experimenting with the Backlog Tracer as we are currently
> upgrading our application to Camel 2.20.1 and the “old” Tracer is
> Deprecated.
> In the documentation (http://camel.apache.org/backlogtracer.html) i
> was looking for an example to invoke the Backlog Tracer in a Blueprint
> xml.
>
> This is what i tried (as it was working for the Tracer):
>
> 
> http://www.osgi.org/xmlns/blueprint/v1.0.0;
>xmlns:camel="http://camel.apache.org/schema/blueprint;
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
>xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
>http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd;>
>
>  class="org.apache.camel.processor.interceptor.BacklogTracer">
> 
> 
>
>  xmlns="http://camel.apache.org/schema/blueprint”>
> // Example route
> 
> 
> 
> 
> 
>
> 
>
> Unfortunately this results in the blueprint saying the BacklogTracer
> is already instantiated.
> org.osgi.service.blueprint.container.ComponentDefinitionException:
> Name backlogTracer is already instanciated as null and cannot be
> removed.
>
> Any suggestions how to enable the Backlog Tracer by default in a blueprint 
> xml?
>
> All help is appreciated!
>
> Greetings,
>
> - Joery



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


Re: Question about using Splitter

2017-12-19 Thread Tadayoshi Sato
Hi,

Instead of splitting ImageCollection as the body, I think you just need to
split List as the body.

On Wed, Dec 20, 2017 at 7:50 AM, Charles Berger <
charlesb.yesm...@googlemail.com> wrote:

> Hi,
>
> I'm building my first application using Camel and have a question
> about how to use a splitter.
>
> My route receives a serialized Java class which contains a private
> ArrayList of a POJO and getter and setter methods for the list.
>
> I convert the serialized class into a its Java representation and then
> apply it to a splitter.  What I want to get out of the Splitter is
> each individual instance of the POJOs in the List but what I get
> instead is the complete list.
>
> Here is some code to show what I mean
>
> public class ImageCollection {
>
> private List images = new ArrayList();
>
> public void setImages(List) { ... }
>
> public List getImages() { }
>
> }
>
> public class SingleImageModel {
>
> members ...
>
> getters & setters
>
> }
>
> Routes:
>
> The first route accepts a POST from a servlet, validates the incoming
> payload and converts it into an instance of ImageCollection, which is
> dispatched to the requestQueue, then returns a response to the client.
>
> from("servlet:uploadUrl")
> .log("Request: ${body}")
> .to("bean:uploadRequestQueue")
> .log("${body}")
> .marshal().json(JsonLibrary.Jackson)
> .wireTap("activemq:requestQueue")
> .to("bean:formatResponse")
> .end()
>
>
> The second route is supposed to take the ImageCollection and split it
> into the SingleImageModel instances
>
>
> from("activemq:requestQueue")
> .convertBodyTo(ImageCollection.class)
> .log("${body}")
> .split(bodyAs(ImageCollection.class))
> .log("${body}")
> .to("bean:downloadImageQueue")
> .marshal().json(JsonLibrary.Jackson)
> .to("activemq:ftpQueue");
>
> I think I need to use an Aggregator to return the individual instances
> of the SingleImageModel class from the list inside ImageCollection,
> but I can't work out what that should do.
>
> Instead, what is happening is that the bean registered for the
> downloadImageQueue is receiving an instance of ImageCollection when it
> expects an instance of SingleImageModel and the type conversion in
> that bean is failing.
>
> Any guidance much appreciated.
>
> Thanks,
>
> Charles.
>


Camel Spring boot REST xml

2017-12-19 Thread Christine Vladic
Hello,

What is the easiest way to unmarshall an XML payload to an object without 
having to explicitly create or specify the java class?

I am POCing a REST service that consumes an XML message from an older system.  
In the Camel in Action, 2nd Edition book page 93, it says I can easily use 
XStream to unmarshall from XML to Object.  However when I ran a simple test, it 
throws a com.thoughtworks.xstream.mapper.CannotResolveClassException.

Router:

@Component
public class ClaimSubmitServiceRest extends RouteBuilder {

@Value("${app.api.path}")
String contextpath;

@Override
public void configure() {

from("rest:post:submit")
.unmarshal().xstream()
.to("direct:continue");

from("direct:continue")
.log("*** Unmarshal result: " + body().toString());
}
Sample request:




   V10101
   SynchronousRequest
   
   WebPortal
   Submit
   



Thanks,
Chris


Question about using Splitter

2017-12-19 Thread Charles Berger
Hi,

I'm building my first application using Camel and have a question
about how to use a splitter.

My route receives a serialized Java class which contains a private
ArrayList of a POJO and getter and setter methods for the list.

I convert the serialized class into a its Java representation and then
apply it to a splitter.  What I want to get out of the Splitter is
each individual instance of the POJOs in the List but what I get
instead is the complete list.

Here is some code to show what I mean

public class ImageCollection {

private List images = new ArrayList();

public void setImages(List) { ... }

public List getImages() { }

}

public class SingleImageModel {

members ...

getters & setters

}

Routes:

The first route accepts a POST from a servlet, validates the incoming
payload and converts it into an instance of ImageCollection, which is
dispatched to the requestQueue, then returns a response to the client.

from("servlet:uploadUrl")
.log("Request: ${body}")
.to("bean:uploadRequestQueue")
.log("${body}")
.marshal().json(JsonLibrary.Jackson)
.wireTap("activemq:requestQueue")
.to("bean:formatResponse")
.end()


The second route is supposed to take the ImageCollection and split it
into the SingleImageModel instances


from("activemq:requestQueue")
.convertBodyTo(ImageCollection.class)
.log("${body}")
.split(bodyAs(ImageCollection.class))
.log("${body}")
.to("bean:downloadImageQueue")
.marshal().json(JsonLibrary.Jackson)
.to("activemq:ftpQueue");

I think I need to use an Aggregator to return the individual instances
of the SingleImageModel class from the list inside ImageCollection,
but I can't work out what that should do.

Instead, what is happening is that the bean registered for the
downloadImageQueue is receiving an instance of ImageCollection when it
expects an instance of SingleImageModel and the type conversion in
that bean is failing.

Any guidance much appreciated.

Thanks,

Charles.


Invoke Camel Backlog Tracer

2017-12-19 Thread Joery Vreijsen
Hi There!

First of all this is my first time posting in the the mailing list, so any 
feedback is appreciated.

Im currently experimenting with the Backlog Tracer as we are currently 
upgrading our application to Camel 2.20.1 and the “old” Tracer is Deprecated.
In the documentation (http://camel.apache.org/backlogtracer.html) i was looking 
for an example to invoke the Backlog Tracer in a Blueprint xml.

This is what i tried (as it was working for the Tracer):


http://www.osgi.org/xmlns/blueprint/v1.0.0;
           xmlns:camel="http://camel.apache.org/schema/blueprint;
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
           xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
           http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd;>

    
        
    

    http://camel.apache.org/schema/blueprint”>
        // Example route
        
            
            
        
    



Unfortunately this results in the blueprint saying the BacklogTracer is already 
instantiated.
org.osgi.service.blueprint.container.ComponentDefinitionException: Name 
backlogTracer is already instanciated as null and cannot be removed.

Any suggestions how to enable the Backlog Tracer by default in a blueprint xml?

All help is appreciated!

Greetings,

- Joery


Invoke Camel Backlog Tracer

2017-12-19 Thread Joery Vreijsen
Hi There!

First of all this is my first time posting in the the mailing list, so
any feedback is appreciated.

Im currently experimenting with the Backlog Tracer as we are currently
upgrading our application to Camel 2.20.1 and the “old” Tracer is
Deprecated.
In the documentation (http://camel.apache.org/backlogtracer.html) i
was looking for an example to invoke the Backlog Tracer in a Blueprint
xml.

This is what i tried (as it was working for the Tracer):


http://www.osgi.org/xmlns/blueprint/v1.0.0;
   xmlns:camel="http://camel.apache.org/schema/blueprint;
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
   http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd;>





http://camel.apache.org/schema/blueprint”>
// Example route








Unfortunately this results in the blueprint saying the BacklogTracer
is already instantiated.
org.osgi.service.blueprint.container.ComponentDefinitionException:
Name backlogTracer is already instanciated as null and cannot be
removed.

Any suggestions how to enable the Backlog Tracer by default in a blueprint xml?

All help is appreciated!

Greetings,

- Joery


Camel JMS Logging question

2017-12-19 Thread Кристина Солдатко
Hi.

My service use MQ and receives some data from it. When connection to MQ is
broken - I can see in logs following situation: error report is logged as
multiple line text like:
December 19, 2017 5:32:47 PM UTC[Camel (camel-1) thread #0 -
JmsConsumer[ROUTER]]
com.ibm.msg.client.jms.internal.JmsProviderExceptionListener
An exception has been delivered to the connection's exception listener: '
   Message :
com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ1107: A problem with
this connection has occurred.
An error has occurred with the IBM MQ JMS connection.
Use the linked exception to determine the cause of this error.
 Class : class
com.ibm.msg.client.jms.DetailedJMSException

 and after that correct exception messages
{"@timestamp":"2017-12-19T17:32:48.043+00:00","@version":1,"message":"Listener
exception overridden by rollback
exception","logger_name":"org.apache.camel.component.jms.DefaultJmsMessageListenerContainer","thread_name":"Camel
(camel-1) thread #1 -
JmsConsumer[ROUTER]","level":"ERROR","level_value":4,"stack_trace":"com.ibm.msg.client.jms.DetailedJMSException:
JMSWMQ2002: Failed to get a message from destination 'ROUTER'.\n\tat
etc


I would like to suppress the first unedited message and receive only
JSON-formed messages. Is it possible to configure Camel to suppress such
crush reports?
Thank you in advance.
-- 
Best regards, Kristina Soldatko.


Re: aws-s3 client is immutable when created with the builder

2017-12-19 Thread Kendall Shaw
Okay. I am building the 2.20.x branch which is using 2.20.2-SNAPSHOT for 
dependencies. Hopefully, that will work too.

Kendall

On 12/19/17, 10:30 AM, "Andrea Cosentino"  wrote:

You need to use the apache snapshot repository, but usually it's not 
aligned very well.. My suggestion is building apache camel from code and get 
the snapshot in your local repo

Inviato da Yahoo Mail su Android 
 
  Il mar, 19 dic, 2017 alle 18:20, Kendall Shaw 
ha scritto:   Thank you. How do I use the snapshot version? I’ve tried 
specifying the apache snapshot repository but maven can’t resolve 
camel-spring-boot-dependencies:pom:2.20.1-SNAPSHOT.

Kendall

From: Andrea Cosentino 
Reply-To: Andrea Cosentino 
Date: Tuesday, December 19, 2017 at 1:25 AM
To: "users@camel.apache.org" , Kendall Shaw 

Subject: Re: aws-s3 client is immutable when created with the builder

Using camel 2.21.0-SNAPSHOT and adding the credentials inside 
Application.java I don't have any kind of trouble.

[INFO] Using org.apache.camel.cdi.Main to initiate a CamelContext
[INFO] Starting Camel ...
2017-12-19 10:24:00,812 [cdi.Main.main()] INFO  Version 
   - WELD-000900: 2.4.5 (Final)
2017-12-19 10:24:00,962 [cdi.Main.main()] INFO  Bootstrap   
   - WELD-000101: Transactional services not available. Injection of @Inject 
UserTransaction not available. Transactional observers will be invoked 
synchronously.
2017-12-19 10:24:01,087 [cdi.Main.main()] INFO  Event   
   - WELD-000411: Observer method [BackedAnnotatedMethod] private 
org.apache.camel.cdi.CdiCamelExtension.processAnnotatedType(@Observes 
ProcessAnnotatedType) receives events for all annotated types. Consider 
restricting events using @WithAnnotations or a generic type with bounds.
2017-12-19 10:24:01,862 [cdi.Main.main()] INFO  CdiCamelExtension   
   - Camel CDI is starting Camel context [camel-example-aws-s3-cdi]
2017-12-19 10:24:01,863 [cdi.Main.main()] INFO  DefaultCamelContext 
   - Apache Camel 2.21.0-SNAPSHOT (CamelContext: camel-example-aws-s3-cdi) is 
starting
2017-12-19 10:24:01,865 [cdi.Main.main()] INFO  ManagedManagementStrategy   
   - JMX is enabled
2017-12-19 10:24:01,948 [cdi.Main.main()] INFO  DefaultTypeConverter
  - Type converters loaded (core: 193, classpath: 2)
2017-12-19 10:24:02,469 [cdi.Main.main()] INFO  DefaultCamelContext 
   - StreamCaching is not in use. If using streams then its recommended to 
enable stream caching. See more details at 
https://urldefense.proofpoint.com/v2/url?u=http-3A__camel.apache.org_stream-2Dcaching.html=DwIFaQ=DS6PUFBBr_KiLo7Sjt3ljp5jaW5k2i9ijVXllEdOozc=JgwnBEpN1c-DDmq-Up2QMq9rrGyfWK0KtSpT7dxRglA=hbWTuZVG0JuwSNlyeT6DHsUtwDrKjzH-lw-fiAl7xn4=_XXH6vQjznbV3h09uJcnrY3h5IQw0NF0ze-wkXlpe-E=
2017-12-19 10:24:05,319 [cdi.Main.main()] INFO  DefaultCamelContext 
   - Route: route1 started and consuming from: 
aws-s3://devvox?amazonS3Client=%23amazonS3Client=5000=false=25
2017-12-19 10:24:05,320 [cdi.Main.main()] INFO  DefaultCamelContext 
   - Total 1 routes, of which 1 are started
2017-12-19 10:24:05,320 [cdi.Main.main()] INFO  DefaultCamelContext 
   - Apache Camel 2.21.0-SNAPSHOT (CamelContext: camel-example-aws-s3-cdi) 
started in 3.458 seconds
2017-12-19 10:24:05,332 [cdi.Main.main()] INFO  Bootstrap   
   - WELD-ENV-002003: Weld SE container 89309287-1b48-4ad6-8283-bb3e4ebde462 
initialized
2017-12-19 10:24:07,203 [aws-s3://devvox] INFO  consuming   
   - Consumer Fired!
2017-12-19 10:24:07,207 [aws-s3://devvox] INFO  route1  
  - Replay Message Sent to file:s3out prova2
.
.
.


--
Andrea Cosentino
--
Apache Camel PMC Member
Apache Karaf Committer
Apache Servicemix PMC Member
Email: ancosen1...@yahoo.com
Twitter: @oscerd2
Github: oscerd


On Monday, December 18, 2017, 11:13:27 PM GMT+1, Kendall Shaw 
 wrote:


Hi,

I am trying to run the camel-example-cdi-aws-s3 example and I get an error 
that the client is immutable. I had to change the example for keys and bucket 
name. So, maybe that is where the problem is.

The modified route I use is:


from("aws-s3:my-scratch-bucket?accessKey=X=X=false=25=5000=us-west-1")

where X is the access key or secret.

I also commented out the amazonS3Client method. With the method it was 
throwing UnknownHostException about my-scratch-bucket.us-west-1.

Do you know what the problem is? Should I use an earlier version of camel?

Kendall
  




R: Re: aws-s3 client is immutable when created with the builder

2017-12-19 Thread Andrea Cosentino
You need to use the apache snapshot repository, but usually it's not aligned 
very well.. My suggestion is building apache camel from code and get the 
snapshot in your local repo

Inviato da Yahoo Mail su Android 
 
  Il mar, 19 dic, 2017 alle 18:20, Kendall Shaw ha 
scritto:   Thank you. How do I use the snapshot version? I’ve tried specifying 
the apache snapshot repository but maven can’t resolve 
camel-spring-boot-dependencies:pom:2.20.1-SNAPSHOT.

Kendall

From: Andrea Cosentino 
Reply-To: Andrea Cosentino 
Date: Tuesday, December 19, 2017 at 1:25 AM
To: "users@camel.apache.org" , Kendall Shaw 

Subject: Re: aws-s3 client is immutable when created with the builder

Using camel 2.21.0-SNAPSHOT and adding the credentials inside Application.java 
I don't have any kind of trouble.

[INFO] Using org.apache.camel.cdi.Main to initiate a CamelContext
[INFO] Starting Camel ...
2017-12-19 10:24:00,812 [cdi.Main.main()] INFO  Version                        
- WELD-000900: 2.4.5 (Final)
2017-12-19 10:24:00,962 [cdi.Main.main()] INFO  Bootstrap                      
- WELD-000101: Transactional services not available. Injection of @Inject 
UserTransaction not available. Transactional observers will be invoked 
synchronously.
2017-12-19 10:24:01,087 [cdi.Main.main()] INFO  Event                          
- WELD-000411: Observer method [BackedAnnotatedMethod] private 
org.apache.camel.cdi.CdiCamelExtension.processAnnotatedType(@Observes 
ProcessAnnotatedType) receives events for all annotated types. Consider 
restricting events using @WithAnnotations or a generic type with bounds.
2017-12-19 10:24:01,862 [cdi.Main.main()] INFO  CdiCamelExtension              
- Camel CDI is starting Camel context [camel-example-aws-s3-cdi]
2017-12-19 10:24:01,863 [cdi.Main.main()] INFO  DefaultCamelContext            
- Apache Camel 2.21.0-SNAPSHOT (CamelContext: camel-example-aws-s3-cdi) is 
starting
2017-12-19 10:24:01,865 [cdi.Main.main()] INFO  ManagedManagementStrategy      
- JMX is enabled
2017-12-19 10:24:01,948 [cdi.Main.main()] INFO  DefaultTypeConverter          - 
Type converters loaded (core: 193, classpath: 2)
2017-12-19 10:24:02,469 [cdi.Main.main()] INFO  DefaultCamelContext            
- StreamCaching is not in use. If using streams then its recommended to enable 
stream caching. See more details at http://camel.apache.org/stream-caching.html
2017-12-19 10:24:05,319 [cdi.Main.main()] INFO  DefaultCamelContext            
- Route: route1 started and consuming from: 
aws-s3://devvox?amazonS3Client=%23amazonS3Client=5000=false=25
2017-12-19 10:24:05,320 [cdi.Main.main()] INFO  DefaultCamelContext            
- Total 1 routes, of which 1 are started
2017-12-19 10:24:05,320 [cdi.Main.main()] INFO  DefaultCamelContext            
- Apache Camel 2.21.0-SNAPSHOT (CamelContext: camel-example-aws-s3-cdi) started 
in 3.458 seconds
2017-12-19 10:24:05,332 [cdi.Main.main()] INFO  Bootstrap                      
- WELD-ENV-002003: Weld SE container 89309287-1b48-4ad6-8283-bb3e4ebde462 
initialized
2017-12-19 10:24:07,203 [aws-s3://devvox] INFO  consuming                      
- Consumer Fired!
2017-12-19 10:24:07,207 [aws-s3://devvox] INFO  route1                        - 
Replay Message Sent to file:s3out prova2
.
.
.


--
Andrea Cosentino
--
Apache Camel PMC Member
Apache Karaf Committer
Apache Servicemix PMC Member
Email: ancosen1...@yahoo.com
Twitter: @oscerd2
Github: oscerd


On Monday, December 18, 2017, 11:13:27 PM GMT+1, Kendall Shaw 
 wrote:


Hi,

I am trying to run the camel-example-cdi-aws-s3 example and I get an error that 
the client is immutable. I had to change the example for keys and bucket name. 
So, maybe that is where the problem is.

The modified route I use is:

from("aws-s3:my-scratch-bucket?accessKey=X=X=false=25=5000=us-west-1")

where X is the access key or secret.

I also commented out the amazonS3Client method. With the method it was throwing 
UnknownHostException about my-scratch-bucket.us-west-1.

Do you know what the problem is? Should I use an earlier version of camel?

Kendall
  


Re: aws-s3 client is immutable when created with the builder

2017-12-19 Thread Kendall Shaw
Thank you. How do I use the snapshot version? I’ve tried specifying the apache 
snapshot repository but maven can’t resolve 
camel-spring-boot-dependencies:pom:2.20.1-SNAPSHOT.

Kendall

From: Andrea Cosentino 
Reply-To: Andrea Cosentino 
Date: Tuesday, December 19, 2017 at 1:25 AM
To: "users@camel.apache.org" , Kendall Shaw 

Subject: Re: aws-s3 client is immutable when created with the builder

Using camel 2.21.0-SNAPSHOT and adding the credentials inside Application.java 
I don't have any kind of trouble.

[INFO] Using org.apache.camel.cdi.Main to initiate a CamelContext
[INFO] Starting Camel ...
2017-12-19 10:24:00,812 [cdi.Main.main()] INFO  Version
- WELD-000900: 2.4.5 (Final)
2017-12-19 10:24:00,962 [cdi.Main.main()] INFO  Bootstrap  
- WELD-000101: Transactional services not available. Injection of @Inject 
UserTransaction not available. Transactional observers will be invoked 
synchronously.
2017-12-19 10:24:01,087 [cdi.Main.main()] INFO  Event  
- WELD-000411: Observer method [BackedAnnotatedMethod] private 
org.apache.camel.cdi.CdiCamelExtension.processAnnotatedType(@Observes 
ProcessAnnotatedType) receives events for all annotated types. Consider 
restricting events using @WithAnnotations or a generic type with bounds.
2017-12-19 10:24:01,862 [cdi.Main.main()] INFO  CdiCamelExtension  
- Camel CDI is starting Camel context [camel-example-aws-s3-cdi]
2017-12-19 10:24:01,863 [cdi.Main.main()] INFO  DefaultCamelContext
- Apache Camel 2.21.0-SNAPSHOT (CamelContext: camel-example-aws-s3-cdi) is 
starting
2017-12-19 10:24:01,865 [cdi.Main.main()] INFO  ManagedManagementStrategy  
- JMX is enabled
2017-12-19 10:24:01,948 [cdi.Main.main()] INFO  DefaultTypeConverter   
- Type converters loaded (core: 193, classpath: 2)
2017-12-19 10:24:02,469 [cdi.Main.main()] INFO  DefaultCamelContext
- StreamCaching is not in use. If using streams then its recommended to enable 
stream caching. See more details at http://camel.apache.org/stream-caching.html
2017-12-19 10:24:05,319 [cdi.Main.main()] INFO  DefaultCamelContext
- Route: route1 started and consuming from: 
aws-s3://devvox?amazonS3Client=%23amazonS3Client=5000=false=25
2017-12-19 10:24:05,320 [cdi.Main.main()] INFO  DefaultCamelContext
- Total 1 routes, of which 1 are started
2017-12-19 10:24:05,320 [cdi.Main.main()] INFO  DefaultCamelContext
- Apache Camel 2.21.0-SNAPSHOT (CamelContext: camel-example-aws-s3-cdi) started 
in 3.458 seconds
2017-12-19 10:24:05,332 [cdi.Main.main()] INFO  Bootstrap  
- WELD-ENV-002003: Weld SE container 89309287-1b48-4ad6-8283-bb3e4ebde462 
initialized
2017-12-19 10:24:07,203 [aws-s3://devvox] INFO  consuming  
- Consumer Fired!
2017-12-19 10:24:07,207 [aws-s3://devvox] INFO  route1 
- Replay Message Sent to file:s3out prova2
.
.
.


--
Andrea Cosentino
--
Apache Camel PMC Member
Apache Karaf Committer
Apache Servicemix PMC Member
Email: ancosen1...@yahoo.com
Twitter: @oscerd2
Github: oscerd


On Monday, December 18, 2017, 11:13:27 PM GMT+1, Kendall Shaw 
 wrote:


Hi,

I am trying to run the camel-example-cdi-aws-s3 example and I get an error that 
the client is immutable. I had to change the example for keys and bucket name. 
So, maybe that is where the problem is.

The modified route I use is:

from("aws-s3:my-scratch-bucket?accessKey=X=X=false=25=5000=us-west-1")

where X is the access key or secret.

I also commented out the amazonS3Client method. With the method it was throwing 
UnknownHostException about my-scratch-bucket.us-west-1.

Do you know what the problem is? Should I use an earlier version of camel?

Kendall


R: Jetty consumer responds with a 500 error java.io.IOException: Response header too large

2017-12-19 Thread Andrea Cosentino
What version of camel are you using?

Inviato da Yahoo Mail su Android 
 
  Il mar, 19 dic, 2017 alle 16:45, Laurentiu Trica 
ha scritto:   Hello,

I have a problem with the Jetty consumer. I receive a file with an attached
file (Multi-Part Form), but if the file is bigger than a few KB, I get the
bellow Stack trace. If the file is smaller, everything works fine.

The strange part is that for a size of 80KB I still receive the file in the
route, but the response to the HTTP client is:
HTTP/1.1 500 Server Error
Connection: close
Server: Jetty(9.2.14.v20151106)

If the file's size is, let's say, 2 MB, then the route doesn't get the file
anymore and the response to the client is the same.

I tried to set the request/response buffers to bigger values, but it didn't
help:
http://0.0.0.0:9086/Test?responseHeaderSize=32768000=32768000=32768000=32768000
"/>

Any ideas? Can you please help?

*Stack trace:*
2017-12-19 16:33:02,802 | WARN  | tp466415455-3362 | ServletHandler
          | 119 - org.eclipse.jetty.util - 9.2.14.v20151106 | /Test
java.io.IOException: Response header too large
at
org.eclipse.jetty.http.HttpGenerator.generateResponse(HttpGenerator.java:400)[107:org.eclipse.jetty.http:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpConnection$SendCallback.process(HttpConnection.java:655)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:246)[119:org.eclipse.jetty.util:9.2.14.v20151106]
at
org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:208)[119:org.eclipse.jetty.util:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpConnection.send(HttpConnection.java:471)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpChannel.sendResponse(HttpChannel.java:763)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpChannel.write(HttpChannel.java:801)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:147)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:140)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpOutput.flush(HttpOutput.java:242)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.apache.camel.util.IOHelper.copy(IOHelper.java:201)[59:org.apache.camel.camel-core:2.16.3]
at
org.apache.camel.http.common.DefaultHttpBinding.copyStream(DefaultHttpBinding.java:369)[143:org.apache.camel.camel-http-common:2.16.3]
at
org.apache.camel.http.common.DefaultHttpBinding.doWriteDirectResponse(DefaultHttpBinding.java:433)[143:org.apache.camel.camel-http-common:2.16.3]
at
org.apache.camel.http.common.DefaultHttpBinding.doWriteResponse(DefaultHttpBinding.java:332)[143:org.apache.camel.camel-http-common:2.16.3]
at
org.apache.camel.http.common.DefaultHttpBinding.writeResponse(DefaultHttpBinding.java:264)[143:org.apache.camel.camel-http-common:2.16.3]
at
org.apache.camel.component.jetty.CamelContinuationServlet.service(CamelContinuationServlet.java:227)[155:org.apache.camel.camel-jetty-common:2.16.3]
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:790)[54:javax.servlet-api:3.1.0]
at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[117:org.eclipse.jetty.servlet:9.2.14.v20151106]
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)[117:org.eclipse.jetty.servlet:9.2.14.v20151106]
at
org.apache.camel.component.jetty.CamelFilterWrapper.doFilter(CamelFilterWrapper.java:45)[155:org.apache.camel.camel-jetty-common:2.16.3]
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)[117:org.eclipse.jetty.servlet:9.2.14.v20151106]
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)[117:org.eclipse.jetty.servlet:9.2.14.v20151106]
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[117:org.eclipse.jetty.servlet:9.2.14.v20151106]
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.Server.handleAsync(Server.java:549)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:318)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at

Jetty consumer responds with a 500 error java.io.IOException: Response header too large

2017-12-19 Thread Laurentiu Trica
Hello,

I have a problem with the Jetty consumer. I receive a file with an attached
file (Multi-Part Form), but if the file is bigger than a few KB, I get the
bellow Stack trace. If the file is smaller, everything works fine.

The strange part is that for a size of 80KB I still receive the file in the
route, but the response to the HTTP client is:
HTTP/1.1 500 Server Error
Connection: close
Server: Jetty(9.2.14.v20151106)

If the file's size is, let's say, 2 MB, then the route doesn't get the file
anymore and the response to the client is the same.

I tried to set the request/response buffers to bigger values, but it didn't
help:
http://0.0.0.0:9086/Test?responseHeaderSize=32768000responseBufferSize=32768000requestBufferSize=32768000requestHeaderSize=32768000
"/>

Any ideas? Can you please help?

*Stack trace:*
2017-12-19 16:33:02,802 | WARN  | tp466415455-3362 | ServletHandler
   | 119 - org.eclipse.jetty.util - 9.2.14.v20151106 | /Test
java.io.IOException: Response header too large
at
org.eclipse.jetty.http.HttpGenerator.generateResponse(HttpGenerator.java:400)[107:org.eclipse.jetty.http:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpConnection$SendCallback.process(HttpConnection.java:655)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:246)[119:org.eclipse.jetty.util:9.2.14.v20151106]
at
org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:208)[119:org.eclipse.jetty.util:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpConnection.send(HttpConnection.java:471)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpChannel.sendResponse(HttpChannel.java:763)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpChannel.write(HttpChannel.java:801)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:147)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:140)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpOutput.flush(HttpOutput.java:242)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.apache.camel.util.IOHelper.copy(IOHelper.java:201)[59:org.apache.camel.camel-core:2.16.3]
at
org.apache.camel.http.common.DefaultHttpBinding.copyStream(DefaultHttpBinding.java:369)[143:org.apache.camel.camel-http-common:2.16.3]
at
org.apache.camel.http.common.DefaultHttpBinding.doWriteDirectResponse(DefaultHttpBinding.java:433)[143:org.apache.camel.camel-http-common:2.16.3]
at
org.apache.camel.http.common.DefaultHttpBinding.doWriteResponse(DefaultHttpBinding.java:332)[143:org.apache.camel.camel-http-common:2.16.3]
at
org.apache.camel.http.common.DefaultHttpBinding.writeResponse(DefaultHttpBinding.java:264)[143:org.apache.camel.camel-http-common:2.16.3]
at
org.apache.camel.component.jetty.CamelContinuationServlet.service(CamelContinuationServlet.java:227)[155:org.apache.camel.camel-jetty-common:2.16.3]
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:790)[54:javax.servlet-api:3.1.0]
at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)[117:org.eclipse.jetty.servlet:9.2.14.v20151106]
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)[117:org.eclipse.jetty.servlet:9.2.14.v20151106]
at
org.apache.camel.component.jetty.CamelFilterWrapper.doFilter(CamelFilterWrapper.java:45)[155:org.apache.camel.camel-jetty-common:2.16.3]
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)[117:org.eclipse.jetty.servlet:9.2.14.v20151106]
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)[117:org.eclipse.jetty.servlet:9.2.14.v20151106]
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[117:org.eclipse.jetty.servlet:9.2.14.v20151106]
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.Server.handleAsync(Server.java:549)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:318)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)[116:org.eclipse.jetty.server:9.2.14.v20151106]
at
org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)[108:org.eclipse.jetty.io:9
.2.14.v20151106]
at

Re: aws-s3 client is immutable when created with the builder

2017-12-19 Thread Andrea Cosentino
Using camel 2.21.0-SNAPSHOT and adding the credentials inside Application.java 
I don't have any kind of trouble.
[INFO] Using org.apache.camel.cdi.Main to initiate a CamelContext[INFO] 
Starting Camel ...2017-12-19 10:24:00,812 [cdi.Main.main()] INFO  Version       
                 - WELD-000900: 2.4.5 (Final)2017-12-19 10:24:00,962 
[cdi.Main.main()] INFO  Bootstrap                      - WELD-000101: 
Transactional services not available. Injection of @Inject UserTransaction not 
available. Transactional observers will be invoked synchronously.2017-12-19 
10:24:01,087 [cdi.Main.main()] INFO  Event                          - 
WELD-000411: Observer method [BackedAnnotatedMethod] private 
org.apache.camel.cdi.CdiCamelExtension.processAnnotatedType(@Observes 
ProcessAnnotatedType) receives events for all annotated types. Consider 
restricting events using @WithAnnotations or a generic type with 
bounds.2017-12-19 10:24:01,862 [cdi.Main.main()] INFO  CdiCamelExtension        
      - Camel CDI is starting Camel context 
[camel-example-aws-s3-cdi]2017-12-19 10:24:01,863 [cdi.Main.main()] INFO  
DefaultCamelContext            - Apache Camel 2.21.0-SNAPSHOT (CamelContext: 
camel-example-aws-s3-cdi) is starting2017-12-19 10:24:01,865 [cdi.Main.main()] 
INFO  ManagedManagementStrategy      - JMX is enabled2017-12-19 10:24:01,948 
[cdi.Main.main()] INFO  DefaultTypeConverter           - Type converters loaded 
(core: 193, classpath: 2)2017-12-19 10:24:02,469 [cdi.Main.main()] INFO  
DefaultCamelContext            - StreamCaching is not in use. If using streams 
then its recommended to enable stream caching. See more details at 
http://camel.apache.org/stream-caching.html2017-12-19 10:24:05,319 
[cdi.Main.main()] INFO  DefaultCamelContext            - Route: route1 started 
and consuming from: 
aws-s3://devvox?amazonS3Client=%23amazonS3Client=5000=false=252017-12-19
 10:24:05,320 [cdi.Main.main()] INFO  DefaultCamelContext            - Total 1 
routes, of which 1 are started2017-12-19 10:24:05,320 [cdi.Main.main()] INFO  
DefaultCamelContext            - Apache Camel 2.21.0-SNAPSHOT (CamelContext: 
camel-example-aws-s3-cdi) started in 3.458 seconds2017-12-19 10:24:05,332 
[cdi.Main.main()] INFO  Bootstrap                      - WELD-ENV-002003: Weld 
SE container 89309287-1b48-4ad6-8283-bb3e4ebde462 initialized2017-12-19 
10:24:07,203 [aws-s3://devvox] INFO  consuming                      - Consumer 
Fired!2017-12-19 10:24:07,207 [aws-s3://devvox] INFO  route1                    
     - Replay Message Sent to file:s3out prova2...

--Andrea Cosentino --Apache Camel PMC 
MemberApache Karaf CommitterApache Servicemix PMC MemberEmail: 
ancosen1985@yahoo.comTwitter: @oscerd2Github: oscerd 

On Monday, December 18, 2017, 11:13:27 PM GMT+1, Kendall Shaw 
 wrote:  
 
 Hi,

I am trying to run the camel-example-cdi-aws-s3 example and I get an error that 
the client is immutable. I had to change the example for keys and bucket name. 
So, maybe that is where the problem is.

The modified route I use is:

from("aws-s3:my-scratch-bucket?accessKey=X=X=false=25=5000=us-west-1")

where X is the access key or secret.

I also commented out the amazonS3Client method. With the method it was throwing 
UnknownHostException about my-scratch-bucket.us-west-1.

Do you know what the problem is? Should I use an earlier version of camel?

Kendall