Re: npe in camel 2.9.1 validator

2012-03-07 Thread Preben.Asmussen
Found the course of the problem. See
https://issues.apache.org/jira/browse/CAMEL-5063 update.

/preben

--
View this message in context: 
http://camel.465427.n5.nabble.com/npe-in-camel-2-9-1-validator-tp5540894p5546656.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Propogate CXF Exception to Camel

2012-03-07 Thread Jean-Baptiste Onofré

Hi guys,

maybe it doesn't help, but I used two routes like this:

from cxf -> to jms
from jms -> to cxf

and to "transport" the exception from the "to cxf" to the "from cxf", I 
added the transferException=true on the two JMS endpoints.


Regards
JB

On 03/08/2012 08:32 AM, Willem Jiang wrote:

Hi Yogesh,

What kind of custom interceptor are you using?

By adding the synchronous=true parameter, camel-cxf will not use the
async invocation which is used by default to invoke the server.



On 3/7/12 10:58 PM, ychawla wrote:

Hi Aki,
I do have a one-way service. I added the 'synchronous=true' to the
endpoint
and now it is throwing the error without using my custom interceptor.
Will
setting this attribute affect other behavior of the one-way service?

Thanks,
Yogesh

--
View this message in context:
http://camel.465427.n5.nabble.com/Propogate-CXF-Exception-to-Camel-tp5491102p5544347.html

Sent from the Camel - Users mailing list archive at Nabble.com.






--
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com


Re: Propogate CXF Exception to Camel

2012-03-07 Thread Willem Jiang

Hi Yogesh,

What kind of custom interceptor are you using?

By adding the synchronous=true parameter, camel-cxf will not use the 
async invocation which is used by default to invoke the server.




On 3/7/12 10:58 PM, ychawla wrote:

Hi Aki,
I do have a one-way service.  I added the 'synchronous=true' to the endpoint
and now it is throwing the error without using my custom interceptor.  Will
setting this attribute affect other behavior of the one-way service?

Thanks,
Yogesh

--
View this message in context: 
http://camel.465427.n5.nabble.com/Propogate-CXF-Exception-to-Camel-tp5491102p5544347.html
Sent from the Camel - Users mailing list archive at Nabble.com.




--
Willem
--
FuseSource
Web: http://www.fusesource.com
Blog:http://willemjiang.blogspot.com (English)
 http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang


Re: Need help to load csv into database

2012-03-07 Thread Willem Jiang
I think you can user the bean to do the below job yourself. 
	





You just need to read the message body an split the message, put it 
into sql parameter and call the jdbc yourself.


On Thu Mar  8 06:02:23 2012, brbornia wrote:

Hello guys,

I'm just starting with camel, so sorry to bother you with a must likely
dummy question.

I am trying to load a csv file into database with something like this:

http://camel.apache.org/schema/spring";>
 com.test.integration.camel.spring.poc
 







 


And I know that will not work because I separated the csv line into several
messages when what I want is simple convert that line to an array or
something like that, but I just do not know how to do it.

A friend told me how to do it converting the csv lines into beans and
inserting them with JPA, but since I will be loading huge csv files very
often, I am concerned about unnecessary memory and processing use, so I
would like to do it without creating several objects.

Can you please help me?

Thank you in advance,
Bruno

--
View this message in context: 
http://camel.465427.n5.nabble.com/Need-help-to-load-csv-into-database-tp5545754p5545754.html
Sent from the Camel - Users mailing list archive at Nabble.com.





--
Willem
--
FuseSource
Web: http://www.fusesource.com
Blog:http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang 
Weibo: willemjiang 



Re: how to specify which method when calling a direct route?

2012-03-07 Thread Claus Ibsen
Hi

What version of Camel are you using?

And what does your direct route look like?

Setting a header with the key "CamelBeanMethodName" ought to take
precedence on the name of the method to invoke.
eg the key name is from a constant on Exchange.BEAN_METHOD_NAME

You can enable and use the tracer to see what the message contains
when being routed, to see the header is present when it hit the bean
http://camel.apache.org/tracer


On Wed, Mar 7, 2012 at 8:21 PM, codemonkey73
 wrote:
> We've built a small directory of services (POJOs) for which we have built
> direct to bean routes.  They've worked so far when using a ProducerTemplate
> to call the direct route.  To specify the method when using
> ProducerTemplate, we use requestBodyAndHeader("direct:myService",
> [methodparameterOrNull], "CamelBeanMethodName", "myServiceMethodSignature").
>
> Now I'm trying to call these services from an established web project which
> doesn't use spring or camel. I'm trying to minimize the changes to that
> project and keep spring and camel out, so I thought I would try to set up a
> servlet route in the Camel project, and then route that servlet call to the
> services directory via a direct route.  The simple servlet routing is
> working, but what I can't figure out is the routing from the servlet to the
> existing direct routes of the services.
>
> I've tried variations of the following:
>
> from("servlet:///servletRouteMapping").
> setHeader("CamelBeanMethodName", constant("myServiceMethodSignature")).
> to("direct:myService");
>
> The response my client gets is 'Not Implemented Yet'.
>
> I was planning on using different servlet mappings and routes for each of
> the methods of the service.
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/how-to-specify-which-method-when-calling-a-direct-route-tp5545275p5545275.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/


Re: npe in camel 2.9.1 validator

2012-03-07 Thread Willem.Jiang
If you put the schema into the test/resources directory, it will not be
wrapped into the more jar.
You may need to add the test jar dependency like this

com.example
my-artifact
test-jar
test

Willem

--
View this message in context: 
http://camel.465427.n5.nabble.com/npe-in-camel-2-9-1-validator-tp5540894p5546609.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: SMTP: sending file binary as attachment corrupted

2012-03-07 Thread _d
Thanks
it's working fine, with this code

public void process(Exchange ex) throws Exception {
{
String fileNameWritten = (String) ex.getIn().getHeader(
"CamelFilePath", String.class);
String fileName = (String) ex.getIn().getHeader(
Exchange.FILE_NAME_ONLY, String.class); 
ex.getIn().setBody(fileName);
ex.getIn().addAttachment(fileName,
new DataHandler((new 
FileDataSource(fileNameWritten;
}


--
View this message in context: 
http://camel.465427.n5.nabble.com/SMTP-sending-file-binary-as-attachment-corrupted-tp5543701p5545931.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Activemq for high performance and scalable use.

2012-03-07 Thread Björn Bength
Hi Omar
It depends on in what time-span you expect those 25 requests, and
what latency you can tolerate.
If all your requests are spread over 24 hours, you have no worries at
all. You can choose whatever.
When you you start getting 25 per hour, you can start thinking
about moving your app from your laptop to a dedicated server or
upgrade to a an SSD disk.
If you need lower latency choose kahadb and maybe a couple of extra producers.
Good luck



On Wed, Mar 7, 2012 at 11:50 AM, Omar Atia  wrote:
> I'm using it in camel-context :).
>
> 
> From: Claus Ibsen [claus.ib...@gmail.com]
> Sent: Wednesday, March 07, 2012 12:29 PM
> To: users@camel.apache.org
> Subject: Re: Activemq for high performance and scalable use.
>
> Hi
>
> This is the mailing list for Apache Camel.
> Can you please use the mailing list for Apache ActiveMQ for your AMQ 
> questions.
>
>
> On Wed, Mar 7, 2012 at 8:52 AM, Omar Atia  wrote:
>> Dear Ashwin ,
>>
>> The XML message size is less than 2000 bytes , we have already four channels 
>> to send messages in parallel to mina-tcp then to activemq channel.
>>
>> Can you help with default configurations?
>>
>> from the below http://activemq.apache.org/kahadb.html , In messages for sure 
>> and asynch.
>>
>> can we configure threads for activemq ? increase no of threads to handle 
>> 20 request?
>>
>> thanks,
>>
>> Omar Atia
>> 
>> From: Ashwin Karpe [aka...@fusesource.com]
>> Sent: Wednesday, March 07, 2012 2:28 AM
>> To: users@camel.apache.org
>> Subject: Re: Activemq for high performance and scalable use.
>>
>> Hi,
>>
>> Using a relational store is definitely slower than KahaDB. KahaDB is a store
>> that employs indexing & has a high speed journal to deal with efficient
>> access to stored messages. The relational layer is more expensive due to the
>> cost of SQL lookups & persistence...
>>
>> However your requirement (25 msgs daily, msg size ?), just based on
>> number of messages does not seem out of the ordinary using either option
>> (unless there is something about msg size that I do not see). KahaDB is
>> easily the better and faster approach...
>>
>> Hope this helps.
>>
>> Cheers,
>>
>> Ashwin...
>>
>> -
>> -
>> Ashwin Karpe
>> Apache Camel Committer & Sr Principal Consultant
>> FUSESource (a Progress Software Corporation subsidiary)
>> http://fusesource.com
>>
>> Blog: http://opensourceknowledge.blogspot.com
>> -
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/Activemq-for-high-performance-and-scalable-use-tp5541877p5542771.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -
> FuseSource
> Email: cib...@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/


Re: Suspend route; what about the current exchange

2012-03-07 Thread Claus Ibsen
On Wed, Mar 7, 2012 at 11:33 PM, jmh  wrote:
> Hello,
>
> suppose I suspend a route starting with a jms consumer.
>
> My question : is the current exchange also stopped/suspended or is still
> processed until it reaches gracefully the end of the route ?
>

When suspending its the intake of *new* messages that gets suspended.
Current in-flight messages is still being processed.


> Thanks for your help
>
> Regards
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Suspend-route-what-about-the-current-exchange-tp5545837p5545837.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/


Suspend route; what about the current exchange

2012-03-07 Thread jmh
Hello,

suppose I suspend a route starting with a jms consumer.

My question : is the current exchange also stopped/suspended or is still
processed until it reaches gracefully the end of the route ?

Thanks for your help

Regards

--
View this message in context: 
http://camel.465427.n5.nabble.com/Suspend-route-what-about-the-current-exchange-tp5545837p5545837.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Apache Camel >> Netty

2012-03-07 Thread sambardar
What i see is that the URL  gets screwed in producer template. In the
exception you can see URL as

netty://tcp://localhost:1521?sync=true

whereas it should have been netty:tcp://localhost:1521?sync=true

--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Camel-Netty-tp5545678p5545794.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Apache Camel >> Netty

2012-03-07 Thread sambardar
Camel 2.9.0

--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Camel-Netty-tp5545678p5545791.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Need help to load csv into database

2012-03-07 Thread brbornia
Hello guys,

I'm just starting with camel, so sorry to bother you with a must likely
dummy question.

I am trying to load a csv file into database with something like this:

http://camel.apache.org/schema/spring";>
com.test.integration.camel.spring.poc











And I know that will not work because I separated the csv line into several
messages when what I want is simple convert that line to an array or
something like that, but I just do not know how to do it.

A friend told me how to do it converting the csv lines into beans and
inserting them with JPA, but since I will be loading huge csv files very
often, I am concerned about unnecessary memory and processing use, so I
would like to do it without creating several objects.

Can you please help me?

Thank you in advance,
Bruno 

--
View this message in context: 
http://camel.465427.n5.nabble.com/Need-help-to-load-csv-into-database-tp5545754p5545754.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Processor to xpath

2012-03-07 Thread Claus Ibsen
On Wed, Mar 7, 2012 at 10:48 PM, byoung4877  wrote:
> Hi, Please Help!! I'm pretty new to camel so bear that in mind. I'm trying to
> inject a header in to a message from a Processor I've implemented. However,
> when I run I keep getting this:
>
>  [Fatal Error] :1:1: Content is not allowed in prolog."
>

This kind of error is from the XML parser that says the message is not
valid XML. eg the message should have that XML header in the top, with


So when the message is evaluated as an XML using the xpath expression
it will fail.
Are you sure its an XML message?

Instead of  you can use  to evaluate a header

${header.fileAccepted} == true



> Below is my camel context:
>
>  class="com.foobar.BillingRequestProcessor"/>
>  xmlns="http://camel.apache.org/schema/spring";>
> 
>  
>  
>  
>    
>      $fileAccepted = 'true'
>        
>    
>    
>        
>    
>  
> 
> 
>
> And in BillingRequestProcessor I am doing some processing resulting in:
>
> @Override
> public void process(Exchange exchange) throws Exception {
>  Map headers = exchange.getIn().getHeaders();
>  headers.put("fileAccepted", "true");
>  exchange.getIn().setHeaders(headers);
> }
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Processor-to-xpath-tp5545719p5545719.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/


Processor to xpath

2012-03-07 Thread byoung4877
Hi, Please Help!! I'm pretty new to camel so bear that in mind. I'm trying to
inject a header in to a message from a Processor I've implemented. However,
when I run I keep getting this:

 [Fatal Error] :1:1: Content is not allowed in prolog."

Below is my camel context:


http://camel.apache.org/schema/spring";>

  
  
  

  $fileAccepted = 'true'





  



And in BillingRequestProcessor I am doing some processing resulting in:

@Override
public void process(Exchange exchange) throws Exception {
  Map headers = exchange.getIn().getHeaders();
  headers.put("fileAccepted", "true");
  exchange.getIn().setHeaders(headers);
}

--
View this message in context: 
http://camel.465427.n5.nabble.com/Processor-to-xpath-tp5545719p5545719.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Apache Camel >> Netty

2012-03-07 Thread Claus Ibsen
Hi

What version of Camel are you using?


On Wed, Mar 7, 2012 at 10:35 PM, sambardar  wrote:
> First time Camel User and trying to use Netty Component. I was running some
> of the sample code from Netty test in my own classes and got an exception
> from this statement. I am looking at it to figure out the problem but i do
> appreciate any help.
>
> Poetry response = (Poetry)
> producerTemplate.requestBody("netty:tcp://localhost:1521?sync=true",
> poetry);
>
> The exception is:
> Exception in thread "main" org.apache.camel.ResolveEndpointFailedException:
> Failed to resolve endpoint: netty://tcp://localhost:1521?sync=true due to:
> timer must be specified
>        at
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:450)
>        at
> org.apache.camel.impl.DefaultProducerTemplate.resolveMandatoryEndpoint(DefaultProducerTemplate.java:424)
>        at
> org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:135)
>        at
> org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:284)
>        at
> com.xih.mediation.SyncTest.testTCPObjectInOutWithNettyConsumer(SyncTest.java:71)
>        at com.xih.mediation.SyncTest.main(SyncTest.java:101)
> Caused by: java.lang.IllegalArgumentException: timer must be specified
>        at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:280)
>        at
> org.apache.camel.component.netty.NettyEndpoint.doStart(NettyEndpoint.java:83)
>        at 
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
> org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:1675)
>        at
> org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:910)
>        at
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:446)
>        ... 5 more
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Apache-Camel-Netty-tp5545678p5545678.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/


Apache Camel >> Netty

2012-03-07 Thread sambardar
First time Camel User and trying to use Netty Component. I was running some
of the sample code from Netty test in my own classes and got an exception
from this statement. I am looking at it to figure out the problem but i do
appreciate any help.

Poetry response = (Poetry)
producerTemplate.requestBody("netty:tcp://localhost:1521?sync=true",
poetry);

The exception is:
Exception in thread "main" org.apache.camel.ResolveEndpointFailedException:
Failed to resolve endpoint: netty://tcp://localhost:1521?sync=true due to:
timer must be specified
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:450)
at
org.apache.camel.impl.DefaultProducerTemplate.resolveMandatoryEndpoint(DefaultProducerTemplate.java:424)
at
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:135)
at
org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:284)
at
com.xih.mediation.SyncTest.testTCPObjectInOutWithNettyConsumer(SyncTest.java:71)
at com.xih.mediation.SyncTest.main(SyncTest.java:101)
Caused by: java.lang.IllegalArgumentException: timer must be specified
at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:280)
at
org.apache.camel.component.netty.NettyEndpoint.doStart(NettyEndpoint.java:83)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
at
org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:1675)
at
org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:910)
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:446)
... 5 more

--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Camel-Netty-tp5545678p5545678.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Problem with consumerTemplate and transacted (activeMq) routes

2012-03-07 Thread Claus Ibsen
On Wed, Mar 7, 2012 at 8:06 PM, Babak Vahdat
 wrote:
> Claus,
>
> Could it be one of the following tickets:
>
> https://issues.apache.org/jira/browse/AMQ-2611
> https://issues.apache.org/jira/browse/AMQ-1847
>

Nice  try but it was not one of them.


>
> Babak
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Problem-with-consumerTemplate-and-transacted-activeMq-routes-tp5540796p5545215.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/


Re: Naming of JMX beans

2012-03-07 Thread Claus Ibsen
Hi

Yes from Camel 2.10 onwards. See this page
http://camel.apache.org/camel-jmx.html#CamelJMX-Managementnamingpattern



On Wed, Mar 7, 2012 at 11:31 AM, Alexander Krauss
 wrote:
> Dear list,
>
> when running in an OSGi container (Karaf), the JMX beans generated for
> Camel contexts are prefixed with the id of the corresponding bundle.
> This makes it hard to set up external monitoring tools, since I would
> have to hard-code the bundle id in their configuration, which breaks
> on each
> change of the bundle configuration in the container.
>
> Is there a way to manually specify the id for the JMX beans for a
> Camel context/route? This would allow me to work around this problem.
>
> Thanks,
> Alex



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/


how to specify which method when calling a direct route?

2012-03-07 Thread codemonkey73
We've built a small directory of services (POJOs) for which we have built
direct to bean routes.  They've worked so far when using a ProducerTemplate
to call the direct route.  To specify the method when using
ProducerTemplate, we use requestBodyAndHeader("direct:myService",
[methodparameterOrNull], "CamelBeanMethodName", "myServiceMethodSignature").

Now I'm trying to call these services from an established web project which
doesn't use spring or camel. I'm trying to minimize the changes to that
project and keep spring and camel out, so I thought I would try to set up a
servlet route in the Camel project, and then route that servlet call to the
services directory via a direct route.  The simple servlet routing is
working, but what I can't figure out is the routing from the servlet to the
existing direct routes of the services.

I've tried variations of the following:

from("servlet:///servletRouteMapping").
setHeader("CamelBeanMethodName", constant("myServiceMethodSignature")).
to("direct:myService");

The response my client gets is 'Not Implemented Yet'.

I was planning on using different servlet mappings and routes for each of
the methods of the service.

--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-specify-which-method-when-calling-a-direct-route-tp5545275p5545275.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Problem with consumerTemplate and transacted (activeMq) routes

2012-03-07 Thread Babak Vahdat
Claus,

Could it be one of the following tickets:

https://issues.apache.org/jira/browse/AMQ-2611
https://issues.apache.org/jira/browse/AMQ-1847


Babak

--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-with-consumerTemplate-and-transacted-activeMq-routes-tp5540796p5545215.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Propogate CXF Exception to Camel

2012-03-07 Thread Aki Yoshida
Hi Yogesh,
This property will affect the invocation behavior at the camel-cxf
boundary. In other words, in this case, the call occurs synchronously
across this boundary.

That could be considered inefficient in some scenarios (e.g., if you
are not interested in any errors and you want to just quickly dispatch
those oneway calls).

But in any case, this property only affects the behavior at the
camel-cxf or cxf-camel boundary. And it will not affect the way how
the remote oneway web service is executed. That part depends on how
you configured that remote oneway web service.

regards, aki

2012/3/7 ychawla :
> Hi Aki,
> I do have a one-way service.  I added the 'synchronous=true' to the endpoint
> and now it is throwing the error without using my custom interceptor.  Will
> setting this attribute affect other behavior of the one-way service?
>
> Thanks,
> Yogesh
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Propogate-CXF-Exception-to-Camel-tp5491102p5544347.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: SMTP: sending file binary as attachment corrupted

2012-03-07 Thread ychawla
Hello,
I remember I had some issues attaching files so I added a processor that
read them directly from the file system.  For example:

public void addEmailAttachment(Exchange ex)
{
String fileNameWritten =
(String)ex.getIn().getHeader("CamelFileNameProduced");

ex.getIn().addAttachment("filename.zip", new DataHandler(new
FileDataSource(fileNameWritten)));
}

The Camel Header: CamelFileNameProduced is the actual path to the file on
the file system.

Thanks,
Yogesh

--
View this message in context: 
http://camel.465427.n5.nabble.com/SMTP-sending-file-binary-as-attachment-corrupted-tp5543701p5544370.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Propogate CXF Exception to Camel

2012-03-07 Thread ychawla
Hi Aki,
I do have a one-way service.  I added the 'synchronous=true' to the endpoint
and now it is throwing the error without using my custom interceptor.  Will
setting this attribute affect other behavior of the one-way service?

Thanks,
Yogesh

--
View this message in context: 
http://camel.465427.n5.nabble.com/Propogate-CXF-Exception-to-Camel-tp5491102p5544347.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Naming of JMX beans

2012-03-07 Thread Łukasz Dywicki
Hey Alex,
This is default naming strategy. It will be changed if you will name a context 
(eg. specify id attribute for camelContext element).

Best regards,
Lukasz Dywicki
--
Code-House
http://code-house.org

Wiadomość napisana przez Alexander Krauss w dniu 7 mar 2012, o godz. 11:31:

> Dear list,
> 
> when running in an OSGi container (Karaf), the JMX beans generated for
> Camel contexts are prefixed with the id of the corresponding bundle.
> This makes it hard to set up external monitoring tools, since I would
> have to hard-code the bundle id in their configuration, which breaks
> on each
> change of the bundle configuration in the container.
> 
> Is there a way to manually specify the id for the JMX beans for a
> Camel context/route? This would allow me to work around this problem.
> 
> Thanks,
> Alex



Re: CxfEndpoint and configure interceptor on bus

2012-03-07 Thread Aki Yoshida
Hi Andi,

There have been some changes in the wiring between the camel-cxf
endpoints and cxf buses recently. Therefore, there may be some
combination of the cxf and camel versions that could lead to some
issues depending on how they are wired.

That's why I was asking for the camel version and if you could try for
camel 2.9.0.  But as I said before, it's normal when you don't find
the other interceptor when you look into the endpoint, but it is a bug
or some kind of incompatibility issue when one of the interceptors is
not invoked or some exception is thrown during the invocation.

thanks.
regards, aki

2012/3/7 akuhtz :
> Hi Aki,
>
> Thanks for your reply. The problem was that the interceptor that was defined
> on the bus was not invoked and even not added to the interceptor chain 
> but this was a stupid configuration error on my side :-(
>
> With CXF-2.4.4 it was working if  was defined
> (wrong usage of the "id" attribute instead of "bus") and with CXF-2.4.6 (or
> newer) this does no longer work. Switching to CXF-2.5.2 threw an exception
> that no bus with this id/name was configured and this lead me to find the
> wrong configuration.
> Sorry for the noise on the camel list because it's a CXF related issue
> caused by my wrong configuration.
>
> Regards,
> Andi
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/CxfEndpoint-and-configure-interceptor-on-bus-tp5541585p5543569.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CxfEndpoint and configure interceptor on bus

2012-03-07 Thread akuhtz
Hi Aki,

Thanks for your reply. The problem was that the interceptor that was defined
on the bus was not invoked and even not added to the interceptor chain 
but this was a stupid configuration error on my side :-(

With CXF-2.4.4 it was working if  was defined
(wrong usage of the "id" attribute instead of "bus") and with CXF-2.4.6 (or
newer) this does no longer work. Switching to CXF-2.5.2 threw an exception
that no bus with this id/name was configured and this lead me to find the
wrong configuration.
Sorry for the noise on the camel list because it's a CXF related issue
caused by my wrong configuration.

Regards,
Andi

--
View this message in context: 
http://camel.465427.n5.nabble.com/CxfEndpoint-and-configure-interceptor-on-bus-tp5541585p5543569.html
Sent from the Camel - Users mailing list archive at Nabble.com.


SMTP: sending file binary as attachment corrupted

2012-03-07 Thread _d
Hello, 
i need to send a binary file (zip file for example) as an attachment via
email.
when I get the attachment in my mailbox the file is corrupted.


*here is my config *
as you can see, i set the mime type to application/octet-stream.


http://www.springframework.org/schema/beans";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:camel="http://camel.apache.org/schema/spring";
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
 http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd";>

http://camel.apache.org/schema/spring";>
  

  

  
application/octet-stream;name="${file:onlyname}";
  
  
   
attachment;filename="${file:onlyname}";size=${file:size}

  
Filename ${file:onlyname} date ${date:now:dd/MM/
HH:mm:ss}
  

  
  




the mail source code in my mailbox : 
Content-Type: application/octet-stream; name="FILENAME.ZIP"
Content-Disposition: attachment;filename="FILENAME.ZIP";size=11191
Content-Transfer-Encoding: base64

/
 hope i've been brief and clear, thank you for your help/

--
View this message in context: 
http://camel.465427.n5.nabble.com/SMTP-sending-file-binary-as-attachment-corrupted-tp5543701p5543701.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Activemq for high performance and scalable use.

2012-03-07 Thread Omar Atia
I'm using it in camel-context :).


From: Claus Ibsen [claus.ib...@gmail.com]
Sent: Wednesday, March 07, 2012 12:29 PM
To: users@camel.apache.org
Subject: Re: Activemq for high performance and scalable use.

Hi

This is the mailing list for Apache Camel.
Can you please use the mailing list for Apache ActiveMQ for your AMQ questions.


On Wed, Mar 7, 2012 at 8:52 AM, Omar Atia  wrote:
> Dear Ashwin ,
>
> The XML message size is less than 2000 bytes , we have already four channels 
> to send messages in parallel to mina-tcp then to activemq channel.
>
> Can you help with default configurations?
>
> from the below http://activemq.apache.org/kahadb.html , In messages for sure 
> and asynch.
>
> can we configure threads for activemq ? increase no of threads to handle 
> 20 request?
>
> thanks,
>
> Omar Atia
> 
> From: Ashwin Karpe [aka...@fusesource.com]
> Sent: Wednesday, March 07, 2012 2:28 AM
> To: users@camel.apache.org
> Subject: Re: Activemq for high performance and scalable use.
>
> Hi,
>
> Using a relational store is definitely slower than KahaDB. KahaDB is a store
> that employs indexing & has a high speed journal to deal with efficient
> access to stored messages. The relational layer is more expensive due to the
> cost of SQL lookups & persistence...
>
> However your requirement (25 msgs daily, msg size ?), just based on
> number of messages does not seem out of the ordinary using either option
> (unless there is something about msg size that I do not see). KahaDB is
> easily the better and faster approach...
>
> Hope this helps.
>
> Cheers,
>
> Ashwin...
>
> -
> -
> Ashwin Karpe
> Apache Camel Committer & Sr Principal Consultant
> FUSESource (a Progress Software Corporation subsidiary)
> http://fusesource.com
>
> Blog: http://opensourceknowledge.blogspot.com
> -
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Activemq-for-high-performance-and-scalable-use-tp5541877p5542771.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Naming of JMX beans

2012-03-07 Thread Alexander Krauss
Dear list,

when running in an OSGi container (Karaf), the JMX beans generated for
Camel contexts are prefixed with the id of the corresponding bundle.
This makes it hard to set up external monitoring tools, since I would
have to hard-code the bundle id in their configuration, which breaks
on each
change of the bundle configuration in the container.

Is there a way to manually specify the id for the JMX beans for a
Camel context/route? This would allow me to work around this problem.

Thanks,
Alex


Re: Activemq for high performance and scalable use.

2012-03-07 Thread Claus Ibsen
Hi

This is the mailing list for Apache Camel.
Can you please use the mailing list for Apache ActiveMQ for your AMQ questions.


On Wed, Mar 7, 2012 at 8:52 AM, Omar Atia  wrote:
> Dear Ashwin ,
>
> The XML message size is less than 2000 bytes , we have already four channels 
> to send messages in parallel to mina-tcp then to activemq channel.
>
> Can you help with default configurations?
>
> from the below http://activemq.apache.org/kahadb.html , In messages for sure 
> and asynch.
>
> can we configure threads for activemq ? increase no of threads to handle 
> 20 request?
>
> thanks,
>
> Omar Atia
> 
> From: Ashwin Karpe [aka...@fusesource.com]
> Sent: Wednesday, March 07, 2012 2:28 AM
> To: users@camel.apache.org
> Subject: Re: Activemq for high performance and scalable use.
>
> Hi,
>
> Using a relational store is definitely slower than KahaDB. KahaDB is a store
> that employs indexing & has a high speed journal to deal with efficient
> access to stored messages. The relational layer is more expensive due to the
> cost of SQL lookups & persistence...
>
> However your requirement (25 msgs daily, msg size ?), just based on
> number of messages does not seem out of the ordinary using either option
> (unless there is something about msg size that I do not see). KahaDB is
> easily the better and faster approach...
>
> Hope this helps.
>
> Cheers,
>
> Ashwin...
>
> -
> -
> Ashwin Karpe
> Apache Camel Committer & Sr Principal Consultant
> FUSESource (a Progress Software Corporation subsidiary)
> http://fusesource.com
>
> Blog: http://opensourceknowledge.blogspot.com
> -
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Activemq-for-high-performance-and-scalable-use-tp5541877p5542771.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/


Re: Propogate CXF Exception to Camel

2012-03-07 Thread Aki Yoshida
Hi Yogesh,

could it be that your web service call is a oneway operation? If that
is the case, you should set the synchronous property to true
(...&synchronous=true) for the camel-cxf endpoint to get the
transmission error. See http://camel.apache.org/cxf.html for more
info. Can you try setting this property?

regards, aki


2012/3/2 ychawla :
> Hi Willem,
> I upgraded to Camel 2.8.4 and CXF 2.4.6 and I still see this behavior.  Here
> is my route.  It basically reads from a folder and calls a web service:
>
>                
> uri="cxf:bean:foobarRelocationService?dataFormat=PAYLOAD&loggingFeatureEnabled=true"
> />
>
>
>                 errorHandlerRef="foobarRelocationDeadLetterErrorHandler">
>                        
>                         />
>                        
>                                opName
>                        
>                        
>                                http://www.namespace.com/
>                        
>                        
>                        
>                
>
>        
>
>
>         class="org.apache.camel.builder.DeadLetterChannelBuilder">
>
>                 value="foobarRelocationDeadLetterDir" />
>
>                 ref="foobarRelocationRedeliveryPolicyConfig" />
>        
>
>
>         class="org.apache.camel.processor.RedeliveryPolicy">
>
>                
>
>                
>        
>
> I get a connection refused error when I shut down the server:
>
> [rna/relocation/connector/input] PhaseInterceptorChain          DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.interceptor.BareOutInterceptor@4320d68d
> [rna/relocation/connector/input] PhaseInterceptorChain          DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor@5538615e
> [rna/relocation/connector/input] PhaseInterceptorChain          DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.ws.addressing.soap.MAPCodec@465e34ce
> [rna/relocation/connector/input] PhaseInterceptorChain          DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.interceptor.StaxOutInterceptor@5123ac44
> [rna/relocation/connector/input] PhaseInterceptorChain          DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.interceptor.AttachmentOutInterceptor@674a93a6
> [rna/relocation/connector/input] PhaseInterceptorChain          DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.interceptor.LoggingOutInterceptor@491f03e4
> [rna/relocation/connector/input] PhaseInterceptorChain          DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.interceptor.MessageSenderInterceptor@1338933d
> [rna/relocation/connector/input] PhaseInterceptorChain          DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.binding.soap.interceptor.SoapPreProtocolOutInterceptor@20e5e569
> [rna/relocation/connector/input] PhaseInterceptorChain          DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.binding.soap.interceptor.SoapHeaderOutFilterInterceptor@7d02cdf9
> [rna/relocation/connector/input] PhaseInterceptorChain          DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.ws.addressing.MAPAggregator@5c04e904
> [rna/relocation/connector/input] PhaseInterceptorChain          DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.ws.policy.PolicyOutInterceptor@7f1ef3e7
> [rna/relocation/connector/input] PhaseInterceptorChain          WARN
> Interceptor for
> {http://www.XXX.com}FOOBAR-Relocation#{http://www.XXX.com/1.0.0}SubmitFOOBARPackage
> has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Could not generate the XML stream caused
> by: com.ctc.wstx.exc.WstxIOException: Connection refused.
>        at
> org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:91)[cxf-rt-core-2.4.6.jar:2.4.6]
>        at
> org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:50)[cxf-rt-core-2.4.6.jar:2.4.6]
>        at
> org.apache.camel.component.cxf.HybridSourceDataBinding$1.write(HybridSourceDataBinding.java:101)[camel-cxf-2.8.4.jar:2.8.4]
>
> After this the route continues rather than trying redelivery.  If I throw an
> exception processor in there:
>
>        
>
>        
>
> Then I see the redelivery attempts happen.  This does not happen with the
> web service 'connection refused' though...
>
> Any ideas?
>
> Thanks,
> Yogesh
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Propogate-CXF-Exception-to-Camel-tp5491102p5532402.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


endDoTry() problem

2012-03-07 Thread XiaoPeng Li
Hi,

I had some problems when I tried "endDoTry()" in my RouteBuilder. Here are the 
codes:

  from("timer://myTimer?period=2000").setBody()
.simple("Current time is 
${header.firedTime}").doTry()
.process(new Processor() {

   @Override
   public void process(Exchange exchange) 
throws Exception {
  throw new Exception("Customized");

   }
}).setBody(constant("No 
Exception")).to("log:no-error")
.to("file://c:/data/input/cFile").endDoTry()
.doCatch(Exception.class).to("log:catch");

   }

will cause an Exception:
Exception in thread "main" java.lang.ClassCastException: 
org.apache.camel.model.RouteDefinition cannot be cast to 
org.apache.camel.model.TryDefinition

And even worse, if we add some other routing nodes to Route, for example:

  from("timer://myTimer?period=2000").setBody()
.simple("Current time is 
${header.firedTime}").doTry()
.process(new Processor() {

   @Override
   public void process(Exchange exchange) 
throws Exception {
  throw new Exception("Customized");

   }
}).setBody(constant("No 
Exception")).to("log:no-error")

.loadBalance().random().to("log:load1").to("log:load1")
.to("file://c:/data/input/cFile").endDoTry()
.doCatch(Exception.class).to("log:catch");

   }
after loadBalance(), there will be no exception.

I believe it's a camel bug, and here is similar bug 
https://issues.apache.org/jira/browse/CAMEL-4517 with endChoice().

My question is: will camel fix this problem to make sure it's OK to use 
endDoTry() in all cases?

Best Regards
Xiaopeng Li



Re: JMS and transactions

2012-03-07 Thread kafe
Ok it's a good news for me.
Thx.

--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-and-transactions-tp5541630p5543505.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Problem with consumerTemplate and transacted (activeMq) routes

2012-03-07 Thread Christian Müller
Good morning Claus,
:o)

I had no luck so far.
I also tested this route with the latest ActiveMQ 5.5-SNAPSHOT and
5.6-SNAPSHOT versions and it still failed.

Best,
Christian

On Wed, Mar 7, 2012 at 9:06 AM, Claus Ibsen  wrote:

> Ah a typo, its of course you -> I.
>
> Christian did you have luck finding the ticket(s)?
>
> I remember there was an attachment with a sample unit test that
> demonstrated the issue.
> And it was reported a fair long time ago, like 1-2 years.
> I think it was working in AMQ 5.3 but failed when upgrading to 5.4 or
> it was 5.4 -> 5.5.
>
>
>
> On Tue, Mar 6, 2012 at 3:05 PM, Claus Ibsen  wrote:
> > On Tue, Mar 6, 2012 at 2:43 PM, Claus Ibsen 
> wrote:
> >> Its not Camel. There is a JIRA ticket in AMQ about this.
> >>
> >
> > Crap you gotta be some sort of imbecile to use  the ASF JIRA. Have
> > been trying for 20 min to find the good damn JIRA ticket about this.
> > It was first reported at Camel and then moved to AMQ as an issue.
> >
> >
> >
> >>
> >> On Tue, Mar 6, 2012 at 2:26 PM, Christian Müller
> >>  wrote:
> >>> We have this issue by running Apache Camel 2.6.0. I verified that this
> issue
> >>> still exists with the brand new 2.9.1 version.
> >>> We use Java 1.6.0_29 and are able to reproduce it on MacOS and Windows
> 2000.
> >>>
> >>> Please have a look at the route definition below to follow the
> explanation.
> >>> In route-2 we send the received messages into the queue "aggregate" and
> >>> afterwards to an aggregator. The aggregator aggregate messages into
> batches
> >>> of fife. If fife messages are aggregated, the following processor read
> all
> >>> messages from queue "aggregate", aggregate the content and send it to
> a mock
> >>> endpoint. This works fine as long we don't use transacted routes. But
> >>> because we don't want to lose messages (in reality we use a pesistent
> >>> aggregation repository), we switched to transacted routes. With this
> change,
> >>> our processor (which use the Camel consumerTemplate) only receives one
> >>> message in the while loop. We checked the queue and there are four
> other
> >>> messages which are not read. We tried multiple different combinations
> of
> >>> connectionFactory settings, cacheLevelName settings, ... but without
> luck.
> >>>
> >>> Any idea what we did wrong or what Camel does wrong?
> >>>
> >>> The route:
> >>> @Override
> >>> public void configure() throws Exception {
> >>> from("direct:start").routeId("route-1")
> >>> .inOnly("activemq:queue:start");
> >>>
> >>> from("activemqTx:queue:start").routeId("route-2")
> >>> .transacted("required")
> >>> .inOnly("activemqTx:queue:aggregate")
> >>> .aggregate(header("aggregationGroup"), new
> >>> BodyInAggregatingStrategy()).completionSize(5)
> >>> .process(new Processor() {
> >>> public void process(Exchange ex) throws Exception {
> >>>
> >>> log.info("");
> >>> log.info("Consume from 'activemq:queue:aggregate'
> after
> >>> aggregation completed");
> >>>
> >>> log.info("");
> >>>
> >>> StringBuilder builder = new StringBuilder();
> >>> Exchange exchange = null;
> >>>
> >>> while ((exchange =
> >>> consumerTemplate.receiveNoWait("activemq:queue:aggregate")) != null) {
> >>>
> builder.append(exchange.getIn().getBody(String.class));
> >>> consumerTemplate.doneUoW(exchange);
> >>> }
> >>>
> >>>
> >>> log.info("");
> >>> log.info("no more messages to consume from queue
> >>> 'activemq:queue:aggregate'");
> >>>
> >>> log.info("");
> >>>
> >>> ex.getIn().setBody(builder.toString());
> >>> }
> >>> })
> >>> .inOnly("mock:end");
> >>> }
> >>>
> >>> The test:
> >>> public void test() throws InterruptedException {
> >>> end.expectedBodiesReceived("12345");
> >>>
> >>> template.sendBodyAndHeader("direct:start", "1", "aggregationGroup",
> >>> "A");
> >>> template.sendBodyAndHeader("direct:start", "2", "aggregationGroup",
> >>> "A");
> >>> template.sendBodyAndHeader("direct:start", "3", "aggregationGroup",
> >>> "A");
> >>> template.sendBodyAndHeader("direct:start", "4", "aggregationGroup",
> >>> "A");
> >>> template.sendBodyAndHeader("direct:start", "5", "aggregationGroup",
> >>> "A");
> >>>
> >>> assertMockEndpointsSatisfied(5, TimeUnit.SECONDS);
> >>> }
> >>>
> >>> Please find attached my Eclipse project which contains the unit test.
> >>>
> >>> Best,
> >>> Christian
> >>
> >>
> >>
> >> --
> >> Claus Ibsen
> >> -
> >> FuseSource
> >> Email: cib...@fusesource.com
> >> Web: http://fusesource.com
> >> Twitter: davsclaus, fusenews
> >> Blog: http://davsclaus.blogspot.com/
> >> Author of Camel in Action: http://www.manning.com/ibsen/

Re: Problem with consumerTemplate and transacted (activeMq) routes

2012-03-07 Thread Claus Ibsen
Ah a typo, its of course you -> I.

Christian did you have luck finding the ticket(s)?

I remember there was an attachment with a sample unit test that
demonstrated the issue.
And it was reported a fair long time ago, like 1-2 years.
I think it was working in AMQ 5.3 but failed when upgrading to 5.4 or
it was 5.4 -> 5.5.



On Tue, Mar 6, 2012 at 3:05 PM, Claus Ibsen  wrote:
> On Tue, Mar 6, 2012 at 2:43 PM, Claus Ibsen  wrote:
>> Its not Camel. There is a JIRA ticket in AMQ about this.
>>
>
> Crap you gotta be some sort of imbecile to use  the ASF JIRA. Have
> been trying for 20 min to find the good damn JIRA ticket about this.
> It was first reported at Camel and then moved to AMQ as an issue.
>
>
>
>>
>> On Tue, Mar 6, 2012 at 2:26 PM, Christian Müller
>>  wrote:
>>> We have this issue by running Apache Camel 2.6.0. I verified that this issue
>>> still exists with the brand new 2.9.1 version.
>>> We use Java 1.6.0_29 and are able to reproduce it on MacOS and Windows 2000.
>>>
>>> Please have a look at the route definition below to follow the explanation.
>>> In route-2 we send the received messages into the queue "aggregate" and
>>> afterwards to an aggregator. The aggregator aggregate messages into batches
>>> of fife. If fife messages are aggregated, the following processor read all
>>> messages from queue "aggregate", aggregate the content and send it to a mock
>>> endpoint. This works fine as long we don't use transacted routes. But
>>> because we don't want to lose messages (in reality we use a pesistent
>>> aggregation repository), we switched to transacted routes. With this change,
>>> our processor (which use the Camel consumerTemplate) only receives one
>>> message in the while loop. We checked the queue and there are four other
>>> messages which are not read. We tried multiple different combinations of
>>> connectionFactory settings, cacheLevelName settings, ... but without luck.
>>>
>>> Any idea what we did wrong or what Camel does wrong?
>>>
>>> The route:
>>> @Override
>>> public void configure() throws Exception {
>>>     from("direct:start").routeId("route-1")
>>>     .inOnly("activemq:queue:start");
>>>
>>>     from("activemqTx:queue:start").routeId("route-2")
>>>     .transacted("required")
>>>     .inOnly("activemqTx:queue:aggregate")
>>>     .aggregate(header("aggregationGroup"), new
>>> BodyInAggregatingStrategy()).completionSize(5)
>>>     .process(new Processor() {
>>>     public void process(Exchange ex) throws Exception {
>>>
>>> log.info("");
>>>     log.info("Consume from 'activemq:queue:aggregate' after
>>> aggregation completed");
>>>
>>> log.info("");
>>>
>>>     StringBuilder builder = new StringBuilder();
>>>     Exchange exchange = null;
>>>
>>>     while ((exchange =
>>> consumerTemplate.receiveNoWait("activemq:queue:aggregate")) != null) {
>>>     builder.append(exchange.getIn().getBody(String.class));
>>>     consumerTemplate.doneUoW(exchange);
>>>     }
>>>
>>>
>>> log.info("");
>>>     log.info("no more messages to consume from queue
>>> 'activemq:queue:aggregate'");
>>>
>>> log.info("");
>>>
>>>     ex.getIn().setBody(builder.toString());
>>>     }
>>>     })
>>>     .inOnly("mock:end");
>>> }
>>>
>>> The test:
>>> public void test() throws InterruptedException {
>>>     end.expectedBodiesReceived("12345");
>>>
>>>     template.sendBodyAndHeader("direct:start", "1", "aggregationGroup",
>>> "A");
>>>     template.sendBodyAndHeader("direct:start", "2", "aggregationGroup",
>>> "A");
>>>     template.sendBodyAndHeader("direct:start", "3", "aggregationGroup",
>>> "A");
>>>     template.sendBodyAndHeader("direct:start", "4", "aggregationGroup",
>>> "A");
>>>     template.sendBodyAndHeader("direct:start", "5", "aggregationGroup",
>>> "A");
>>>
>>>     assertMockEndpointsSatisfied(5, TimeUnit.SECONDS);
>>> }
>>>
>>> Please find attached my Eclipse project which contains the unit test.
>>>
>>> Best,
>>> Christian
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> FuseSource
>> Email: cib...@fusesource.com
>> Web: http://fusesource.com
>> Twitter: davsclaus, fusenews
>> Blog: http://davsclaus.blogspot.com/
>> Author of Camel in Action: http://www.manning.com/ibsen/
>
>
>
> --
> Claus Ibsen
> -
> FuseSource
> Email: cib...@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibs