RE: Activemq for high performance and scalable use.

2012-03-06 Thread Omar Atia
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.


Re: Does Camel supports dynamic routing by getting the routing info from database

2012-03-06 Thread Claus Ibsen
On Tue, Mar 6, 2012 at 4:12 PM, Donald Whytock  wrote:
> Would it be useful to put a "timeout" on a route, such that it's
> automatically shut down and GCed if messages don't come through it for
> X amount of time?  Thus making dynamic routes more load-driven?
>
> Or would this defeat the purpose of GCing dynamic routes by adding a
> timer thread?
>

You can build this yourself, using for example a RoutePolicy.
http://camel.apache.org/routepolicy



> Don
>
> On Tue, Mar 6, 2012 at 5:31 AM, Claus Ibsen  wrote:
>> Hi
>>
>> There is also the dynamic router EIP
>> http://camel.apache.org/dynamic-router
>>
>>
>>
>> On Tue, Mar 6, 2012 at 2:14 AM, johnson0233  wrote:
>>> Thanks Guys, now i am getting the idea of dynamic routing, and my new
>>> question here is, if i have a central routing manager which can route the
>>> message based on rules stores in database, and how could this "routing
>>> manager" work with these communication adapters such as ftp, http? As far as
>>> i know, ftp component can be triggered if there is new file arrived at a
>>> specific folder, and how can "route manager" be triggered or how can "route
>>> manager" take responses(retrieve routing info from database for this new
>>> file arrived)? Thanks a lot in advance!
>>>
>>> --
>>> View this message in context: 
>>> http://camel.465427.n5.nabble.com/Does-Camel-supports-dynamic-routing-by-getting-the-routing-info-from-database-tp5537354p5539577.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/



-- 
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: Sending multiple messages in Camel

2012-03-06 Thread Frank
Hi Ashwin, 

I am getting the same error after I changed to template.requestBody(). I am
unable to figure it out. Could you help me?

Exhausted after delivery attempt: 1 caught:
java.lang.IllegalArgumentException: Cannot add a 2nd consumer to the same
endpoint. Endpoint Endpoint[direct://level2] only allows one consumer.
java.lang.IllegalArgumentException: Cannot add a 2nd consumer to the same
endpoint. Endpoint Endpoint[direct://level2] only allows one consumer.

Thanks, 
Frank

--
View this message in context: 
http://camel.465427.n5.nabble.com/Sending-multiple-messages-in-Camel-tp5541723p5543220.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JAXB exceptions with camel context xml in glassfish

2012-03-06 Thread trivedi
Here is the camel context file 
http://camel.465427.n5.nabble.com/file/n5543061/ehf-ipf-context.xml
ehf-ipf-context.xml 

jaxb-api = 2.1
jaxb-impl = 2.1.13

Let me know if you need any further details. Thank you for your prompt
response on this.

Trivedi

--
View this message in context: 
http://camel.465427.n5.nabble.com/JAXB-exceptions-with-camel-context-xml-in-glassfish-tp5542035p5543061.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Sending multiple messages in Camel

2012-03-06 Thread Ashwin Karpe
Hi,

Your route expects to send back a response, however you are using
template.sendBody() that does not expect to receive anything (one-way send).

If you expect to receive a response from your bean, you should use
template.requestBody() that sends a request and expects a response.

Cheers,

Ashwin...

P.S: I have not inspected your beans closely but notice that they have
return values... You may also want to append a logger and/or a camel tracer
to trace messages flowing through the route...

-
-
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/Sending-multiple-messages-in-Camel-tp5541723p5542792.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Activemq for high performance and scalable use.

2012-03-06 Thread Ashwin Karpe
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.


Re: JAXB exceptions with camel context xml in glassfish

2012-03-06 Thread Ashwin Karpe
Hi,

My sense is that your generated JAXB stub code has some annotations that are
not being properly recognized by JAXB. Can you check which version of JAXB
you are using and ensure that it aligns with the jar being employed in
Glassfish...

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/JAXB-exceptions-with-camel-context-xml-in-glassfish-tp5542035p5542750.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JAXB exceptions with camel context xml in glassfish

2012-03-06 Thread Ashwin Karpe
Hi,

Can you please also past the camel context in question... AT the moment we
have insufficient data to diagnose the issue.

Thanks,

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/JAXB-exceptions-with-camel-context-xml-in-glassfish-tp5542035p5542744.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: http client cert verification

2012-03-06 Thread ychawla
On your client, you can add a HTTP conduit:











.*_EXPORT_.*
.*_EXPORT1024_.*
.*_WITH_DES_.*
.*_WITH_NULL_.*
.*_DH_anon_.*





On the server, you can set it up to require client auth:

http://namespace}My-Service.http-destination"/>

  
 
 
 
   
  
  
  
  
  
  

.*_EXPORT_.*
.*_EXPORT1024_.*
.*_WITH_DES_.*
.*_WITH_NULL_.*
.*_DH_anon_.*
  
  

  
   

Check here for CXF configuration:

http://cxf.apache.org/docs/jetty-configuration.html

Thanks,
Yogesh

--
View this message in context: 
http://camel.465427.n5.nabble.com/http-client-cert-verification-tp5542079p5542552.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Need help in Camel to send emails

2012-03-06 Thread ychawla
Hi,
Are you trying to set the 'to' field in your email.  You can either set that
on the smtp URI or in a header.  For example:

recipi...@domain.com

The body of your email is whatever is on your message body.

If you want to set it as part of your route, try using a bean:



public String createEmailBody()
{
  return "Some email body string here";

}

Thanks,
Yogesh

--
View this message in context: 
http://camel.465427.n5.nabble.com/Need-help-in-Camel-to-send-emails-tp5541960p5542525.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Splitting of mail

2012-03-06 Thread Doug Douglass
Hmm, just thinking out loud, but can you split the data before it becomes
(part of) an email? Then at least you can remove the dependency on the
mail/MIME APIs.

Doug

P.S. Are you in Centenial? Many years ago I worked in the Maint. Docs dept.
at Jepp,

On Tue, Mar 6, 2012 at 8:43 AM, Knut Aksnes-NOR wrote:

> We have a concrete problem related to the SMTP component of Camel.
>
> In one of our systems we need to distribute certain data of some size to
> customers via mail, our customers mail connections very often have strong
> restrictions on mail size, at the same time we don't have control over
> their mail setup, think satellite links. What we want to do is to pre split
> the outgoing mails to particular sizes (dependent on customer) using MIME
> message/partial . What I can't find is API support for this in Camel. At
> the time being we essentially have  a few options (In prioritized order;
> the order of 2 and 3 is likely to change if 3 can be implemented fast):
>
> 1.   Somebody points us to the relevant API (or we discover it
> ourselves)
>
> 2.   Find some way of manipulating a mail server to do this for us,
> configurable via  custom mail headers. (We will then have to find such a
> mail server and be able to configure it)
>
> 3.   Write a component (Probably a bean) to spit a mail message based
> on MIME related RFCs. (Likely to be problematic as we need to find a
> solution fast.)
>
> 4.   Handle the splitting on the application level. (Will have bad
> architectural consequences, the project will then switch character from
> integration to a maintenance project on a couple of components we would
> strongly prefer not to touch.)
>
> Any hints related to solution 1 - 3 would be appreciated, having to go for
> 4 is bad news. 3 is OK if we are able to get it done fast, that is if we
> are able to get a tested solution within a couple of weeks. I consider the
> writeTo method of javax.mail.internet.MimeMessage a good start.
>
>


http client cert verification

2012-03-06 Thread JoeR
Could someone point me to an example or provide some guidance on what I
should do if I want to validate the cert returned from the server when I
make the https connection.

I have keystore and a truststore, but I am not sure how I tie them to the
https connection.  

Thanks in advance.

 

  http://example.Service/example_WF";>
  

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

  
 
  https://abc.def.net/ExampleService/WF_Service.svc"/>  

  


--
View this message in context: 
http://camel.465427.n5.nabble.com/http-client-cert-verification-tp5542079p5542079.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Need help in Camel to send emails

2012-03-06 Thread ven12344
Hi, I have a requirement where I am sending an email when there is a error in
our billing system.

I have the route like this.



subject*=${subject}&*contentType*=text/plain&folderName=INBOX&filter=#errorBillingResponseEmailing"/>



I want to set a body of the email and also when the email is sent, the email
must move to sent folder when it is successfully sent.

I have a "subject" attribute, not sure if I can provide the body for that.

Please let me know.

Thanks

--
View this message in context: 
http://camel.465427.n5.nabble.com/Need-help-in-Camel-to-send-emails-tp5541960p5541960.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Need help in Camel to send emails

2012-03-06 Thread ychawla
Hi,
The body of the email will be whatever you have as the current body of the
Camel exchange.  You can explicitly set the body as well:

This is my email body

To control when the email is sent, you can split up your route:






Then you can use quartz to set up a timer to poll your folder:
http://camel.465427.n5.nabble.com/Consuming-Files-using-Timer-Quartz-td3320330.html

If you don't have complex requirements for when it is sent, the file URI
syntax could be sufficient.

You can tell Camel to delete all emails it consumes by configuration.  Once
you do this, you can BCC your mailbox and apply an email rule to put a copy
of the email sent in the 'sent' folder.

Cheers,
Yogesh

--
View this message in context: 
http://camel.465427.n5.nabble.com/Need-help-in-Camel-to-send-emails-tp5541960p5542072.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CxfEndpoint and configure interceptor on bus

2012-03-06 Thread Aki Yoshida
Hi Andi,
I think you always saw at the endpoint only the interceptors that are
configured at the endpoint. But you saw both interceptors when the
interceptor chain is built. Are you not seeing both interceptors when
the interceptor chain is invoked?

If you have this problem, can you tell us which camel version are you
using? And can you test it with Camel 2.9.0?

regards, aki

2012/3/6 akuhtz :
> Hi,
>
> I've a question regarding camel-cxf in combination with interceptors
> configured on the CXF-bus. It seems that the behaviour has changed from
> CXF-version 2.4.4 to 2.4.6 but I'm not sure if it's a camel problem.
>
> I've modified a unit-test that shows the problem. I expected an interceptor
> that is configured on the cxf-bus to be added to any cxf-endpoint that uses
> this bus but it's not added. Please see the attached patch that has the
> modified test.
> http://camel.465427.n5.nabble.com/file/n5541585/camel-cxf-question.patch
> camel-cxf-question.patch
>
> Is my assumption wrong?
>
> Best regards
> Andi
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/CxfEndpoint-and-configure-interceptor-on-bus-tp5541585p5541585.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: npe in camel 2.9.1 validator

2012-03-06 Thread Babak Vahdat
So could you please provide a simple unit-test and attach on the JIRA ticket
so that the behaviour can reproduced and fixed?

Babak

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


Activemq for high performance and scalable use.

2012-03-06 Thread Omar Atia
Dears,
I'm willing to use activemq , I have the following questions:
1- which database I should use for high performance and more than 25 
request daily from tcp channel to activemq.
2- what is default configuration?

If I use jdbc is it slower?i'm thinking to use oracle !! is it with good 
performance?

Which is better ? Activemq message store? Kahadb or oracle? The issue is oracle 
can be queried easily but I believe jdbc makes things slower

Appreciate your feedback,

Thanks,
Omar atia

Re: Inconsistent onException behaviour

2012-03-06 Thread Babak Vahdat
Hi

take a look at example [1] describing the behaviour your're observing:

// since we have no to then the exchange will continue to be routed to the
normal error handler

As you make use of the log DSL you do already route / consume the exchange
inside the onException
clause by itself so that there's nothing more left to deliver for the global
errorHandler. As an example
given your Test you could also equally do:

.log("The body of IN Message was ${body}")

And then you should see the log entry:

"The body of IN Message was Body"

Proving that the exchange was already routed inside the onException clause.
If you would instead use the
log DSL inside the errorHandler then your test will pass:

   
errorHandler(deadLetterChannel("mock:error").
 disableRedelivery().
 log("The body of IN Message was
${body}"));

[1]
https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/onexception/OnExceptionSubRouteTest.java

Babak


--
View this message in context: 
http://camel.465427.n5.nabble.com/Inconsistent-onException-behaviour-tp5541356p5541855.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: npe in camel 2.9.1 validator

2012-03-06 Thread Preben.Asmussen
Hi Babak

The xsd has no imports - just plain and simple. It recites in an other maven
module with shared schemas that is on the classpath, and available for the
unittest. There is no problem under camel 2.9.0

/preben

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


Sending multiple messages in Camel

2012-03-06 Thread Frank
When I am trying to send multiple messages, I am getting the below error
message.

Exhausted after delivery attempt: 1 caught:
java.lang.IllegalArgumentException: Cannot add a 2nd consumer to the same
endpoint.

Also, please see the attached files for the routes. If I comment out the
line
"template.sendBody("direct:a","second message");" in Main class it works
fine. But I don't want to comment that line. Please help me how to solve
this problem.
http://camel.465427.n5.nabble.com/file/n5541723/files.zip files.zip 

Thanks,
Frank

--
View this message in context: 
http://camel.465427.n5.nabble.com/Sending-multiple-messages-in-Camel-tp5541723p5541723.html
Sent from the Camel - Users mailing list archive at Nabble.com.


CxfEndpoint and configure interceptor on bus

2012-03-06 Thread akuhtz
Hi,

I've a question regarding camel-cxf in combination with interceptors
configured on the CXF-bus. It seems that the behaviour has changed from
CXF-version 2.4.4 to 2.4.6 but I'm not sure if it's a camel problem.

I've modified a unit-test that shows the problem. I expected an interceptor
that is configured on the cxf-bus to be added to any cxf-endpoint that uses
this bus but it's not added. Please see the attached patch that has the
modified test.
http://camel.465427.n5.nabble.com/file/n5541585/camel-cxf-question.patch
camel-cxf-question.patch 

Is my assumption wrong?

Best regards
Andi

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


Re: JMS and transactions

2012-03-06 Thread David Karlsen
If both the queues come off the same jms connection factory you can
use a resource-local (JMS) transaction.
See JmsTransactionManager in spring.

2012/3/6 kafe :
> Hi,
>
> I have a simple route that picks up a message in a jms queue, does something
> in a processor and finally puts it in another queue :
>
> 
>   
>   
>   
>   
> 
>
> I want the route to occur in a transaction and i wonder whether i have to
> leverage a global transaction (JTA) or not.
>
> Is JTA necessary in such a use case ?
>
> Eric
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/JMS-and-transactions-tp5541630p5541630.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


JMS and transactions

2012-03-06 Thread kafe
Hi,

I have a simple route that picks up a message in a jms queue, does something
in a processor and finally puts it in another queue : 


   
   
   
   


I want the route to occur in a transaction and i wonder whether i have to
leverage a global transaction (JTA) or not.

Is JTA necessary in such a use case ?

Eric

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


Re: npe in camel 2.9.1 validator

2012-03-06 Thread Babak Vahdat
Hi

I did reproduce your NPE with exactly the same Stacktrace.

I assume you make use of xs:import inside BroadcastMonitor.xsd, so make sure
you do *correctly* specify the filesystem path to the imported xsd using the
schemaLocation attribute. As an example take a look at [1] and see how
"health.xsd" has been referenced:

  

As "health.xsd" resides under the same directory. Take a look at [2] as well
and let us know how it's going.

Nevertheless we should properly put a NotNull-Check for this before trying
to resolve the URI

[1]
https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/resources/org/apache/camel/component/validator/person.xsd
[2] https://issues.apache.org/jira/browse/CAMEL-4877

And following is the stacktrace I did get while reproducing your use case
using one of the Camel unit-tests:

org.apache.camel.FailedToCreateRouteException: Failed to create route route1
at: >>> DoTry[[To[validator:person.xsd], To[mock:valid], DoCatch[ [class
org.apache.camel.ValidationException] -> [To[mock:invalid]]],
DoFinally[[To[mock:finally] <<< in route: Route[[From[direct:start]] ->
[DoTry[[To[validator:person.xs... because of Failed to resolve endpoint:
validator://person.xsd due to: null
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:873)
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:171)
at
org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:720)
at
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1743)
at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1536)
at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1431)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1399)
at
org.apache.camel.ContextTestSupport.startCamelContext(ContextTestSupport.java:170)
at 
org.apache.camel.ContextTestSupport.setUp(ContextTestSupport.java:114)
at
org.apache.camel.component.validator.ValidatorIncludeRouteTest.setUp(ValidatorIncludeRouteTest.java:130)
at junit.framework.TestCase.runBare(TestCase.java:132)
at org.apache.camel.TestSupport.runBare(TestSupport.java:59)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint: validator://person.xsd due to: null
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:466)
at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:48)
at
org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:186)
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:106)
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:112)
at
org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)
at
org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)
at
org.apache.camel.model.ProcessorDefinition.createOutputsProcessor(ProcessorDefinition.java:382)
at
org.apache.camel.model.TryDefinition.createProcessor(TryDefinition.java:75)
at
org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:441)
at
org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:179)
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:870)
... 25 more
Caused by: java.lang.NullPointerException
at
org.apache.camel.util.ResourceHelper.resolveMandatoryResourceAsInputStream(ResourceHelper.java:65)
at
org.apache.camel.component.validator.DefaultLSResourceResolver$DefaultLSInput.getByteStream(DefaultLSResourc

Inconsistent onException behaviour

2012-03-06 Thread razvan.ludvig
The attached unit test (
http://camel.465427.n5.nabble.com/file/n5541356/ExceptionHandlingTest.java
ExceptionHandlingTest.java ) fails, but removing the log in the onException
block will make the test pass. The same behaviour can be seen for almost any
statement inside the block (like setBody, setHeader, etc) 

I used Camel 2.9.0 for these tests.

Here is the route:



And this is the test snippet:



--
View this message in context: 
http://camel.465427.n5.nabble.com/Inconsistent-onException-behaviour-tp5541356p5541356.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Splitting of mail

2012-03-06 Thread Knut Aksnes-NOR
We have a concrete problem related to the SMTP component of Camel.

In one of our systems we need to distribute certain data of some size to 
customers via mail, our customers mail connections very often have strong 
restrictions on mail size, at the same time we don't have control over their 
mail setup, think satellite links. What we want to do is to pre split the 
outgoing mails to particular sizes (dependent on customer) using MIME 
message/partial . What I can't find is API support for this in Camel. At the 
time being we essentially have  a few options (In prioritized order; the order 
of 2 and 3 is likely to change if 3 can be implemented fast):

1.   Somebody points us to the relevant API (or we discover it ourselves)

2.   Find some way of manipulating a mail server to do this for us, 
configurable via  custom mail headers. (We will then have to find such a mail 
server and be able to configure it)

3.   Write a component (Probably a bean) to spit a mail message based on 
MIME related RFCs. (Likely to be problematic as we need to find a solution 
fast.)

4.   Handle the splitting on the application level. (Will have bad 
architectural consequences, the project will then switch character from 
integration to a maintenance project on a couple of components we would 
strongly prefer not to touch.)

Any hints related to solution 1 - 3 would be appreciated, having to go for 4 is 
bad news. 3 is OK if we are able to get it done fast, that is if we are able to 
get a tested solution within a couple of weeks. I consider the writeTo method 
of javax.mail.internet.MimeMessage a good start.



Re: Problem with consumerTemplate and transacted (activeMq) routes

2012-03-06 Thread Christian Müller
Ok, thanks for the info Claus. Let's see how good my search skills are...
;-)

Best,
Christian

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/
>


Re: npe in camel 2.9.1 validator

2012-03-06 Thread Preben.Asmussen
hi claus

created https://issues.apache.org/jira/browse/CAMEL-5063

will do some further investigation tomorrow.

cheers
preben

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


Re: Does Camel supports dynamic routing by getting the routing info from database

2012-03-06 Thread Donald Whytock
Would it be useful to put a "timeout" on a route, such that it's
automatically shut down and GCed if messages don't come through it for
X amount of time?  Thus making dynamic routes more load-driven?

Or would this defeat the purpose of GCing dynamic routes by adding a
timer thread?

Don

On Tue, Mar 6, 2012 at 5:31 AM, Claus Ibsen  wrote:
> Hi
>
> There is also the dynamic router EIP
> http://camel.apache.org/dynamic-router
>
>
>
> On Tue, Mar 6, 2012 at 2:14 AM, johnson0233  wrote:
>> Thanks Guys, now i am getting the idea of dynamic routing, and my new
>> question here is, if i have a central routing manager which can route the
>> message based on rules stores in database, and how could this "routing
>> manager" work with these communication adapters such as ftp, http? As far as
>> i know, ftp component can be triggered if there is new file arrived at a
>> specific folder, and how can "route manager" be triggered or how can "route
>> manager" take responses(retrieve routing info from database for this new
>> file arrived)? Thanks a lot in advance!
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/Does-Camel-supports-dynamic-routing-by-getting-the-routing-info-from-database-tp5537354p5539577.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-06 Thread Claus Ibsen
Hi

Can you log a JIRA ticket.

Its likely that the resource cannot be loaded from the classpath.
Put in details what runtime you use, as loading from classpath can be
tricky on some JEE servers.



On Tue, Mar 6, 2012 at 3:01 PM, Preben.Asmussen  wrote:
> Hi
>
> The new version creates a npe in validator component:
>
> while loading eg. 
>
> from DefaultCamelContext.getEndpoint
>
> full trace:
>
> org.apache.camel.FailedToCreateRouteException: Failed to create route
> dalet-nnp-in-Route at: >>> Transacted[] <<< in route:
> Route[[From[ref:daletFolderEP]] -> [OnException[[class org.a... because of
> Failed to resolve endpoint: validator://BroadcastMonitor.xsd due to: null
>        at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:855)
>        at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:168)
>        at
> org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:710)
>        at
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1734)
>        at
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1526)
>        at
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1421)
>        at
> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:179)
>        at 
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
>        at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1389)
>        at
> org.apache.camel.test.junit4.CamelTestSupport.startCamelContext(CamelTestSupport.java:410)
>        at
> org.apache.camel.test.junit4.CamelTestSupport.doSetUp(CamelTestSupport.java:277)
>        at
> org.apache.camel.test.junit4.CamelTestSupport.setUp(CamelTestSupport.java:204)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>        at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>        at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>        at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
>        at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
>        at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48)
>        at
> org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
>        at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
>        at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
>        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>        at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
>        at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
>        at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>        at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
>        at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>        at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
> resolve endpoint: validator://BroadcastMonitor.xsd due to: null
>        at
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:456)
>        at
> org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:48)
>        at
> org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:183)
>        at
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:106)
>        at
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:112)
>        at
> org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)
>        at
> org.apache.camel.mod

Re: Problem with consumerTemplate and transacted (activeMq) routes

2012-03-06 Thread Claus Ibsen
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/


npe in camel 2.9.1 validator

2012-03-06 Thread Preben.Asmussen
Hi

The new version creates a npe in validator component:

while loading eg. 

from DefaultCamelContext.getEndpoint

full trace:

org.apache.camel.FailedToCreateRouteException: Failed to create route
dalet-nnp-in-Route at: >>> Transacted[] <<< in route:
Route[[From[ref:daletFolderEP]] -> [OnException[[class org.a... because of
Failed to resolve endpoint: validator://BroadcastMonitor.xsd due to: null
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:855)
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:168)
at
org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:710)
at
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1734)
at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1526)
at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1421)
at
org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:179)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1389)
at
org.apache.camel.test.junit4.CamelTestSupport.startCamelContext(CamelTestSupport.java:410)
at
org.apache.camel.test.junit4.CamelTestSupport.doSetUp(CamelTestSupport.java:277)
at
org.apache.camel.test.junit4.CamelTestSupport.setUp(CamelTestSupport.java:204)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48)
at
org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint: validator://BroadcastMonitor.xsd due to: null
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:456)
at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:48)
at
org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:183)
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:106)
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:112)
at
org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)
at
org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)
at
org.apache.camel.model.ProcessorDefinition.createOutputsProcessor(ProcessorDefinition.java:381)
at
org.apache.camel.model.ProcessorDefinition.createOutputsProcessor(ProcessorDefinition.java:130)
at
org.apache.camel.model.ProcessorDefinition.createChildProcessor(ProcessorDefinition.java:149)
at
org.apache.came

Re: Problem with consumerTemplate and transacted (activeMq) routes

2012-03-06 Thread Claus Ibsen
Its not Camel. There is a JIRA ticket in AMQ about this.


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: Camel crashes upon ActiveMQ shutdown

2012-03-06 Thread Christian Schneider

Absolutely.

The camel-example-servlet-tomcat shows how to setup camel in a war and 
how to start it using the spring application context loader listener. 
This is the supported way

of running camel in a servlet container.

Christian


Am 06.03.2012 11:55, schrieb Claus Ibsen:

Hi

You should use a servlet this is how web apps is supposed to be
deployed and have your apps lifecycle handled by the container.





--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com



Re: Camel crashes upon ActiveMQ shutdown

2012-03-06 Thread Claus Ibsen
Hi

You should use a servlet this is how web apps is supposed to be
deployed and have your apps lifecycle handled by the container.


On Mon, Mar 5, 2012 at 4:00 PM, ShlomiJ  wrote:
> Tomcat
>
> A servlet, which is set to be initialized on startup using Tomcat's
> 1 in web.xml, initiates a singleton. That
> singleton holds a CamelContext member.
> This context is initialized exactly as described in my previous post, except
> for the try/catch (this is simply because that the method in the singleton
> that initializes the context declares throwing exception, which the servlet
> catches).
> There is no XML here.
>
> CamelContext context = new DefaultCamelContext();
>>
>> String brokerUri =
>> "failover:(tcp://localhost:61616)?maxReconnectAttempts=-1&initialReconnectDelay=1";
>> ConnectionFactory connectionFactory = new
>> ActiveMQConnectionFactory(brokerUri);
>> context.addComponent("jms",
>> JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
>>
>> context.addRoutes(new RouteBuilder() {
>>
>>               @Override
>>               public void configure() throws Exception
>>               {
>>                               from("jms:queueName")
>>                               .log("${body}");
>>               }
>> });
>> context.start();
>
> Standalone - Spring Style
>
> My main class initiates a org.apache.camel.spring.Main and sets its
> camel-context.xml.
> org.apache.camel.spring.Main.start() is called.
> org.apache.camel.spring.Main.enableHangupSupport is NOT called.
> The camel configuration is as described in my first post.
>
>  class="org.apache.activemq.ActiveMQConnectionFactory">
>>       > value="failover:(tcp://localhost:61616)?maxReconnectAttempts=-1&initialReconnectDelay=1"
>> />
>> 
>> > class="org.apache.activemq.pool.PooledConnectionFactory">
>>       
>>       
>>       
>> 
>> > class="org.apache.camel.component.jms.JmsConfiguration">
>>       
>>       
>>       
>> 
>> > class="org.apache.activemq.camel.component.ActiveMQComponent">
>>       
>> 
>>
>> > xmlns="http://camel.apache.org/schema/spring";>
>>       
>>               
>>               
>>       
>> 
>
> Standalone - Java Style
>
> In this solution my main class creates a new Thread T with an anonymous
> Runnable, and calls T.start().
> The runnable's run method is as described below.
> There is no XML here.
>
> CamelContext context = new DefaultCamelContext();
>>
>> String brokerUri =
>> "failover:(tcp://localhost:61616)?maxReconnectAttempts=-1&initialReconnectDelay=1";
>> ConnectionFactory connectionFactory = new
>> ActiveMQConnectionFactory(brokerUri);
>> context.addComponent("jms",
>> JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
>>
>> try {
>>         context.addRoutes(new RouteBuilder() {
>>
>>                 @Override
>>                 public void configure() throws Exception
>>                 {
>>                         from("jms:queueName")
>>                         .log("${body}");
>>                 }
>>         });
>>         context.start();
>> } catch (Exception e) {
>>         e.printStackTrace();
>> }
>
> So we have 2 solutions with a standalone main, one with spring DSL and the
> other with Java. In both, the application crashes upon ActiveMQ restart.
> And we have one solution in a Tomcat container, using Java. Here the
> application does not crash upon ActiveMQ restart, and a connection is
> successfully established once the broker is up again.
> In ALL of the solutions the application was able to *start before* the
> broker, and later establish a connection once the broker has started (but
> again, 2 of them did not stand during a broker shutdown).
>
> thanks
> SJ
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-crashes-upon-ActiveMQ-shutdown-tp5534910p5537761.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: Does Camel supports dynamic routing by getting the routing info from database

2012-03-06 Thread Claus Ibsen
Hi

There is also the dynamic router EIP
http://camel.apache.org/dynamic-router



On Tue, Mar 6, 2012 at 2:14 AM, johnson0233  wrote:
> Thanks Guys, now i am getting the idea of dynamic routing, and my new
> question here is, if i have a central routing manager which can route the
> message based on rules stores in database, and how could this "routing
> manager" work with these communication adapters such as ftp, http? As far as
> i know, ftp component can be triggered if there is new file arrived at a
> specific folder, and how can "route manager" be triggered or how can "route
> manager" take responses(retrieve routing info from database for this new
> file arrived)? Thanks a lot in advance!
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Does-Camel-supports-dynamic-routing-by-getting-the-routing-info-from-database-tp5537354p5539577.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: SQL Component parameter order?

2012-03-06 Thread dunnlow
I wanted to add, I'm using Spring DSL routes.  

Also after some more thought, I'm thinking of two things to try:

1) come up with a way to create the SQL component parameter definition list
on the fly based upon the order of the headers.

2) Create a converter for my POJO bean from Bean to List and put that pojo
in the message body; hoping that Camel will use that converter to create the
list.  The converter will be responsible for doing a DESCRIBE on the
database and then creating the resulting List using the correct order.

Any thoughts?

--
View this message in context: 
http://camel.465427.n5.nabble.com/SQL-Component-parameter-order-tp5538064p5538182.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: CXF endpoint's address dynamically modified?

2012-03-06 Thread Jens

ychawla wrote
> 
> Currently, you can use the URI format of:
> 
> cxf://someAddress[?options]
> 
> However, then you have have to manually configure CXF features using the
> CXF bus.  However, if you could have a URI interface like below, you can
> configure your CXF features and interceptors on the bean:
> 
> cxf:myCXFBean?address=${in.headers.addressToSendTo}
> 

Just use cxf:bean:myEp where myEP is a cxfEndpoint.

Best,
Jens

--
View this message in context: 
http://camel.465427.n5.nabble.com/CXF-endpoint-s-address-dynamically-modified-tp3349431p5540241.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: CXF endpoint's address dynamically modified?

2012-03-06 Thread Jens

ychawla wrote
> 
> Currently, you can use the URI format of:
> 
> cxf://someAddress[?options]
> 
> However, then you have have to manually configure CXF features using the
> CXF bus.  However, if you could have a URI interface like below, you can
> configure your CXF features and interceptors on the bean:
> 
> cxf:myCXFBean?address=${in.headers.addressToSendTo}
> 

Just use cxf:bean:myEp where myEP is a cxfEndpoint.

Best,
Jens

--
View this message in context: 
http://camel.465427.n5.nabble.com/CXF-endpoint-s-address-dynamically-modified-tp3349431p5540239.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: CXF endpoint's address dynamically modified?

2012-03-06 Thread Jens

ychawla wrote
> 
> Currently, you can use the URI format of:
> 
> cxf://someAddress[?options]
> 
> However, then you have have to manually configure CXF features using the
> CXF bus.  However, if you could have a URI interface like below, you can
> configure your CXF features and interceptors on the bean:
> 
> cxf:myCXFBean?address=${in.headers.addressToSendTo}
> 

Just use cxf:bean:myEp where myEP is a cxfEndpoint.

Best,
Jens

--
View this message in context: 
http://camel.465427.n5.nabble.com/CXF-endpoint-s-address-dynamically-modified-tp3349431p5540238.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: CXF endpoint's address dynamically modified?

2012-03-06 Thread Jens

ychawla wrote
> 
> Currently, you can use the URI format of:
> 
> cxf://someAddress[?options]
> 
> However, then you have have to manually configure CXF features using the
> CXF bus.  However, if you could have a URI interface like below, you can
> configure your CXF features and interceptors on the bean:
> 
> cxf:myCXFBean?address=${in.headers.addressToSendTo}
> 

Just use cxf:bean:myEp where myEP is a cxfEndpoint.

Best,
Jens

--
View this message in context: 
http://camel.465427.n5.nabble.com/CXF-endpoint-s-address-dynamically-modified-tp3349431p5540235.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: CXF endpoint's address dynamically modified?

2012-03-06 Thread Jens

ychawla wrote
> 
> Currently, you can use the URI format of:
> 
> cxf://someAddress[?options]
> 
> However, then you have have to manually configure CXF features using the
> CXF bus.  However, if you could have a URI interface like below, you can
> configure your CXF features and interceptors on the bean:
> 
> cxf:myCXFBean?address=${in.headers.addressToSendTo}
> 

Just use "cxf:bean:myEp" where myEP is a cxfEndpoint.

Best,
Jens

--
View this message in context: 
http://camel.465427.n5.nabble.com/CXF-endpoint-s-address-dynamically-modified-tp3349431p5540234.html
Sent from the Camel - Users mailing list archive at Nabble.com.


[ANNOUNCE] Apache Camel 2.9.1 Released

2012-03-06 Thread hadrian
The Apache Camel project [1] is a powerful open source integration framework 
based on known Enterprise Integration Patterns [2]. 

The Camel PMC made available a new patch release: Apache Camel 2.9.1.
This release includes 109 bug fixes and comes about eight weeks after the 
release of camel-2.9.0.

The artifacts are now published and are ready for you to download [3] either 
from the Apache mirrors or from the Central Maven repository.
For more details please take a look at the release notes [4].

Many thanks to the Camel community for making this release possible.

Hadrian

[1] http://camel.apache.org/
[2] http://camel.apache.org/enterprise-integration-patterns.html
[4] http://camel.apache.org/download.html
[3] http://camel.apache.org/camel-291-release.html


Re: Removing route automatically

2012-03-06 Thread Michael Szalay
Thanks, writing my own route policy worked perfect for me.

Regards Michael

--
Michael Szalay
Senior Software Engineer

basis06 AG, Birkenweg 61, CH-3013 Bern - Fon +41 31 311 32 22
http://www.basis06.ch - source of smart business

- Ursprüngliche Mail -
Von: "Claus Ibsen" 
An: users@camel.apache.org
Gesendet: Dienstag, 6. März 2012 09:09:47
Betreff: Re: Removing route automatically

On Tue, Mar 6, 2012 at 9:07 AM, Michael Szalay
 wrote:
> Hi all
>
> can I remove a route from the context dynamically when its finished?
> I have a set of dynamic generated routes which I want to cleanup after they 
> are run through
> (each route runs only once).
>

Yes see this FAQ
http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html

You need to stop a route first, before you can remove it. There is API
on CamelContext to both stop and remove routes.


> Regards Michael
>
> --
> Michael Szalay
> Senior Software Engineer
>
> basis06 AG, Birkenweg 61, CH-3013 Bern - Fon +41 31 311 32 22
> http://www.basis06.ch - source of smart business
>



--
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: SQL Component parameter order?

2012-03-06 Thread Claus Ibsen
Hi

No it doesnt support a map so you can have a keyed based lookup.
It could possible be a good additon, to allow you to specify the key
name enclosed by # tokens, such as

So you can do something a like:
insert into foo (title, amount) values (#title#, #amount#)

Fell free to create a JIRA ticket in the issue tracker
http://camel.apache.org/support.html


An alternative is to look at MyBatis, its really good for these kind
of SQL mapping
http://camel.apache.org/mybatis
http://mybatis.org/


On Mon, Mar 5, 2012 at 5:28 PM, dunnlow  wrote:
> I have an application that stores a POJO to a database.  I read the attribute
> values from a variety of sources (JMS and XML File).  I have been using a
> bean processor to construct the insert statement which I pass to my jdbc
> endpoint.  This has been working, but now I need to insert more complex
> (HTML) values into an oracle database.  The SQL component seems like is
> would be a good option, however, from my reading it looks like I need an
> ordered list that is directly mapped to the SQL parameters.  This seems
> terribly fragile -- that if database field order changes everything brakes.
> Is there a smart way to handle this problem without adding that dependency
> on database field order?
>
> Thanks for any thoughts,
> -J
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/SQL-Component-parameter-order-tp5538064p5538064.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: Camel Properties Component Cache

2012-03-06 Thread Claus Ibsen
On Mon, Mar 5, 2012 at 11:09 PM, ychawla  wrote:
> Hello All,
> The Camel Properties component is very cool, however there are a few
> enhancements which would make it even better.
>
> First off the 'Cache' property is very nice.  If Cache is set to false, then
> you can change your properties file and Camel will pick up the changes.  The
> default on this is true and you can't update it under the CamelContext:
>
> 
>    location="com/mycompany/myprop.properties"/>
> 
>
> You can however update it by manually configuring the Spring Bean:
>
>         class="org.apache.camel.component.properties.PropertiesComponent">
>            
>            
>        
>
> When doing this configuration on the Spring bean, it won't let you use the
> properties in the simple language:
>
> 
>
> It would be great if 'cache' would be an attribute on 'propertyPlaceholder'.
>

Good idea.

Please create a JIRA ticket. And patches is of course welcome.
http://camel.apache.org/support
http://camel.apache.org/contributing.html



> Thanks,
> Yogesh
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-Properties-Component-Cache-tp5539115p5539115.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: Removing route automatically

2012-03-06 Thread Claus Ibsen
On Tue, Mar 6, 2012 at 9:07 AM, Michael Szalay
 wrote:
> Hi all
>
> can I remove a route from the context dynamically when its finished?
> I have a set of dynamic generated routes which I want to cleanup after they 
> are run through
> (each route runs only once).
>

Yes see this FAQ
http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html

You need to stop a route first, before you can remove it. There is API
on CamelContext to both stop and remove routes.


> Regards Michael
>
> --
> Michael Szalay
> Senior Software Engineer
>
> basis06 AG, Birkenweg 61, CH-3013 Bern - Fon +41 31 311 32 22
> http://www.basis06.ch - source of smart business
>



-- 
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/


Removing route automatically

2012-03-06 Thread Michael Szalay
Hi all

can I remove a route from the context dynamically when its finished?
I have a set of dynamic generated routes which I want to cleanup after they are 
run through 
(each route runs only once).

Regards Michael

-- 
Michael Szalay
Senior Software Engineer

basis06 AG, Birkenweg 61, CH-3013 Bern - Fon +41 31 311 32 22
http://www.basis06.ch - source of smart business