Re: Quartz clustering in camel spring DSL - JIRA CAMEL-8076

2014-11-25 Thread Willem Jiang
Did you clean up your database after testing?
S.NO.  TRIGGER_GROUP      JOB_NAME  JOB_GROUP  NEXT_FIRE_TIME  PREV_FIRE_TIME  
PRIORITY  TRIGGER_STATE TRIGGER_TYPE 
1.     RECOVERING_JOBS    quartz    cluster    141690540     -1             
 5        SIMPLE        WAITING 
2.     cluster            quartZ    cluster    141690564     141690540  
 5        CRON          WAITING 

The RECOVERING_JOBS JOB_Name is quartz, but the cluster JOB_NAME is quartZ.
The laster character name is different.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 26, 2014 at 2:28:07 PM, selva (sgpsel...@gmail.com) wrote:
> Hi Willem,
>  
> I have defined one quartz2 endpoint route and one sub route in
> camel-context.xml file . Whenever the quartz scheduler triggers , the quartz
> end point will call the sub route using direct component. I am printing some
> text in console using bean processor(QueryBuilderProcessor) which is defined
> in sub route.
>  
> > class="cluster.quartz.QueryBuilderProcessor" />
>  
> > uri="quartz2://cluster/quartz?cron=0+0/4+++*+?&durableJob=true&stateful=true&recoverableJob=true">
> >   
> //calling sub rout
> here.
> ...
>  
>  
>  
>  
>  
>  
>  
>  
>  
> My cluster configuration:
> I have followed below Link to set up Clustering with the JDBC-Jobstore.
>  
> http://www.quartz-scheduler.org/documentation/quartz-2.x/configuration/ConfigJDBCJobStoreClustering
>   
> I have quartz.properties file in resource folder like
> org/quartz/quartz.properties.
>  
> org.quartz.scheduler.instanceName = ClusteredScheduler
> org.quartz.scheduler.instanceId = AUTO
> org.quartz.jobStore.isClustered = true
> ...
> org.quartz.plugin.triggerHistory.class=org.quartz.plugins.history.LoggingTriggerHistoryPlugin
>   
> org.quartz.plugin.triggerHistory.triggerFiredMessage=Trigger [{1}.{0}] fired  
> job [{6}.{5}] scheduled at: {2, date, dd-MM- HH:mm:ss.SSS}, next
> scheduled at: {3, date, dd-MM- HH:mm:ss.SSS}
> org.quartz.plugin.triggerHistory.triggerCompleteMessage=Trigger [{1}.{0}]  
> completed firing job [{6}.{5}] with resulting trigger instruction code: {9}.
> Next scheduled at: {3, date, dd-MM- HH:mm:ss.SSS}
> org.quartz.plugin.triggerHistory.triggerMisfiredMessage=Trigger [{1}.{0}]  
> misfired job [{6}.{5}]. Should have fired at: {3, date, dd-MM-
> HH:mm:ss.SSS}
> org.quartz.plugin.jobHistory.class=org.quartz.plugins.history.LoggingJobHistoryPlugin
>   
> org.quartz.plugin.jobHistory.jobToBeFiredMessage=Job [{1}.{0}] to be fired
> by trigger [{4}.{3}], re-fire: {7}
> org.quartz.plugin.jobHistory.jobSuccessMessage=Job [{1}.{0}] execution
> complete and reports: {8}
> org.quartz.plugin.jobHistory.jobFailedMessage=Job [{1}.{0}] execution failed  
> with exception: {8}
> org.quartz.plugin.jobHistory.jobWasVetoedMessage=Job [{1}.{0}] was vetoed.  
> It was to be fired by trigger [{4}.{3}] at: {2, date, dd-MM-
> HH:mm:ss.SSS}
>  
>  
> QueryBuilderProcessor.java
>  
> public void process(Exchange exchange) throws Exception {
> LOGGER.info("Started");
> System.out.println(processor started**");
> Thread.sleep(1);
> System.out.println(processor Ends**);
>  
> }
>  
> Test case:
>  
> I am running the same camel application as standalone using
> org.apache.camel.spring.Main class in two eclipse instance in same machine,
> So by default clock is sync.
>  
> Two Node:
> 1. Eclipse Instance 1:(Node1) First I am starting application from eclipse
> instance 1 , based on quartz properties file Quartz tables are populated
> with the job details.
>  
> 2.Eclipse Instance 2:(Node2) I am starting same application from eclipse
> instance 2.
>  
> Both instance are started and could see their scheduler entries (Node1 &
> Node2) in qrtz_scheduler_state table.
>  
> Stopping Job:
>  
> Constantly I watching the TRIGGER_STATE column of job in *qrtz_triggers*
> table & console for two camel application.
>  
> step1 : Initially Trigger state will be "WAITING"
> stept2: Once the Trigger state changed to "AQUIRED" , I go back to console
> find the which node picked the job.
> step3: Assume processor started**" printed from
> QueryBuilderProcessor.java(Node1) and Immediately terminate the Node1 by
> clicking terminate button in eclipse.
> step4: Now current TRIGGER state is "BLOCKED".
> step5: I could see the recovery logs in Node2 console.(Which is mentioned in
> the above question).
>  
> *My doubt is , if you see the Recovering job trigger details in
> *qrtz_triggers* table above question, TRIGGER_TYPE is SIMPLE, but we defined
> in our route is CRON type*.
>  
> Please refer the section "*Captured in qrtz_triggers table*" in above
> question.
>  
> I think the problem is CRON type, Recovery Job Tigger type should be CRON
> right?
>  
>  
> Thanks,
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Q

RE: camel - xml

2014-11-25 Thread Siano, Stephan
"/row/EMPNO/text()), String.class" is really not a valid XPath. You probably 
want to terminate the String before the comma...

-Original Message-
From: smilevasu6 [mailto:srinivas.thu...@gmail.com] 
Sent: Mittwoch, 26. November 2014 08:21
To: users@camel.apache.org
Subject: camel - xml

Hi,

I am having xml data like 



7369
SMITH
800
10


7499
SMITH>
1600
20


7521
SMITH
1250
30


7566
SMITH
2975
20




I am writing  a camel router like,

from("file:C://Sri/?fileName=table_export_new.xml").
//to("file:C://Sri/table_export_new.xml").
setHeader("results", xpath("/row/EMPNO/text()), String.class")).
setHeader("results", xpath("/row/ENAME/text()), String.class")).
setHeader("results", xpath("/row/SAL/text()), String.class")).
setHeader("results", xpath("/row/DEPTNO/text()), String.class"))
//.convertBodyTo(String.class)
.end();

And i am getting error as 

org.apache.camel.builder.xml.InvalidXPathExpression: Invalid
xpath:/row/EMPNO/text()), String.class. Reason:
javax.xml.xpath.XPathExpressionException

Can you please help me on this?

After this i want to put the data into database as well.

Please 




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


camel - xml

2014-11-25 Thread smilevasu6
Hi,

I am having xml data like 



7369
SMITH
800
10


7499
SMITH>
1600
20


7521
SMITH
1250
30


7566
SMITH
2975
20




I am writing  a camel router like,

from("file:C://Sri/?fileName=table_export_new.xml").
//to("file:C://Sri/table_export_new.xml").
setHeader("results", xpath("/row/EMPNO/text()), String.class")).
setHeader("results", xpath("/row/ENAME/text()), String.class")).
setHeader("results", xpath("/row/SAL/text()), String.class")).
setHeader("results", xpath("/row/DEPTNO/text()), String.class"))
//.convertBodyTo(String.class)
.end();

And i am getting error as 

org.apache.camel.builder.xml.InvalidXPathExpression: Invalid
xpath:/row/EMPNO/text()), String.class. Reason:
javax.xml.xpath.XPathExpressionException

Can you please help me on this?

After this i want to put the data into database as well.

Please 




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


Re: camel xmljson add @ signs to the json output. how to remove the @ signs

2014-11-25 Thread Claus Ibsen
Hi

Did you get in contact with the xmjson team about the issue and if
they are willing to add a flag to turn this on/off etc?

On Tue, Nov 18, 2014 at 9:18 AM, Claus Ibsen  wrote:
> Hi
>
> Ah great to know it was hardcoded. I would suggest to ask them to add
> an option so you can turn that off. As there are use cases where you
> only need a one way transformation.
>
> They could also consider different strategies how to control this
> mapping. So there is a default strategy that does as today. And then
> people can switch to different ones, such as one that simply dont
> include those signs. And another that allow end users to provide their
> own mapping code to have 100% control how they want to do that.
>
> An alternative is that we introduce an option in the Camel component
> but then it would need to process the output message and remove those
> @ signs. But its IMHO better to improve this in the xmljson library
> itself.
>
> On Mon, Nov 17, 2014 at 9:10 PM, salemi  wrote:
>> Hi Clause,
>>
>> I looked at their json-lib code and based on what I read they need to have
>> the @ sign for the attributes and # for the text elements.
>> They need those "annotations" to be able to covert a json properly back to
>> xml. The @ and # signs are hard coded in their code.
>>
>> Do you think I should asked to change the code?
>>
>> Ali
>>
>>
>>
>>
>>
>> -
>> Alireza Salemi
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/camel-xmljson-add-signs-to-the-json-output-how-to-remove-the-signs-tp5759013p5759220.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> Email: cib...@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: xmljson component failing to do json>xml conversion

2014-11-25 Thread Claus Ibsen
Hi

Converting first to a string should allow the unmarshal to read the
data as an input stream.
Are you still having trouble with this?

Also you can take a look at the unit tests of camel-xmljson to find samples

On Fri, Nov 21, 2014 at 11:15 PM, clinton  wrote:
> Using camel's xmljson, I had no problem converting XML into JSON using
> "marshal"
> When I tried to do the reverse it failed. (unmarshal)
> The "body" that was in place was a DBObject I had just retrieved from
> Mongodb.
> I tried converting to a string first too.  Didn't work.
> I'm using 2.13  Spring DSL
>
> The error is:
> org.apache.camel.InvalidPayloadException: No body available of type:
> java.io.InputStream but has value: --quotes my json string here--
>
> Any guidance appreciated.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/xmljson-component-failing-to-do-json-xml-conversion-tp5759488.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: Servlet component matchOnUriPrefix is not working as documented

2014-11-25 Thread Claus Ibsen
What version of Camel do you use?

And as a workaround then try flip the order of the 2 routes.

On Tue, Nov 25, 2014 at 11:36 PM, Amit  wrote:
> We are using Servlet component and we route two routes as below. When i send
> request to (route2) myservice/v1/ it process by route1.
>
> As per Servlet component document  "CamelServlet should try to find a target
> consumer by matching the URI prefix, if no exact match is found."
> is not valid.
>
>
>
>
> route1
> 
> http://camel.apache.org/schema/spring"; trace="true">
>   
>   
> 
>
> route2
> =
> http://camel.apache.org/schema/spring"; trace="true">
>   
> 
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Servlet-component-matchOnUriPrefix-is-not-working-as-documented-tp5759604.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: how do I transform a BSON into JSON using Camel message transformation pattern

2014-11-25 Thread Claus Ibsen
Hi

You can write some java code that does that, or try a regular
expression to replace the ts part. You can then call the java code
from the Camel route to transform the message.



On Tue, Nov 25, 2014 at 8:51 PM, gmh  wrote:
>
> All,
> I am reading the oplog of Mongodb in my project in order to synch with
> redis.
> The BSON data I am capturing has the following format.
> {
>  "ts": Timestamp(1415124334, 1),
> "op": "i",
> "ns": "test.products",
> "o": {
> "_id": ObjectId("5459156e7950e8c18c094992"),
> "item": "card",
> "qty": 15
> }
> }
> The problem I am having is with the ts name:value pair.
> As the data indicates it is not a json so I can not marshall/unmarshall it.
> I do not care if the timestamp is there. So I want to know if there is a way
> I can transform this bson data by removing the ts name: value pair by using
> a Camel component? So the final data would look like this
> {
> "op": "i",
> "ns": "test.products",
> "o": {
> "_id": ObjectId("5459156e7950e8c18c094992"),
> "item": "card",
> "qty": 15
> }
> }
>
> and can be unmarshalled?
> Gordon
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/how-do-I-transform-a-BSON-into-JSON-using-Camel-message-transformation-pattern-tp5759598.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: Quartz clustering in camel spring DSL - JIRA CAMEL-8076

2014-11-25 Thread selva
Hi Willem,

I have defined one quartz2 endpoint route and one sub route in
camel-context.xml file . Whenever the quartz scheduler triggers , the quartz
end point will call the sub route using direct component. I am printing some
text in console using bean processor(QueryBuilderProcessor) which is defined
in sub route.




//calling sub rout
here.
...









My cluster configuration: 
I have followed below Link to set up Clustering  with the JDBC-Jobstore.

http://www.quartz-scheduler.org/documentation/quartz-2.x/configuration/ConfigJDBCJobStoreClustering
I have quartz.properties file in  resource folder like
org/quartz/quartz.properties.

org.quartz.scheduler.instanceName = ClusteredScheduler
org.quartz.scheduler.instanceId = AUTO
org.quartz.jobStore.isClustered = true
...
org.quartz.plugin.triggerHistory.class=org.quartz.plugins.history.LoggingTriggerHistoryPlugin
org.quartz.plugin.triggerHistory.triggerFiredMessage=Trigger [{1}.{0}] fired
job [{6}.{5}] scheduled at: {2, date, dd-MM- HH:mm:ss.SSS}, next
scheduled at: {3, date, dd-MM- HH:mm:ss.SSS}
org.quartz.plugin.triggerHistory.triggerCompleteMessage=Trigger [{1}.{0}]
completed firing job [{6}.{5}] with resulting trigger instruction code: {9}.
Next scheduled at: {3, date, dd-MM- HH:mm:ss.SSS}
org.quartz.plugin.triggerHistory.triggerMisfiredMessage=Trigger [{1}.{0}]
misfired job [{6}.{5}]. Should have fired at: {3, date, dd-MM-
HH:mm:ss.SSS}
org.quartz.plugin.jobHistory.class=org.quartz.plugins.history.LoggingJobHistoryPlugin
org.quartz.plugin.jobHistory.jobToBeFiredMessage=Job [{1}.{0}] to be fired
by trigger [{4}.{3}], re-fire: {7}
org.quartz.plugin.jobHistory.jobSuccessMessage=Job [{1}.{0}] execution
complete and reports: {8}
org.quartz.plugin.jobHistory.jobFailedMessage=Job [{1}.{0}] execution failed
with exception: {8}
org.quartz.plugin.jobHistory.jobWasVetoedMessage=Job [{1}.{0}] was vetoed.
It was to be fired by trigger [{4}.{3}] at: {2, date, dd-MM-
HH:mm:ss.SSS}


QueryBuilderProcessor.java

public void process(Exchange exchange) throws Exception {
LOGGER.info("Started");
System.out.println(processor started**");
Thread.sleep(1);
System.out.println(processor Ends**);
 
}

Test case:

  I am running the same camel application as standalone using
org.apache.camel.spring.Main class in two eclipse instance in same machine,
So by default clock is sync.
  
  Two Node: 
  1. Eclipse Instance 1:(Node1) First I am starting application from eclipse
instance 1 , based on quartz properties file Quartz tables arepopulated
with the job details.

  2.Eclipse Instance 2:(Node2) I am  starting same application from eclipse
instance 2.

Both instance are started and could see their scheduler entries (Node1 &
Node2) in qrtz_scheduler_state table.

Stopping Job:

Constantly I watching  the TRIGGER_STATE column of job in  *qrtz_triggers*
table & console for two camel application. 

step1 : Initially Trigger state will be "WAITING"
stept2: Once the Trigger state changed to "AQUIRED" , I go back to console
find the which node picked the job.
step3: Assume  processor started**" printed  from
QueryBuilderProcessor.java(Node1) and Immediately terminate the Node1 by
clicking terminate button in eclipse.
step4: Now current TRIGGER state is "BLOCKED".
step5: I could see the recovery logs in Node2 console.(Which is mentioned in
the above question). 

*My doubt is , if you see the Recovering job trigger details in
*qrtz_triggers* table above question, TRIGGER_TYPE is SIMPLE, but we defined
in our route is CRON type*.

Please refer the section "*Captured in qrtz_triggers table*" in above
question.

I think the problem is CRON type, Recovery Job Tigger type should be CRON
right?


Thanks,




--
View this message in context: 
http://camel.465427.n5.nabble.com/Quartz-clustering-in-camel-spring-DSL-JIRA-CAMEL-8076-tp5759589p5759614.html
Sent from the Camel - Users mailing list archive at Nabble.com.


rest client - post a json content to and http enpoint

2014-11-25 Thread salemi
Hi All,

I am currently using the cxf-rs to send request to a rest endpoint.
Unfortunately the cxf-rs don't work in our new container due to some class
loading issues I can't resolve.

What other library can use to implement a rest client and is there any
example for posting a json content to the endpoint?

Thanks,
Ali



-
Alireza Salemi
--
View this message in context: 
http://camel.465427.n5.nabble.com/rest-client-post-a-json-content-to-and-http-enpoint-tp5759600.html
Sent from the Camel - Users mailing list archive at Nabble.com.


How to pass decrypted password from a bean to FTP uri using camel spring DSL

2014-11-25 Thread Rah
Is there any way to pass the password dynamically to the FTP uri in camel
Spring DSL.

I tried in the following way which didn't work.Can some one please throw
some light to resolve this issue.





{{ftp.password}} will be in the encrypted form reading it from the
properties file.


Thanks in Advance



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-pass-decrypted-password-from-a-bean-to-FTP-uri-using-camel-spring-DSL-tp5759613.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: rest client - post a json content to and http enpoint

2014-11-25 Thread Willem Jiang
I’m so glad to see you already find a way to resolve this kind of issue.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 26, 2014 at 5:36:42 AM, scottdawson (sc.e.daw...@gmail.com) wrote:
> Ali,
> We use the http4 Camel component for POSTing JSON to a REST service, for
> example:
>  
>  
> Regards,
> Scott
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/rest-client-post-a-json-content-to-and-http-enpoint-tp5759600p5759602.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: Temporary queues, or, jms uri from camel uri?

2014-11-25 Thread Willem Jiang
Camel JMS Consumer doesn’t need to specify the replyTo option from the 
endpoint, as it just read the JMS property  to find out the Jms destination to 
send the reply message.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 19, 2014 at 1:48:13 PM, Gary Kennedy (g...@apnic.net) wrote:
> So I want to talk to a system that will send back several reply messages for 
> a given command  
> message.
>  
> The general idea is to have a specific route that will process the reply 
> messages. (maybe  
> behind an aggregator/resequencer, maybe not)
>  
> Since the plan is to (eventually) use this in a production environment, I 
> want to use a  
> temporary queue for the replies rather than a shared queue.
>  
> The basic template at the moment:
>  
>  
> < !-- magic here -- >
> < !-- prep a command message -- >
> < !-- now to send the command message -- >
>  
>  
>  
>  
>  
>  
> < !-- more magic -- >
>  
>  
> So the main question is how can I get {{temp-queue}} to expand to the JMS 
> specific uri of  
> the Camel uri "jms:temp:queue:client-replies"?
>  
> But if anyone knows how to deal with temporary queues other solutions would 
> be welcome.  
> :)
>  
> Cheers,
> Gary
>  
>  



Re: Where to do context setup stuff in a guice enabled camel app

2014-11-25 Thread Willem Jiang
It’s not a good idea to setup the camel context inside the RouteBuilder, as it 
could have some side effect on the other RouteBuilder.

CamelContext support to inject the registry, but it doesn’t supper to 
addRoutePolicyFactory.
You may need to find other way to add the RoutePolicyFactory, such as extends 
the GuiceCamelContext to made the startUpLogic injectable.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 25, 2014 at 5:11:07 PM, dermoritz (tantea...@hotmail.com) wrote:
> i am using guice in conjunction with "CamelModule" in my camel application
> (standalone using Main). In my case i need to do some things on the context
> before starting it:
>  
> context.addRoutePolicyFactory(startUpLogic);
> context.getRegistry(JndiRegistry.class).bind(CepModule.LOOKUP_DATASOURCE,  
> ds);
>  
> But i am not sure where to put this lines. At the moment this lines are
> added in constructor of my main RouteBuilder that is adding all other
> RoutBuilders. (do context setup stuff in route builder feels wrong)
> Alternativly i could put this lines into this method (mandatory if using
> CepModule)
> @Provides
> @Inject
> private Set getRoutes(final RouteBuilder routes)
>  
> I just would inject context but it also feels wrong to do this here. So is
> there a good way/practice to hook into before starting and doing this kind
> of setup?
>  
> thanks in advance
>  
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Where-to-do-context-setup-stuff-in-a-guice-enabled-camel-app-tp5759574.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: Best way for reusing routes

2014-11-25 Thread Bilgin Ibryam
Thanks Claus.
And from top of your head, can you tell me how much is 1 and 2 different to
defining routes in a  element?

My guess is that I have to go with Java DSL to be on the safe side and be
sure that the route definitions will function properly and reused in
different camel contexts defined in blueprint... Is that true?


On 25 November 2014 at 13:06, Claus Ibsen  wrote:

> 1 and 2 boils down to the same.
>
>  will load the routes the same was as #1 does.
>
> On Tue, Nov 25, 2014 at 12:18 PM, Bilgin Ibryam  wrote:
> > Hi all,
> >
> > I'd like to write couple of route definitions that will be reused in
> > multiple places.
> >
> > If I use the Java DSL it is straight forward, I can reuse the
> RouteBuilder
> > class in many places, but I want to use the XML DSL and I can see two
> > options:
> >
> > 1. Use  statements. Looks like it is mostly used for unit tests.
> > 2. Use routeContext to define the routes.
> >
> > Can anyone tell me what is the difference and the intended use of 1 and
> 2?
> >
> > What limitations they have compared to normal routes defined in Java DSL
> or
> > XML DSL?
> >
> >
> > [1] http://camel.apache.org/loading-routes-from-xml-files.html
> > [2]
> http://camel.apache.org/how-do-i-import-routes-from-other-xml-files.html
> >
> > TIA,
> >
> > --
> > Bilgin Ibryam
> >
> > Red Hat, Inc.
> > Apache Camel & Apache OFBiz committer
> > Blog: ofbizian.com
> > Twitter: @bibryam 
> >
> > Author of Instant Apache Camel Message Routing
> > http://www.amazon.com/dp/1783283475
>
>
>
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> Email: cib...@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/
>



-- 
Bilgin Ibryam

Red Hat, Inc.
Apache Camel & Apache OFBiz committer
Blog: ofbizian.com
Twitter: @bibryam 

Author of Instant Apache Camel Message Routing
http://www.amazon.com/dp/1783283475


Re: Quartz clustering in camel spring DSL - JIRA CAMEL-8076

2014-11-25 Thread Willem Jiang
I did some test on my side, I cannot reproduce the error that you meet.
From the failure with recovery log that you showed, The next scheduled is null 
and Camel Job cannot find the QuartzEndpoint.

2014-11-25 12:29:08,599 [ontext_Worker-1] INFO LoggingTriggerHistoryPlugin 
- Trigger [RECOVERING_JOBS.recover_16898502964_1416898727319] fired job 
[cluster.quartz] scheduled at: 25-11-2014 12:28:00.000, next scheduled at: 
null 

2014-11-25 12:29:08,600 [ontext_Worker-1] INFO LoggingJobHistoryPlugin 
- Job [cluster.quartz] to be fired by trigger 
[RECOVERING_JOBS.recover_16898502964_1416898727319], re-fire: 0 
2014-11-25 12:29:08,604 [ontext_Worker-1] WARN CamelJob 
- Cannot find existing QuartzEndpoint with uri: 
quartz2://cluster/quartz?cron=0+0%2F4+*+*+*+%3F&recoverableJob=true&stateful=true.
 
Creating new endpoint instance.

Can you tell me how did you stop the job ?
What’s your quartz cluster looks like ?
If you have a test case to share, it could help us to resolve the issue more 
easily.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 25, 2014 at 9:56:46 PM, selva (sgpsel...@gmail.com) wrote:
> Hi Willem,
>  
> I have tested with camel 2.14.1-SNAPSHOT and the exception is gone but
> QueryBuilderProcessor is not getting called from quartz end point.
>  
> Please find below configuration and logging information for both recovery
> and success scenario. In success scenario QueryBuilderProcessor is getting
> called from quartz endpoint and able see some system.out.printl statement in
> success case but its failing in recovery case.
>  
> Please help me to solve this issue.
>  
> Route Configuration:
>  
>  
> > uri="quartz2://cluster/quartz?cron=0+0/4+++*+?&durableJob=true&stateful=true&recoverableJob=true">
> >   
> //calling sub rout here.
> ...
>  
>  
>  
>  
>  
>  
>  
> Please find the below logs for Calling QueryBuilderProcessor from quartz
> endpoint:
> =
>   
>  
> Case 1 : //Logs for Immediate recovery : failure with recovery
> ---
> 2014-11-25 12:28:47,319 [_ClusterManager] INFO JobStoreTX
> - ClusterManager: detected 1 failed or restarted instances.
> 2014-11-25 12:28:47,319 [_ClusterManager] INFO JobStoreTX
> - ClusterManager: Scanning for instance "16898502964"'s failed in-progress
> jobs.
> 2014-11-25 12:28:56,675 [_ClusterManager] INFO JobStoreTX
> - ClusterManager: ..Scheduled 1 recoverable job(s) for recovery.
> 2014-11-25 12:29:08,599 [ontext_Worker-1] INFO LoggingTriggerHistoryPlugin
> - Trigger [RECOVERING_JOBS.recover_16898502964_1416898727319] fired job
> [cluster.quartz] scheduled at: 25-11-2014 12:28:00.000, next scheduled at:
> null
> 2014-11-25 12:29:08,600 [ontext_Worker-1] INFO LoggingJobHistoryPlugin
> - Job [cluster.quartz] to be fired by trigger
> [RECOVERING_JOBS.recover_16898502964_1416898727319], re-fire: 0
> 2014-11-25 12:29:08,604 [ontext_Worker-1] WARN CamelJob
> - Cannot find existing QuartzEndpoint with uri:
> quartz2://cluster/quartz?cron=0+0%2F4+*+*+*+%3F&recoverableJob=true&stateful=true.
>   
> Creating new endpoint instance.
> 2014-11-25 12:29:09,514 [ontext_Worker-1] INFO QuartzEndpoint
> - Job cluster.quartz (triggerType=CronTriggerImpl,
> jobClass=StatefulCamelJob) is scheduled. Next fire date is null
> 2014-11-25 12:29:09,526 [ontext_Worker-1] INFO LoggingJobHistoryPlugin
> - Job [cluster.quartz] execution complete and reports: null
> 2014-11-25 12:29:09,528 [ontext_Worker-1] INFO LoggingTriggerHistoryPlugin
> - Trigger [RECOVERING_JOBS.recover_16898502964_1416898727319] completed
> firing job [cluster.quartz] with resulting trigger instruction code: DELETE
> TRIGGER. Next scheduled at: null
>  
>  
> case 2: //Normal flow : success
> ---
> 2014-11-25 12:32:04,901 [ontext_Worker-2] INFO LoggingTriggerHistoryPlugin
> - Trigger [cluster.quartz] fired job [cluster.quartz] scheduled at:
> 25-11-2014 12:32:00.000, next scheduled at: 25-11-2014 12:36:00.000
> 2014-11-25 12:32:04,902 [ontext_Worker-2] INFO LoggingJobHistoryPlugin
> - Job [cluster.quartz] to be fired by trigger [cluster.quartz], re-fire: 0
> 2014-11-25 12:32:04,958 [ontext_Worker-2] INFO QueryBuilderProcessor -
> Started
> processor started**//system.out line from QueryBuilderProcessor
> processor Ends**
> 2014-11-25 12:32:16,658 [ontext_Worker-2] INFO LoggingJobHistoryPlugin
> - Job [cluster.quartz] execution complete and reports: null
> 2014-11-25 12:32:16,658 [ontext_Worker-2] INFO LoggingTriggerHistoryPlugin
> - Trigger [cluster.quartz] completed firing job [cluster.quartz] with
> resulting trigger instruction code: DO NOTHING. Next scheduled at:
> 25-11-2014 12:36:00.000
>  
>  
> Captured in qrtz_triggers table:
>  
> S.NO. TRIGGER_GROUP JOB_NAME JOB_GROUP NEXT_FI

Re: CXF component attachment support for POJO not implemented as specified

2014-11-25 Thread Willem Jiang

If we cannot access the attachment from the the MessageContentList in POJO 
model, the solution sounds good.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 26, 2014 at 5:11:18 AM, Paul McCulloch (pkmccull...@gmail.com) 
wrote:
> Is it worth my while to submit a patch to support inbound anonymous
> attachments, I guess with some configuration option to enable the feature?
>  
> Paul
>  
> On 21 November 2014 at 17:26, Paul McCulloch wrote:
>  
> > I should probably add that I am trying to handle 'anonymous' attachments -
> > they are not referenced in the WSDL at all.
> >
> > On 21 November 2014 09:36, Paul McCulloch wrote:
> >
> >> This test cases are for MTOM though I think. I need to use SOAP with
> >> Attachments for my service.
> >>
> >> Thanks again,
> >>
> >> Paul
> >>
> >> On 21 November 2014 05:41, Willem Jiang wrote:
> >>
> >>> The attachment is mapped by CXF into the MessageContentList.
> >>> Here is an unit test[1] in camel-cxf for it, you can find the wsdl file
> >>> here[2]
> >>>
> >>>
> >>> [1]
> >>> https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/mtom/CxfMtomConsumerTest.java
> >>>   
> >>> [2]
> >>> https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/resources/mtom.wsdl
> >>>   
> >>>
> >>> --
> >>> Willem Jiang
> >>>
> >>> Red Hat, Inc.
> >>> Web: http://www.redhat.com
> >>> Blog: http://willemjiang.blogspot.com (English)
> >>> http://jnn.iteye.com (Chinese)
> >>> Twitter: willemjiang
> >>> Weibo: 姜宁willem
> >>>
> >>>
> >>>
> >>> On November 21, 2014 at 2:48:50 AM, Paul McCulloch (
> >>> pkmccull...@gmail.com) wrote:
> >>> > Thanks for getting back to me Willem. I'm afraid I don't understand
> >>> your
> >>> > reply though! What do you mean by "the POJO parameter list"?
> >>> >
> >>> > I thought you might mean that the attachments get added as additional
> >>> > entries to the MessageContentList - but that doesn't seem to be the
> >>> case. I
> >>> > had a look through the source and can't find anywhere that the
> >>> incoming CXF
> >>> > attachment is propagated to the POJO, message or exchange.
> >>> >
> >>> > My use case is implementing a WSD first SOAP service supporting Soap
> >>> > with attachments on incoming messages.
> >>> >
> >>> > Thanks,
> >>> >
> >>> > Paul
> >>> >
> >>> > On 20 November 2014 04:25, Willem Jiang wrote:
> >>> >
> >>> > > Hi Paul,
> >>> > >
> >>> > > For the POJO, we don’t want to export the attachment from message to
> >>> the
> >>> > > user as the user can access the attachment from the POJO parameter
> >>> list.
> >>> > > If we expose the attachment throw the message API for the POJO data
> >>> > > formate, it could cause some trouble if the user makes some changes
> >>> through
> >>> > > the message and POJO parameter list at same time.
> >>> > >
> >>> > > --
> >>> > > Willem Jiang
> >>> > >
> >>> > > Red Hat, Inc.
> >>> > > Web: http://www.redhat.com
> >>> > > Blog: http://willemjiang.blogspot.com (English)
> >>> > > http://jnn.iteye.com (Chinese)
> >>> > > Twitter: willemjiang
> >>> > > Weibo: 姜宁willem
> >>> > >
> >>> > >
> >>> > >
> >>> > > On November 20, 2014 at 12:53:17 AM, pkmcculloch (
> >>> pkmccull...@gmail.com)
> >>> > > wrote:
> >>> > > > I agree that the work for CAMEL-7181 doesn't cover all cases.
> >>> Looking at
> >>> > > the
> >>> > > > current source I see a couple of issues:
> >>> > > >
> >>> > > > 1) populateExchangeFromCxfRequest(Exchange, Exchange) doesn't check
> >>> > > > MTOM_ENABLED - it never includes attachments for POJOs
> >>> > > >
> >>> > > > 2) populateCxfResponseFromExchange(Exchange, Exchange) - the same
> >>> issue.
> >>> > > >
> >>> > > > Can someone re-open the JIRA task? Or should I log a new one?
> >>> > > >
> >>> > > > I'm quite happy to make the fixes. What's the best format to
> >>> submit the
> >>> > > fix
> >>> > > > - patch or pull request?
> >>> > > >
> >>> > > > Thanks,
> >>> > > >
> >>> > > > Paul
> >>> > > >
> >>> > > >
> >>> > > >
> >>> > > > --
> >>> > > > View this message in context:
> >>> > >
> >>> http://camel.465427.n5.nabble.com/CXF-component-attachment-support-for-POJO-not-implemented-as-specified-tp5746952p5759332.html
> >>>   
> >>> > > > Sent from the Camel - Users mailing list archive at Nabble.com.
> >>> > > >
> >>> > >
> >>> > >
> >>> >
> >>>
> >>>
> >>
> >
>  



Re: Temporary queues, or, jms uri from camel uri?

2014-11-25 Thread Minh Tran
I don't know if the Camel JMS component knows how to read from a temporary 
queue as a consumer. I don't see it listed in the documentation. It certainly 
knows about it as a producer.

You could always implement the listener side using Spring's 
DefaultMessageListenerContainer directly which can support the temporary queue 
destination and then from there push the message back onto a Camel route via a 
producer template. 

On 26/11/2014, at 8:57 AM, Gary Kennedy  wrote:

> I'll take it that the answer is "Not possible".
> 
> Cheers,
> Gary
> 
> On 19 Nov 2014, at 3:42 pm, Gary Kennedy  wrote:
> 
>> So I want to talk to a system that will send back several reply messages for 
>> a given command message.
>> 
>> The general idea is to have a specific route that will process the reply 
>> messages. (maybe behind an aggregator/resequencer, maybe not)
>> 
>> Since the plan is to (eventually) use this in a production environment, I 
>> want to use a temporary queue for the replies rather than a shared queue.
>> 
>> The basic template at the moment:
>> 
>>   
>>   < !-- magic here -- >
>>   < !-- prep a command message -- >
>>   < !-- now to send the command message -- >
>>   > uri="jms:queue:systemCommands?preserveMessageQos=true&replyTo={{temp-queue}}>"/>
>>   
>> 
>>   
>>   
>> 
>>   < !-- more magic -- >
>>   
>> 
>> So the main question is how can I get {{temp-queue}} to expand to the JMS 
>> specific uri of the Camel uri "jms:temp:queue:client-replies"?
>> 
>> But if anyone knows how to deal with temporary queues other solutions would 
>> be welcome. :)
>> 
>> Cheers,
>> Gary
>> 
> 



Servlet component matchOnUriPrefix is not working as documented

2014-11-25 Thread Amit
We are using Servlet component and we route two routes as below. When i send
request to (route2) myservice/v1/ it process by route1.

As per Servlet component document  "CamelServlet should try to find a target
consumer by matching the URI prefix, if no exact match is found."
is not valid. 




route1

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



route2
=
http://camel.apache.org/schema/spring"; trace="true">







--
View this message in context: 
http://camel.465427.n5.nabble.com/Servlet-component-matchOnUriPrefix-is-not-working-as-documented-tp5759604.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Temporary queues, or, jms uri from camel uri?

2014-11-25 Thread Gary Kennedy
I'll take it that the answer is "Not possible".

Cheers,
Gary

On 19 Nov 2014, at 3:42 pm, Gary Kennedy  wrote:

> So I want to talk to a system that will send back several reply messages for 
> a given command message.
> 
> The general idea is to have a specific route that will process the reply 
> messages. (maybe behind an aggregator/resequencer, maybe not)
> 
> Since the plan is to (eventually) use this in a production environment, I 
> want to use a temporary queue for the replies rather than a shared queue.
> 
> The basic template at the moment:
> 
>
>< !-- magic here -- >
>< !-- prep a command message -- >
>< !-- now to send the command message -- >
> uri="jms:queue:systemCommands?preserveMessageQos=true&replyTo={{temp-queue}}>"/>
>
> 
>
>
> 
>< !-- more magic -- >
>
> 
> So the main question is how can I get {{temp-queue}} to expand to the JMS 
> specific uri of the Camel uri "jms:temp:queue:client-replies"?
> 
> But if anyone knows how to deal with temporary queues other solutions would 
> be welcome. :)
> 
> Cheers,
> Gary
> 



Re: rest client - post a json content to and http enpoint

2014-11-25 Thread scottdawson
Ali,
We use the http4 Camel component for POSTing JSON to a REST service, for
example:


Regards,
Scott



--
View this message in context: 
http://camel.465427.n5.nabble.com/rest-client-post-a-json-content-to-and-http-enpoint-tp5759600p5759602.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CXF component attachment support for POJO not implemented as specified

2014-11-25 Thread Paul McCulloch
Is it worth my while to submit a patch to support inbound anonymous
attachments, I guess with some configuration option to enable the feature?

Paul

On 21 November 2014 at 17:26, Paul McCulloch  wrote:

> I should probably add that I am trying to handle 'anonymous' attachments -
> they are not referenced in the WSDL at all.
>
> On 21 November 2014 09:36, Paul McCulloch  wrote:
>
>> This test cases are for MTOM though I think. I need to use SOAP with
>> Attachments for my service.
>>
>> Thanks again,
>>
>> Paul
>>
>> On 21 November 2014 05:41, Willem Jiang  wrote:
>>
>>> The attachment is mapped by CXF into the MessageContentList.
>>> Here is an unit test[1] in camel-cxf for it, you can find the wsdl file
>>> here[2]
>>>
>>>
>>> [1]
>>> https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/mtom/CxfMtomConsumerTest.java
>>> [2]
>>> https://github.com/apache/camel/blob/master/components/camel-cxf/src/test/resources/mtom.wsdl
>>>
>>> --
>>> Willem Jiang
>>>
>>> Red Hat, Inc.
>>> Web: http://www.redhat.com
>>> Blog: http://willemjiang.blogspot.com (English)
>>> http://jnn.iteye.com (Chinese)
>>> Twitter: willemjiang
>>> Weibo: 姜宁willem
>>>
>>>
>>>
>>> On November 21, 2014 at 2:48:50 AM, Paul McCulloch (
>>> pkmccull...@gmail.com) wrote:
>>> > Thanks for getting back to me Willem. I'm afraid I don't understand
>>> your
>>> > reply though! What do you mean by "the POJO parameter list"?
>>> >
>>> > I thought you might mean that the attachments get added as additional
>>> > entries to the MessageContentList - but that doesn't seem to be the
>>> case. I
>>> > had a look through the source and can't find anywhere that the
>>> incoming CXF
>>> > attachment is propagated to the POJO, message or exchange.
>>> >
>>> > My use case is implementing a WSD first SOAP service supporting Soap
>>> > with attachments on incoming messages.
>>> >
>>> > Thanks,
>>> >
>>> > Paul
>>> >
>>> > On 20 November 2014 04:25, Willem Jiang wrote:
>>> >
>>> > > Hi Paul,
>>> > >
>>> > > For the POJO, we don’t want to export the attachment from message to
>>> the
>>> > > user as the user can access the attachment from the POJO parameter
>>> list.
>>> > > If we expose the attachment throw the message API for the POJO data
>>> > > formate, it could cause some trouble if the user makes some changes
>>> through
>>> > > the message and POJO parameter list at same time.
>>> > >
>>> > > --
>>> > > Willem Jiang
>>> > >
>>> > > Red Hat, Inc.
>>> > > Web: http://www.redhat.com
>>> > > Blog: http://willemjiang.blogspot.com (English)
>>> > > http://jnn.iteye.com (Chinese)
>>> > > Twitter: willemjiang
>>> > > Weibo: 姜宁willem
>>> > >
>>> > >
>>> > >
>>> > > On November 20, 2014 at 12:53:17 AM, pkmcculloch (
>>> pkmccull...@gmail.com)
>>> > > wrote:
>>> > > > I agree that the work for CAMEL-7181 doesn't cover all cases.
>>> Looking at
>>> > > the
>>> > > > current source I see a couple of issues:
>>> > > >
>>> > > > 1) populateExchangeFromCxfRequest(Exchange, Exchange) doesn't check
>>> > > > MTOM_ENABLED - it never includes attachments for POJOs
>>> > > >
>>> > > > 2) populateCxfResponseFromExchange(Exchange, Exchange) - the same
>>> issue.
>>> > > >
>>> > > > Can someone re-open the JIRA task? Or should I log a new one?
>>> > > >
>>> > > > I'm quite happy to make the fixes. What's the best format to
>>> submit the
>>> > > fix
>>> > > > - patch or pull request?
>>> > > >
>>> > > > Thanks,
>>> > > >
>>> > > > Paul
>>> > > >
>>> > > >
>>> > > >
>>> > > > --
>>> > > > View this message in context:
>>> > >
>>> http://camel.465427.n5.nabble.com/CXF-component-attachment-support-for-POJO-not-implemented-as-specified-tp5746952p5759332.html
>>> > > > Sent from the Camel - Users mailing list archive at Nabble.com.
>>> > > >
>>> > >
>>> > >
>>> >
>>>
>>>
>>
>


how do I transform a BSON into JSON using Camel message transformation pattern

2014-11-25 Thread gmh

All,
I am reading the oplog of Mongodb in my project in order to synch with
redis.
The BSON data I am capturing has the following format.
{ 
 "ts": Timestamp(1415124334, 1), 
"op": "i", 
"ns": "test.products", 
"o": { 
"_id": ObjectId("5459156e7950e8c18c094992"), 
"item": "card", 
"qty": 15 
} 
} 
The problem I am having is with the ts name:value pair. 
As the data indicates it is not a json so I can not marshall/unmarshall it.
I do not care if the timestamp is there. So I want to know if there is a way
I can transform this bson data by removing the ts name: value pair by using
a Camel component? So the final data would look like this 
{ 
"op": "i", 
"ns": "test.products", 
"o": { 
"_id": ObjectId("5459156e7950e8c18c094992"), 
"item": "card", 
"qty": 15 
} 
} 

and can be unmarshalled?
Gordon



--
View this message in context: 
http://camel.465427.n5.nabble.com/how-do-I-transform-a-BSON-into-JSON-using-Camel-message-transformation-pattern-tp5759598.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Multicast with multiple timeouts

2014-11-25 Thread gquintana
Clean and simple test case:





--
View this message in context: 
http://camel.465427.n5.nabble.com/Multicast-with-multiple-timeouts-tp5759576p5759596.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FTP Component configuration

2014-11-25 Thread Claus Ibsen
Hi

Yeah it can be a good idea for the ftp to support also, you are
welcome to log a JIRA and work on a patch with test.

On Tue, Nov 25, 2014 at 2:57 PM, Atanas Shindov
 wrote:
> That's also my understanding. We could have a behavior similar to camel-jms:
> do the configuration once on the component level - connection factory, JNDI
> configurations if necessary, etc., and have it reused by each endpoint
> instance create with the component.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/FTP-Component-configuration-tp5759497p5759590.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: FTP2 consumer (SFTP), using "localWorkDirectory" option - local file not deleted

2014-11-25 Thread Claus Ibsen
It could be because you remove the file name headers, try not doing that.

On Tue, Nov 25, 2014 at 4:01 PM, fidoedidoe  wrote:
> Hi Claus
>
> Many thanks for your reply. After a small series of tests, I'm concluding
> that my desire to send a single "on completion" email when the muticast
> completes is the the direct / indirect cause for the local file delete to
> fail.
>
> The modified XML DSL below reflects my real world scenario more closely.
> You'll see that within the MultiCast near the end I (a) set a new message
> body (b) remove headers using a pattern camel*. before (c) sending a smtp
> email confirmation.
>
> Item (b) was a late addition to my configuration to remove unwanted route
> information from the body of the email notification. I'm pretty confident
> that the inclusion of that the line: 
> if the cause for the local file deletion to fail (because i've destroyed the
> metadata needed to remove the file?)
>
> I'm now wondering how to achieve my desired scenario: send a single email
> indicating the multicast has finished successfully (not an email for each
> route), with an email body that doesn't have unwanted route metadata -while
> still allowing the clean up of my local file?!
>
> any suggestions?
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/FTP2-consumer-SFTP-using-localWorkDirectory-option-local-file-not-deleted-tp5759581p5759591.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


camel-netty: no response received from remote server.

2014-11-25 Thread bwest
Greetings, 

I have a need to send a request via tcp to a socket server.  I'm trying to
use the camel-netty component to do this.  So I send a request and then I
get
I get errors the following error thrown out: 

*org.apache.camel.CamelExecutionException: Exception occurred during
execution on the exchange: Exchange[Message: ☻97244♥]
at
org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1380)
at
org.apache.camel.util.ExchangeHelper.extractResultBody(ExchangeHelper.java:622)
at
org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:471)
at
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:133)
at
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:149)
at
org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:301)
at
com.ta.shop.integration.routes.paymentprocessing.ABSPostAuthorizationProducerTest.testDataTransmission(ABSPostAuthorizationProducerTest.java:53)
Caused by: org.apache.camel.CamelExchangeException: No response received
from remote server: xx.xx.xx.xx:. Exchange[Message: ☻97244♥]
at
org.apache.camel.component.netty.handlers.ClientChannelHandler.channelClosed(ClientChannelHandler.java:118)
at
org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:88)
at
org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at
org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at
org.jboss.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:60)
at
org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at
org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at
org.jboss.netty.handler.codec.frame.FrameDecoder.cleanup(FrameDecoder.java:493)
at
org.jboss.netty.handler.codec.frame.FrameDecoder.channelClosed(FrameDecoder.java:371)
at
org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:88)
at
org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at
org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
at
org.jboss.netty.channel.Channels.fireChannelClosed(Channels.java:468)
at
org.jboss.netty.channel.socket.nio.AbstractNioWorker.close(AbstractNioWorker.java:375)
at
org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:93)
at
org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
at
org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)
at
org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
at
org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at
org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at
org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)*


Now just to make sure, I did a tcp trace on the and I did see the request
being sent and I do see the server responding.  So I'm not sure why this
error is being thrown.  

Here is my statement for good measure, it doesn't make it past the .to
statement before the error is thrown.  

/from("direct:sendAuthMessage")
//.setBody(simple("${body}", String.class))
.transform().body(String.class)

.to("netty:tcp://xx.xx.xx.xx:?sync=true&textline=true&autoAppendDelimiter=false&keepAlive=false").process(new
testProcessor())
.log("${body}")
.to("file:/tmp/output/")
.to("mock:authorization");/

 Any ideas?  
 
 Thanks,



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-netty-no-response-received-from-remote-server-tp5759592.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FTP2 consumer (SFTP), using "localWorkDirectory" option - local file not deleted

2014-11-25 Thread fidoedidoe
Hi Claus

Many thanks for your reply. After a small series of tests, I'm concluding
that my desire to send a single "on completion" email when the muticast
completes is the the direct / indirect cause for the local file delete to
fail. 

The modified XML DSL below reflects my real world scenario more closely.
You'll see that within the MultiCast near the end I (a) set a new message
body (b) remove headers using a pattern camel*. before (c) sending a smtp
email confirmation. 

Item (b) was a late addition to my configuration to remove unwanted route
information from the body of the email notification. I'm pretty confident
that the inclusion of that the line: 
if the cause for the local file deletion to fail (because i've destroyed the
metadata needed to remove the file?)

I'm now wondering how to achieve my desired scenario: send a single email
indicating the multicast has finished successfully (not an email for each
route), with an email body that doesn't have unwanted route metadata -while
still allowing the clean up of my local file?!

any suggestions?





--
View this message in context: 
http://camel.465427.n5.nabble.com/FTP2-consumer-SFTP-using-localWorkDirectory-option-local-file-not-deleted-tp5759581p5759591.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FTP Component configuration

2014-11-25 Thread Atanas Shindov
That's also my understanding. We could have a behavior similar to camel-jms:
do the configuration once on the component level - connection factory, JNDI
configurations if necessary, etc., and have it reused by each endpoint
instance create with the component.



--
View this message in context: 
http://camel.465427.n5.nabble.com/FTP-Component-configuration-tp5759497p5759590.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Quartz clustering in camel spring DSL - JIRA CAMEL-8076

2014-11-25 Thread selva
Hi Willem,

I have tested with camel 2.14.1-SNAPSHOT and the exception is gone but
QueryBuilderProcessor is not getting called from quartz end point.

Please find below configuration and logging information for both recovery
and success scenario. In success scenario QueryBuilderProcessor  is getting
called from quartz endpoint and able see some system.out.printl statement in
success case but its failing in recovery case. 

Please help me to solve this issue.

Route Configuration:



//calling sub rout 
here.
...







Please find the below logs for  Calling QueryBuilderProcessor from quartz
endpoint:
=

Case 1 : //Logs for Immediate recovery : failure with recovery
---
2014-11-25 12:28:47,319 [_ClusterManager] INFO  JobStoreTX
- ClusterManager: detected 1 failed or restarted instances.
2014-11-25 12:28:47,319 [_ClusterManager] INFO  JobStoreTX
- ClusterManager: Scanning for instance "16898502964"'s failed in-progress
jobs.
2014-11-25 12:28:56,675 [_ClusterManager] INFO  JobStoreTX
- ClusterManager: ..Scheduled 1 recoverable job(s) for recovery.
2014-11-25 12:29:08,599 [ontext_Worker-1] INFO  LoggingTriggerHistoryPlugin   
- Trigger [RECOVERING_JOBS.recover_16898502964_1416898727319] fired job
[cluster.quartz] scheduled at:  25-11-2014 12:28:00.000, next scheduled at:
null
2014-11-25 12:29:08,600 [ontext_Worker-1] INFO  LoggingJobHistoryPlugin   
- Job [cluster.quartz] to be fired by trigger
[RECOVERING_JOBS.recover_16898502964_1416898727319], re-fire: 0
2014-11-25 12:29:08,604 [ontext_Worker-1] WARN  CamelJob  
- Cannot find existing QuartzEndpoint with uri:
quartz2://cluster/quartz?cron=0+0%2F4+*+*+*+%3F&recoverableJob=true&stateful=true.
Creating new endpoint instance.
2014-11-25 12:29:09,514 [ontext_Worker-1] INFO  QuartzEndpoint
- Job cluster.quartz (triggerType=CronTriggerImpl,
jobClass=StatefulCamelJob) is scheduled. Next fire date is null
2014-11-25 12:29:09,526 [ontext_Worker-1] INFO  LoggingJobHistoryPlugin   
- Job [cluster.quartz] execution complete and reports: null
2014-11-25 12:29:09,528 [ontext_Worker-1] INFO  LoggingTriggerHistoryPlugin   
- Trigger [RECOVERING_JOBS.recover_16898502964_1416898727319] completed
firing job [cluster.quartz] with resulting trigger instruction code: DELETE
TRIGGER. Next scheduled at: null


case 2: //Normal flow : success 
---
2014-11-25 12:32:04,901 [ontext_Worker-2] INFO  LoggingTriggerHistoryPlugin   
- Trigger [cluster.quartz] fired job [cluster.quartz] scheduled at: 
25-11-2014 12:32:00.000, next scheduled at:  25-11-2014 12:36:00.000
2014-11-25 12:32:04,902 [ontext_Worker-2] INFO  LoggingJobHistoryPlugin   
- Job [cluster.quartz] to be fired by trigger [cluster.quartz], re-fire: 0
2014-11-25 12:32:04,958 [ontext_Worker-2] INFO  QueryBuilderProcessor   -   

Started 
processor started**//system.out line from QueryBuilderProcessor
processor Ends**
2014-11-25 12:32:16,658 [ontext_Worker-2] INFO  LoggingJobHistoryPlugin   
- Job [cluster.quartz] execution complete and reports: null
2014-11-25 12:32:16,658 [ontext_Worker-2] INFO  LoggingTriggerHistoryPlugin   
- Trigger [cluster.quartz] completed firing job [cluster.quartz] with
resulting trigger instruction code: DO NOTHING. Next scheduled at: 
25-11-2014 12:36:00.000


Captured in qrtz_triggers table:

S.NO.  TRIGGER_GROUP  JOB_NAME  JOB_GROUP  NEXT_FIRE_TIME 
PREV_FIRE_TIME  PRIORITY  TRIGGER_STATE TRIGGER_TYPE
1. RECOVERING_JOBSquartzcluster141690540 -1 
5SIMPLEWAITING
2. clusterquartZcluster141690564
141690540   5CRON  WAITING


Question:
1.In recovery scenario QueryBuilderProcessor bean is not getting called from
quartz endpoint but in next interval QueryBuilderProcessor bean is getting
called . Did I miss anything here?

*jar downloaded from below link:*
http://repository.apache.org/content/groups/snapshots/org/apache/camel/camel-quartz2/2.14.1-SNAPSHOT/


Please correct me If I did any mistake.




--
View this message in context: 
http://camel.465427.n5.nabble.com/Quartz-clustering-in-camel-spring-DSL-JIRA-CAMEL-8076-tp5759589.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Passing several POJOs trough multiple routes

2014-11-25 Thread Router
Thank you guys for your help! Here's a simple example that works for me:

DataToPOJOProcessor:
exchange.setProperty("MyProperty", myObject); // assume method
myObject.getName();

Camel.xml:











 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Passing-several-POJOs-trough-multiple-routes-tp5759575p5759585.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FTP2 consumer (SFTP), using "localWorkDirectory" option - local file not deleted

2014-11-25 Thread Claus Ibsen
Hi

Try without multicast and to make the route as simple to see if the
file gets deleted.

On Tue, Nov 25, 2014 at 1:40 PM, fidoedidoe  wrote:
> Hi
>
> I'm using a FTP2 consumer for SFTP on a linux OS implementation. Due the the
> size of the source file (gigabytes), I'm using the option
> "localWorkDirectory". According to the  camel documentation
>    the local local file should be deleted
> on Exchange completion. Excerpt from documentation:
>
> Using Local Work Directory
>
> /Camel supports consuming from remote FTP servers and downloading the files
> directly into a local work directory. This avoids reading the entire remote
> file content into memory as it is streamed directly into the local file
> using FileOutputStream.
> Camel will store to a local file with the same name as the remote file,
> though with .inprogress as extension while the file is being downloaded.
> Afterwards, the file is renamed to remove the .inprogress suffix. And
> finally, when the Exchange is complete the local file is deleted./
>
> What I'm finding is the (local) file persists (in my case in the folder:
> /tmp/) after the route processing has completed. Does anyone know whether my
> interpretation of the documentation is correct and the local file created
> should be deleted - or will I have to create my own process to remove the
> local file (either in bash / with camel)?
>
> I have included a (pseudo) representation of the XML DSL I'm using is below.
>
> Any insight on best practice for the localWorkDirectory option would be most
> welcomed.
>
> Many thanks!
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/FTP2-consumer-SFTP-using-localWorkDirectory-option-local-file-not-deleted-tp5759581.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: FTP Component configuration

2014-11-25 Thread Claus Ibsen
Because not many do like you.

And the ftp component parses the uri to grab the host / port etc. The
latter can be fixed though, and thus would require code changes in
camel-ftp.

Other components may work fine. Its more special case for the ftp that
it looks for the host/port from the uri.



On Tue, Nov 25, 2014 at 1:57 PM, Atanas Shindov
 wrote:
> Hi Claus and fidoedidoe,
>
> thanks for your answers. I was more interested in why the component is
> designed like this from a conceptual point of view, otherwise - yes, using
> the properties component would allow me to achieve the same effect.
>
> Thanks again.
>
> Best regards,
> Atanas
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/FTP-Component-configuration-tp5759497p5759584.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: Best way for reusing routes

2014-11-25 Thread Claus Ibsen
1 and 2 boils down to the same.

 will load the routes the same was as #1 does.

On Tue, Nov 25, 2014 at 12:18 PM, Bilgin Ibryam  wrote:
> Hi all,
>
> I'd like to write couple of route definitions that will be reused in
> multiple places.
>
> If I use the Java DSL it is straight forward, I can reuse the RouteBuilder
> class in many places, but I want to use the XML DSL and I can see two
> options:
>
> 1. Use  statements. Looks like it is mostly used for unit tests.
> 2. Use routeContext to define the routes.
>
> Can anyone tell me what is the difference and the intended use of 1 and 2?
>
> What limitations they have compared to normal routes defined in Java DSL or
> XML DSL?
>
>
> [1] http://camel.apache.org/loading-routes-from-xml-files.html
> [2] http://camel.apache.org/how-do-i-import-routes-from-other-xml-files.html
>
> TIA,
>
> --
> Bilgin Ibryam
>
> Red Hat, Inc.
> Apache Camel & Apache OFBiz committer
> Blog: ofbizian.com
> Twitter: @bibryam 
>
> Author of Instant Apache Camel Message Routing
> http://www.amazon.com/dp/1783283475



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: FTP Component configuration

2014-11-25 Thread Atanas Shindov
Hi Claus and fidoedidoe,

thanks for your answers. I was more interested in why the component is
designed like this from a conceptual point of view, otherwise - yes, using
the properties component would allow me to achieve the same effect.

Thanks again.

Best regards,
Atanas



--
View this message in context: 
http://camel.465427.n5.nabble.com/FTP-Component-configuration-tp5759497p5759584.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: FTP Component configuration

2014-11-25 Thread fidoedidoe
I'm no expert, but could the use of  propertyPlaceholder
  help achieve
similar results (define the FTP details once) and use many?? 



--
View this message in context: 
http://camel.465427.n5.nabble.com/FTP-Component-configuration-tp5759497p5759583.html
Sent from the Camel - Users mailing list archive at Nabble.com.


FTP2 consumer (SFTP), using "localWorkDirectory" option - local file not deleted

2014-11-25 Thread fidoedidoe
Hi

I'm using a FTP2 consumer for SFTP on a linux OS implementation. Due the the
size of the source file (gigabytes), I'm using the option
"localWorkDirectory". According to the  camel documentation
   the local local file should be deleted
on Exchange completion. Excerpt from documentation: 

Using Local Work Directory

/Camel supports consuming from remote FTP servers and downloading the files
directly into a local work directory. This avoids reading the entire remote
file content into memory as it is streamed directly into the local file
using FileOutputStream.
Camel will store to a local file with the same name as the remote file,
though with .inprogress as extension while the file is being downloaded.
Afterwards, the file is renamed to remove the .inprogress suffix. And
finally, when the Exchange is complete the local file is deleted./
 
What I'm finding is the (local) file persists (in my case in the folder:
/tmp/) after the route processing has completed. Does anyone know whether my
interpretation of the documentation is correct and the local file created
should be deleted - or will I have to create my own process to remove the
local file (either in bash / with camel)? 

I have included a (pseudo) representation of the XML DSL I'm using is below. 

Any insight on best practice for the localWorkDirectory option would be most
welcomed. 

Many thanks! 





--
View this message in context: 
http://camel.465427.n5.nabble.com/FTP2-consumer-SFTP-using-localWorkDirectory-option-local-file-not-deleted-tp5759581.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Best way for reusing routes

2014-11-25 Thread Bilgin Ibryam
Further looking into that, the docs say
" is isolated and that that it cannot use ,
,  from the camelcontext"

 but looking into latest Camel code it can use

Does the doc out of date or I'm misinterpreting it?



On 25 November 2014 at 11:18, Bilgin Ibryam  wrote:

> Hi all,
>
> I'd like to write couple of route definitions that will be reused in
> multiple places.
>
> If I use the Java DSL it is straight forward, I can reuse the RouteBuilder
> class in many places, but I want to use the XML DSL and I can see two
> options:
>
> 1. Use  statements. Looks like it is mostly used for unit tests.
> 2. Use routeContext to define the routes.
>
> Can anyone tell me what is the difference and the intended use of 1 and 2?
>
> What limitations they have compared to normal routes defined in Java DSL
> or XML DSL?
>
>
> [1] http://camel.apache.org/loading-routes-from-xml-files.html
> [2]
> http://camel.apache.org/how-do-i-import-routes-from-other-xml-files.html
>
> TIA,
>
> --
> Bilgin Ibryam
>
> Red Hat, Inc.
> Apache Camel & Apache OFBiz committer
> Blog: ofbizian.com
> Twitter: @bibryam 
>
> Author of Instant Apache Camel Message Routing
> http://www.amazon.com/dp/1783283475
>



-- 
Bilgin Ibryam

Red Hat, Inc.
Apache Camel & Apache OFBiz committer
Blog: ofbizian.com
Twitter: @bibryam 

Author of Instant Apache Camel Message Routing
http://www.amazon.com/dp/1783283475


Re: Passing several POJOs trough multiple routes

2014-11-25 Thread Router
Cool thanks, this helps!

How would I access this the property via Spring XML? 

Processor:
exchange.setProperty("MyProperty", myObject); // assume method
myObject.getName();

Camel.xml:


This doesn't work. 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Passing-several-POJOs-trough-multiple-routes-tp5759575p5759578.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Best way for reusing routes

2014-11-25 Thread Bilgin Ibryam
Hi all,

I'd like to write couple of route definitions that will be reused in
multiple places.

If I use the Java DSL it is straight forward, I can reuse the RouteBuilder
class in many places, but I want to use the XML DSL and I can see two
options:

1. Use  statements. Looks like it is mostly used for unit tests.
2. Use routeContext to define the routes.

Can anyone tell me what is the difference and the intended use of 1 and 2?

What limitations they have compared to normal routes defined in Java DSL or
XML DSL?


[1] http://camel.apache.org/loading-routes-from-xml-files.html
[2] http://camel.apache.org/how-do-i-import-routes-from-other-xml-files.html

TIA,

-- 
Bilgin Ibryam

Red Hat, Inc.
Apache Camel & Apache OFBiz committer
Blog: ofbizian.com
Twitter: @bibryam 

Author of Instant Apache Camel Message Routing
http://www.amazon.com/dp/1783283475


AW: Passing several POJOs trough multiple routes

2014-11-25 Thread jhm
Some components don't forward headers. Maybe you are losing header entries on 
special components.
So instead of searching where you are losing the value, storing as properties, 
like Claus suggests, seems to be easier.


Jan

> -Ursprüngliche Nachricht-
> Von: Claus Ibsen [mailto:claus.ib...@gmail.com]
> Gesendet: Dienstag, 25. November 2014 11:12
> An: users@camel.apache.org
> Betreff: Re: Passing several POJOs trough multiple routes
> 
> Store them as properties on the exchange
> 
> On Tue, Nov 25, 2014 at 10:58 AM, Router  wrote:
> > Hi,
> >
> > I converted data from a file into several POJOs which should be
> > available in different routes for further processing. I tried to
> store
> > them in the message header (implements Serializable) but they are
> just
> > available within one route. After passing them to the next they are
> > lost. Do I miss something here? What is the best practice in this
> case?
> >
> > Thank you
> >
> >
> >
> > --
> > View this message in context:
> > http://camel.465427.n5.nabble.com/Passing-several-POJOs-trough-
> multipl
> > e-routes-tp5759575.html Sent from the Camel - Users mailing list
> > archive at Nabble.com.
> 
> 
> 
> --
> Claus Ibsen
> -
> Red Hat, Inc.
> Email: cib...@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> hawtio: http://hawt.io/
> fabric8: http://fabric8.io/



Re: Passing several POJOs trough multiple routes

2014-11-25 Thread Claus Ibsen
Store them as properties on the exchange

On Tue, Nov 25, 2014 at 10:58 AM, Router  wrote:
> Hi,
>
> I converted data from a file into several POJOs which should be available in
> different routes for further processing. I tried to store them in the
> message header (implements Serializable) but they are just available within
> one route. After passing them to the next they are lost. Do I miss something
> here? What is the best practice in this case?
>
> Thank you
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Passing-several-POJOs-trough-multiple-routes-tp5759575.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Passing several POJOs trough multiple routes

2014-11-25 Thread Router
Hi,

I converted data from a file into several POJOs which should be available in
different routes for further processing. I tried to store them in the
message header (implements Serializable) but they are just available within
one route. After passing them to the next they are lost. Do I miss something
here? What is the best practice in this case?

Thank you



--
View this message in context: 
http://camel.465427.n5.nabble.com/Passing-several-POJOs-trough-multiple-routes-tp5759575.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Multicast with multiple timeouts

2014-11-25 Thread gquintana
Hello,

I am sending a message to multicast parallel processor with a 2s timeout:

I thought the timeout would protect against any slow consumer. But I noticed
that as soon a single consumer exceeds timeout, some of the following
consumer results are not agregated:

I expected to have "HELLO E" in the result, since the consumer replies fast
enough.

I know I have several workarounds:
- Use multicast(...).parallelProcessing().streaming(), but I'll lose the
response ordering
- Use a seda endpoint to handle the timeout for each consumer, but it gets
more complicated

Is there a better/simpler solution? Is it un bug or feature?

Thanks for advice,
Gérald



--
View this message in context: 
http://camel.465427.n5.nabble.com/Multicast-with-multiple-timeouts-tp5759576.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Where to do context setup stuff in a guice enabled camel app

2014-11-25 Thread dermoritz
i am using guice in conjunction with "CamelModule" in my camel application
(standalone using Main). In my case i need to do some things on the context
before starting it:

context.addRoutePolicyFactory(startUpLogic);
context.getRegistry(JndiRegistry.class).bind(CepModule.LOOKUP_DATASOURCE,
ds);

But i am not sure where to put this lines. At the moment this lines are
added in constructor of my main RouteBuilder that is adding all other
RoutBuilders. (do context setup stuff in route builder feels wrong)
Alternativly i could put this lines into this method (mandatory if using
CepModule)
@Provides
@Inject
private Set getRoutes(final RouteBuilder routes) 

I just would inject context but it also feels wrong to do this here. So is
there a good way/practice to hook into before starting and doing this kind
of setup?

thanks in advance





--
View this message in context: 
http://camel.465427.n5.nabble.com/Where-to-do-context-setup-stuff-in-a-guice-enabled-camel-app-tp5759574.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Issue in FILE consumer URI having startingDirectoryMustExist set to true

2014-11-25 Thread Willem Jiang
It’s strange your uri is options is start with “?&”. You can double check with 
it?
BTW, I just added a unit test[1] to file endpoint, it look like  
startingDirectoryMustExist option workd rightly.

[1]https://git-wip-us.apache.org/repos/asf?p=camel.git;a=commit;h=3697fbc9

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 24, 2014 at 4:35:28 PM, Himanshu Mittal 
(himanshu.mittal...@gmail.com) wrote:
> Hi,
> I am observing one strange behavior with consumer route in camel FILE
> component
>  
> Here is how I am configuring my camel route
>  
> public void configure() throws Exception {
> onException(Exception.class)
> .handled(true)
> .to(ERROR_HANDLER);
>  
> from(camelURI).routeId(routeID).noAutoStartup()
> .doTry()
> .process(iTask)
> .to(CONSUMER_TASK)
> .doCatch(Exception.class)
> .to(ERROR_HANDLER)
> .end();
> }
>  
>  
> In case when polling directory ( "C:/camel/temp" )does not exist I am not
> able to handle the exception with camel URI configuration.
> It comes to ERROR_HANDLER when camelURI params are configured as :
> file://C:/camel/temp?
> &delay=10&useFixedDelay=true&initialDelay=10*&startingDirectoryMustExist=true*&consumer.bridgeErrorHandler=true&autoCreate=false*&startingDirectoryMustExist=true*&directoryMustExist=true&readLock=changed
>   
>  
> BUT does not come to error handler when camelURI params are configured as
> 1)file://C:/camel/temp?&delay=10&useFixedDelay=true&initialDelay=10&consumer.bridgeErrorHandler=true&autoCreate=false*&startingDirectoryMustExist=true*&directoryMustExist=true&readLock=changed
>   
>  
> 2)file://C:/camel/temp?&delay=10&useFixedDelay=true&initialDelay=10*&startingDirectoryMustExist=true*
>   
> &consumer.bridgeErrorHandler=true&autoCreate=false
> &directoryMustExist=true&readLock=changed
>  
> 3)file://C:/camel/temp?&delay=10&useFixedDelay=true&initialDelay=10*&startingDirectoryMustExist=true*&autoCreate=false
>   
> &directoryMustExist=true &consumer.bridgeErrorHandler=true &readLock=changed  
>  
> I am not able to figure out the route cause how is the positioning of
> *startingDirectoryMustExist *affecting the camel route ?
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Issue-in-FILE-consumer-URI-having-startingDirectoryMustExist-set-to-true-tp5759521.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>