Re: Route starts when deployed with a cxf endpoint

2013-04-02 Thread dkum003

Hi Christian,

Thank you for the project. The auto start up works absolutely fine in this
case because your .to end point is a FTP location. As i said in my post ,
this works fine for FTP,SFTP,File. But when you configure a CXF endpoint as
the .to location, the route starts when deployed.


Regards,
Manish



--
View this message in context: 
http://camel.465427.n5.nabble.com/Route-starts-when-deployed-with-a-cxf-endpoint-tp5729593p5730188.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Multiple routes send exchange to direct point

2013-04-02 Thread Darwish
Thank you 



-
Othman Darwish
ProgressSoft Corp.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Multiple-routes-send-exchange-to-direct-point-tp5730163p5730167.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Invoking .tokenizeXML from a custom processor

2013-04-02 Thread Claus Ibsen
Hi

You can use the Tokenize language

org.apache.camel.language.tokenizer.TokenizeLanguage

It has a number of static methods to easily create the expression.
Then you can use that from a processor.



On Tue, Apr 2, 2013 at 7:29 AM, dkum003 dhananjay.ku...@amadeus.com wrote:


 Hi,

 I am aware that we can invoke the .tokenizeXML from the route builder. But
 is there a way to invoke this through a processor.

 Say i want to split the xml to write it to a set of xml tags. I do not want
 to write custom logic using xpath/dom to split this. Instead i would like
 to
 use camel's .tokenizeXML method.

 Could you please guide me on this.

 Regards,
 Dhananjay



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Invoking-tokenizeXML-from-a-custom-processor-tp5730189.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Camle sql error

2013-04-02 Thread kavan desai
Hi

I am sending following sql statement to get it executed via Camel-sql
component, which is giving following error.
select complianceid,orderid from WH_STG_ORDER where parentchildtype=# and
complianceid in (#,#,#) and currency=# and  tradedate =
to_date(#,'mmdd') and ordtype is null

Error - 

org.apache.camel.NoSuchEndpointException: No endpoint could be found for:
orderid from WH_STG_ORDER where parentchildtype=# and complianceid in
(#,#,#) and currency=# and  tradedate = to_date(#,'mmdd') and ordtype is
null?dataSourceRef=dataSource, please check your classpath contains the
needed Camel component jar.
at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:52)
at
org.apache.camel.util.ExchangeHelper.resolveEndpoint(ExchangeHelper.java:85)
at
org.apache.camel.processor.RecipientListProcessor.resolveEndpoint(RecipientListProcessor.java:219)


I have already added Camel-sql dependency. If I remove second select field
after ',' it works fine.
Following is camel configuration 

route id=sqlRoute
   
from uri=direct://dwh/sql-query/
   
   setHeader
headerName=RuleConditionsimple${in.body.args[0]}/simple/setHeader
   
   setHeader
headerName=RuleQuerysimplesql://${in.body.args[0]}?dataSourceRef=dataSource/simple/setHeader
   
   transformsimplein.body.args[1]/simple/transform
   
to uri=report://request/
recipientListheaderRuleQuery/header/recipientList
setHeader
headerName=RuleConditionconstantRuleCondition/constant/setHeader
to uri=report://reply/
   log message=${body}/
   
  /route

I think ',' is not getting parsed properly,isn't it ?



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


Re: Cannot rollback() inside an XASession with AMQ 5.6

2013-04-02 Thread Fladnag
Ok, it works with AMQ 5.8.

But we can't use this version in our project (neither SMX 4.5.1 and camel
2.10.4 in fact).

Just for this simple test, I have to deal with some issues like 



probably due to bad dependencies like
https://issues.apache.org/jira/browse/CXF-4926, fixed last week : AMQ 5.8 is
too young for a stable version...

activemq-web-console for example was broken since 5.6 :
https://issues.apache.org/jira/browse/AMQ-3853 : bug in 5.6, fixed in 5.7
https://issues.apache.org/jira/browse/AMQ-4229 : bug in 5.7, unresolved

So, we will probably try to avoid using XA in our project :/

Thanks for you efforts




--
View this message in context: 
http://camel.465427.n5.nabble.com/Cannot-rollback-inside-an-XASession-with-AMQ-5-6-tp5730081p5730192.html
Sent from the Camel - Users mailing list archive at Nabble.com.


recursion with Camel ?

2013-04-02 Thread kikou1984
Hi, 

I m trying to simulate recursion with camel, i tried with a Loop but it s
not the reel purpose.


public ArrayList ArrayList String simule_EclatBQE(Exchange exchange){

  ArrayListArrayListlt;String lstOflst = new ArrayList ArrayList
String();
  ArrayList String lstOne = new ArrayList String();
  ArrayList String lstTwo = new ArrayList String();

  lstOne.add(JE CONTIENS SORTIE A AGREGGER);
  lstTwo.add(Je CONTIENS SORTIE A RETRAITER);

  lstOflst.add(lstOne);
  lstOflst.add(lstTwo);

  exchange.getOut().setHeader(ToAggregate,1);
  exchange.getOut().setBody(lstOflst);
 
  return lstOflst;

}

I got this Bean, I want to re loop on this processor , but the In Body
should be the Out Body for the first iteration. 

Is it possible to make it with camel ? 

Thxs.



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


Re: Camel routing issue

2013-04-02 Thread prabumc...@gmail.com
I have found solution in internet using Predicate  we can achieve this,

But,one doubt in the link
http://camel.apache.org/predicate.html,Theymentioned that we can use
AND and OR in Predicate

I have added below code in project,But i am getting compilation
error.Please kindly help

*Predicate god = and(admin, or(body().contains(Camel Rider),
header(type).isEqualTo(god)));*

*Thanks*
Prabu.N


On Mon, Apr 1, 2013 at 9:05 PM, Prabu prabumc...@gmail.com wrote:

 Hi *Chris / **Claus*,

 I have one *Inbound* queue,based on header and content type,I want
 forward to outbound queue.
 *
 Example 1:
 *
 *
 Inbound.queue name : **Inbound.Test.DDD
 Outbound.queue name : SOURHQueueName

 *
 *Criteria or Condition :
 *
 Message property *PAST_EVENT_INTERVAL type* is : *0*
*AND*
 Message *Type* value is : *card.test *or* card.expiry.test*

 *Example 2:*

 *Inbound.queue name : **Inbound.Test.SSS
 Outbound.queue name : WESTQueueName
 *
 *Criteria or Condition :*
 Message property *PAST_EVENT_INTERVAL type* is : *0*
  *AND
 *
 Message *Type *value *start with* :*card.event*

 I want achieve this using camel routing java DSL.

 Please help me.How can i use AND,OR and regular expression in camel routing

 *Regards*
 Prabu.N


 On Mon, Apr 1, 2013 at 7:43 PM, Chris Wolf [via Camel] 
 ml-node+s465427n5730166...@n5.nabble.com wrote:

 Hi Claus,

 Thanks for the response - I could not see any obvious way to configure
 an FTP Consumer at ***runtime***,
 either via bean, processor or consumer template.  If you have a
 concrete example, that would be great to see...

 ...otherwise, here's the solution I came up with:


 -Chris



   // simulate incoming message from JMS...
   from(timer:kickoff?repeatCount=1)
   .to(direct:start);

   // upon receipt of FTP config from JMS, invoke  FtpConfigurer bean
 to reconfigure
   // FTP route, then start it...
   from(direct:start)
   .beanRef(configRdr) // config reader bean not shown here
   .convertBodyTo(Document.class)
   // sets a bunch of headers from DOM, e.g.:

 .setHeader(ftp-config.host).xquery(//remote[remoteId/@value='CBOE34']/server/@value,

 String.class)
   .setHeader(ftp-route-id, constant(ftp.route))
   .beanRef(ftpConfigurer);

   // FTP route will only be started by FtpConfigurer bean after it's
 dynamically re-configured...
   from(ftp://bogushost/bogusdir?startScheduler=false;) // the  URI
 will be reconfigured...
   .routeId(ftp.route).noAutoStartup()
   .log(Received file ${file:onlyname})
   .to(file:/tmp/local/data);

   public class FtpConfigurer {
 public void configureFtpConsumer(Exchange exchange) throws Exception
 {
 CamelContext context = exchange.getContext();
 MapString, Object headers = exchange.getIn().getHeaders();
 MapString, Object parameters = new HashMapString, Object();

 // Filter headers for ftp-config specific headers...
 for (Map.EntryString, Object entry : headers.entrySet()) {
 String key = entry.getKey();
 if (key.startsWith(ftp-config.))
 parameters.put(key.substring(ftp-config..length()),
 entry.getValue());
 }

 String routeId = exchange.getIn().getHeader(ftp-route-id,
 String.class);
 Route ftpRoute = context.getRoute(routeId);
 FtpConsumer c = (FtpConsumer) ftpRoute.getConsumer();
 FtpEndpointFTPFile rfe = (FtpEndpointFTPFile)
 c.getEndpoint();
 FtpConfiguration rfc = rfe.getConfiguration();

 // Need to crack open FtpConsumer's endpointPath field since
 // there's no mutator (setter)
 Class? cls = c.getClass();
 Field endpointPath_fld = cls.getDeclaredField(endpointPath);
 endpointPath_fld.setAccessible(true);
 endpointPath_fld.set(c, (String)parameters.get(directory));

 // Need to crack open FtpEndpoint, actually DefaultEndpoint -
 the ultimate base class
 // since there's no mutator (setter) for the endpointUri field
 cls = rfe.getClass();
 Field endpointUri_fld = null;
 while (endpointUri_fld == null) {
 // TODO: maybe change logic to just stop at
 class=DefaultEndpoint
 // rather then using NoSuchFieldException
 try {
 endpointUri_fld = cls.getDeclaredField(endpointUri);
 } catch (NoSuchFieldException nsfe) {
 cls = cls.getSuperclass();
 }
 }
 endpointUri_fld.setAccessible(true);
 endpointUri_fld.set(rfe,
 String.format(ftp://%s/%s;,
 (String)parameters.get(host), (String)parameters.get(directory)));

 // set reference properties first as they use # syntax that
 fools the regular properties setter
 EndpointHelper.setReferenceProperties(context, rfc, parameters);
 EndpointHelper.setProperties(context, rfc, parameters);
 EndpointHelper.setReferenceProperties(context, rfe, parameters);
 EndpointHelper.setProperties(context, rfe, parameters);
 

Re: Camel routing issue

2013-04-02 Thread Claus Ibsen
Hi

You should static import those methods: and, or
on the class org.apache.camel.builder.PredicateBuilder
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/builder/PredicateBuilder.html



On Tue, Apr 2, 2013 at 10:17 AM, prabumc...@gmail.com
prabumc...@gmail.comwrote:

 I have found solution in internet using Predicate  we can achieve this,

 But,one doubt in the link
 http://camel.apache.org/predicate.html,Theymentioned that we can use
 AND and OR in Predicate

 I have added below code in project,But i am getting compilation
 error.Please kindly help

 *Predicate god = and(admin, or(body().contains(Camel Rider),
 header(type).isEqualTo(god)));*

 *Thanks*
 Prabu.N


 On Mon, Apr 1, 2013 at 9:05 PM, Prabu prabumc...@gmail.com wrote:

  Hi *Chris / **Claus*,
 
  I have one *Inbound* queue,based on header and content type,I want
  forward to outbound queue.
  *
  Example 1:
  *
  *
  Inbound.queue name : **Inbound.Test.DDD
  Outbound.queue name : SOURHQueueName
 
  *
  *Criteria or Condition :
  *
  Message property *PAST_EVENT_INTERVAL type* is : *0*
 *AND*
  Message *Type* value is : *card.test *or* card.expiry.test*
 
  *Example 2:*
 
  *Inbound.queue name : **Inbound.Test.SSS
  Outbound.queue name : WESTQueueName
  *
  *Criteria or Condition :*
  Message property *PAST_EVENT_INTERVAL type* is : *0*
   *AND
  *
  Message *Type *value *start with* :*card.event*
 
  I want achieve this using camel routing java DSL.
 
  Please help me.How can i use AND,OR and regular expression in camel
 routing
 
  *Regards*
  Prabu.N
 
 
  On Mon, Apr 1, 2013 at 7:43 PM, Chris Wolf [via Camel] 
  ml-node+s465427n5730166...@n5.nabble.com wrote:
 
  Hi Claus,
 
  Thanks for the response - I could not see any obvious way to configure
  an FTP Consumer at ***runtime***,
  either via bean, processor or consumer template.  If you have a
  concrete example, that would be great to see...
 
  ...otherwise, here's the solution I came up with:
 
 
  -Chris
 
 
 
// simulate incoming message from JMS...
from(timer:kickoff?repeatCount=1)
.to(direct:start);
 
// upon receipt of FTP config from JMS, invoke  FtpConfigurer bean
  to reconfigure
// FTP route, then start it...
from(direct:start)
.beanRef(configRdr) // config reader bean not shown here
.convertBodyTo(Document.class)
// sets a bunch of headers from DOM, e.g.:
 
 
 .setHeader(ftp-config.host).xquery(//remote[remoteId/@value='CBOE34']/server/@value,
 
  String.class)
.setHeader(ftp-route-id, constant(ftp.route))
.beanRef(ftpConfigurer);
 
// FTP route will only be started by FtpConfigurer bean after it's
  dynamically re-configured...
from(ftp://bogushost/bogusdir?startScheduler=false;) // the  URI
  will be reconfigured...
.routeId(ftp.route).noAutoStartup()
.log(Received file ${file:onlyname})
.to(file:/tmp/local/data);
 
public class FtpConfigurer {
  public void configureFtpConsumer(Exchange exchange) throws Exception
  {
  CamelContext context = exchange.getContext();
  MapString, Object headers = exchange.getIn().getHeaders();
  MapString, Object parameters = new HashMapString, Object();
 
  // Filter headers for ftp-config specific headers...
  for (Map.EntryString, Object entry : headers.entrySet()) {
  String key = entry.getKey();
  if (key.startsWith(ftp-config.))
  parameters.put(key.substring(ftp-config..length()),
  entry.getValue());
  }
 
  String routeId = exchange.getIn().getHeader(ftp-route-id,
  String.class);
  Route ftpRoute = context.getRoute(routeId);
  FtpConsumer c = (FtpConsumer) ftpRoute.getConsumer();
  FtpEndpointFTPFile rfe = (FtpEndpointFTPFile)
  c.getEndpoint();
  FtpConfiguration rfc = rfe.getConfiguration();
 
  // Need to crack open FtpConsumer's endpointPath field since
  // there's no mutator (setter)
  Class? cls = c.getClass();
  Field endpointPath_fld = cls.getDeclaredField(endpointPath);
  endpointPath_fld.setAccessible(true);
  endpointPath_fld.set(c, (String)parameters.get(directory));
 
  // Need to crack open FtpEndpoint, actually DefaultEndpoint -
  the ultimate base class
  // since there's no mutator (setter) for the endpointUri field
  cls = rfe.getClass();
  Field endpointUri_fld = null;
  while (endpointUri_fld == null) {
  // TODO: maybe change logic to just stop at
  class=DefaultEndpoint
  // rather then using NoSuchFieldException
  try {
  endpointUri_fld = cls.getDeclaredField(endpointUri);
  } catch (NoSuchFieldException nsfe) {
  cls = cls.getSuperclass();
  }
  }
  endpointUri_fld.setAccessible(true);
  endpointUri_fld.set(rfe,
  String.format(ftp://%s/%s;,
  

Re: Camel routing issue

2013-04-02 Thread prabumc...@gmail.com
So can i use like this..

Predicate god =
PredicateBuilder.and(admin,PredicateBuilder.or(body().contains(Camel
Rider), header(type).isEqualTo(god)));


On Tue, Apr 2, 2013 at 2:05 PM, Claus Ibsen-2 [via Camel] 
ml-node+s465427n5730195...@n5.nabble.com wrote:

 Hi

 You should static import those methods: and, or
 on the class org.apache.camel.builder.PredicateBuilder

 http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/builder/PredicateBuilder.html



 On Tue, Apr 2, 2013 at 10:17 AM, [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5730195i=0
 [hidden email] http://user/SendEmail.jtp?type=nodenode=5730195i=1wrote:


  I have found solution in internet using Predicate  we can achieve this,
 
  But,one doubt in the link
  http://camel.apache.org/predicate.html,Theymentioned that we can use
  AND and OR in Predicate
 
  I have added below code in project,But i am getting compilation
  error.Please kindly help
 
  *Predicate god = and(admin, or(body().contains(Camel Rider),
  header(type).isEqualTo(god)));*
 
  *Thanks*
  Prabu.N
 
 
  On Mon, Apr 1, 2013 at 9:05 PM, Prabu [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=5730195i=2
 wrote:
 
   Hi *Chris / **Claus*,
  
   I have one *Inbound* queue,based on header and content type,I want
   forward to outbound queue.
   *
   Example 1:
   *
   *
   Inbound.queue name : **Inbound.Test.DDD
   Outbound.queue name : SOURHQueueName
  
   *
   *Criteria or Condition :
   *
   Message property *PAST_EVENT_INTERVAL type* is : *0*
  *AND*
   Message *Type* value is : *card.test *or* card.expiry.test*
  
   *Example 2:*
  
   *Inbound.queue name : **Inbound.Test.SSS
   Outbound.queue name : WESTQueueName
   *
   *Criteria or Condition :*
   Message property *PAST_EVENT_INTERVAL type* is : *0*
*AND
   *
   Message *Type *value *start with* :*card.event*
  
   I want achieve this using camel routing java DSL.
  
   Please help me.How can i use AND,OR and regular expression in camel
  routing
  
   *Regards*
   Prabu.N
  
  
   On Mon, Apr 1, 2013 at 7:43 PM, Chris Wolf [via Camel] 
   [hidden email] http://user/SendEmail.jtp?type=nodenode=5730195i=3
 wrote:
  
   Hi Claus,
  
   Thanks for the response - I could not see any obvious way to
 configure
   an FTP Consumer at ***runtime***,
   either via bean, processor or consumer template.  If you have a
   concrete example, that would be great to see...
  
   ...otherwise, here's the solution I came up with:
  
  
   -Chris
  
  
  
 // simulate incoming message from JMS...
 from(timer:kickoff?repeatCount=1)
 .to(direct:start);
  
 // upon receipt of FTP config from JMS, invoke  FtpConfigurer bean
   to reconfigure
 // FTP route, then start it...
 from(direct:start)
 .beanRef(configRdr) // config reader bean not shown here
 .convertBodyTo(Document.class)
 // sets a bunch of headers from DOM, e.g.:
  
  
 
 .setHeader(ftp-config.host).xquery(//remote[remoteId/@value='CBOE34']/server/@value,

  
   String.class)
 .setHeader(ftp-route-id, constant(ftp.route))
 .beanRef(ftpConfigurer);
  
 // FTP route will only be started by FtpConfigurer bean after it's
   dynamically re-configured...
 from(ftp://bogushost/bogusdir?startScheduler=false;) // the  URI
   will be reconfigured...
 .routeId(ftp.route).noAutoStartup()
 .log(Received file ${file:onlyname})
 .to(file:/tmp/local/data);
  
 public class FtpConfigurer {
   public void configureFtpConsumer(Exchange exchange) throws
 Exception
   {
   CamelContext context = exchange.getContext();
   MapString, Object headers = exchange.getIn().getHeaders();
   MapString, Object parameters = new HashMapString,
 Object();
  
   // Filter headers for ftp-config specific headers...
   for (Map.EntryString, Object entry : headers.entrySet()) {
   String key = entry.getKey();
   if (key.startsWith(ftp-config.))
   parameters.put(key.substring(ftp-config..length()),
   entry.getValue());
   }
  
   String routeId = exchange.getIn().getHeader(ftp-route-id,
   String.class);
   Route ftpRoute = context.getRoute(routeId);
   FtpConsumer c = (FtpConsumer) ftpRoute.getConsumer();
   FtpEndpointFTPFile rfe = (FtpEndpointFTPFile)
   c.getEndpoint();
   FtpConfiguration rfc = rfe.getConfiguration();
  
   // Need to crack open FtpConsumer's endpointPath field
 since
   // there's no mutator (setter)
   Class? cls = c.getClass();
   Field endpointPath_fld =
 cls.getDeclaredField(endpointPath);
   endpointPath_fld.setAccessible(true);
   endpointPath_fld.set(c, (String)parameters.get(directory));
  
   // Need to crack open FtpEndpoint, actually DefaultEndpoint -
   the ultimate base class
   // since there's no mutator (setter) for the endpointUri
 field
   cls = rfe.getClass();

Re: Camel routing issue

2013-04-02 Thread Claus Ibsen
Yeah or jus static import those methods to make it easier to read

import static org.apache.camel.builder.PredicateBuilder.and;
import static org.apache.camel.builder.PredicateBuilder.or;



On Tue, Apr 2, 2013 at 10:38 AM, prabumc...@gmail.com
prabumc...@gmail.comwrote:

 So can i use like this..

 Predicate god =
 PredicateBuilder.and(admin,PredicateBuilder.or(body().contains(Camel
 Rider), header(type).isEqualTo(god)));


 On Tue, Apr 2, 2013 at 2:05 PM, Claus Ibsen-2 [via Camel] 
 ml-node+s465427n5730195...@n5.nabble.com wrote:

  Hi
 
  You should static import those methods: and, or
  on the class org.apache.camel.builder.PredicateBuilder
 
 
 http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/builder/PredicateBuilder.html
 
 
 
  On Tue, Apr 2, 2013 at 10:17 AM, [hidden email]
 http://user/SendEmail.jtp?type=nodenode=5730195i=0
  [hidden email] http://user/SendEmail.jtp?type=nodenode=5730195i=1
 wrote:
 
 
   I have found solution in internet using Predicate  we can achieve this,
  
   But,one doubt in the link
   http://camel.apache.org/predicate.html,Theymentioned that we can use
   AND and OR in Predicate
  
   I have added below code in project,But i am getting compilation
   error.Please kindly help
  
   *Predicate god = and(admin, or(body().contains(Camel Rider),
   header(type).isEqualTo(god)));*
  
   *Thanks*
   Prabu.N
  
  
   On Mon, Apr 1, 2013 at 9:05 PM, Prabu [hidden email]
 http://user/SendEmail.jtp?type=nodenode=5730195i=2
  wrote:
  
Hi *Chris / **Claus*,
   
I have one *Inbound* queue,based on header and content type,I want
forward to outbound queue.
*
Example 1:
*
*
Inbound.queue name : **Inbound.Test.DDD
Outbound.queue name : SOURHQueueName
   
*
*Criteria or Condition :
*
Message property *PAST_EVENT_INTERVAL type* is : *0*
   *AND*
Message *Type* value is : *card.test *or* card.expiry.test*
   
*Example 2:*
   
*Inbound.queue name : **Inbound.Test.SSS
Outbound.queue name : WESTQueueName
*
*Criteria or Condition :*
Message property *PAST_EVENT_INTERVAL type* is : *0*
 *AND
*
Message *Type *value *start with* :*card.event*
   
I want achieve this using camel routing java DSL.
   
Please help me.How can i use AND,OR and regular expression in camel
   routing
   
*Regards*
Prabu.N
   
   
On Mon, Apr 1, 2013 at 7:43 PM, Chris Wolf [via Camel] 
[hidden email] http://user/SendEmail.jtp?type=nodenode=5730195i=3
 
  wrote:
   
Hi Claus,
   
Thanks for the response - I could not see any obvious way to
  configure
an FTP Consumer at ***runtime***,
either via bean, processor or consumer template.  If you have a
concrete example, that would be great to see...
   
...otherwise, here's the solution I came up with:
   
   
-Chris
   
   
   
  // simulate incoming message from JMS...
  from(timer:kickoff?repeatCount=1)
  .to(direct:start);
   
  // upon receipt of FTP config from JMS, invoke  FtpConfigurer bean
to reconfigure
  // FTP route, then start it...
  from(direct:start)
  .beanRef(configRdr) // config reader bean not shown here
  .convertBodyTo(Document.class)
  // sets a bunch of headers from DOM, e.g.:
   
   
  
 
 .setHeader(ftp-config.host).xquery(//remote[remoteId/@value='CBOE34']/server/@value,
 
   
String.class)
  .setHeader(ftp-route-id, constant(ftp.route))
  .beanRef(ftpConfigurer);
   
  // FTP route will only be started by FtpConfigurer bean after it's
dynamically re-configured...
  from(ftp://bogushost/bogusdir?startScheduler=false;) // the  URI
will be reconfigured...
  .routeId(ftp.route).noAutoStartup()
  .log(Received file ${file:onlyname})
  .to(file:/tmp/local/data);
   
  public class FtpConfigurer {
public void configureFtpConsumer(Exchange exchange) throws
  Exception
{
CamelContext context = exchange.getContext();
MapString, Object headers = exchange.getIn().getHeaders();
MapString, Object parameters = new HashMapString,
  Object();
   
// Filter headers for ftp-config specific headers...
for (Map.EntryString, Object entry : headers.entrySet()) {
String key = entry.getKey();
if (key.startsWith(ftp-config.))
   
 parameters.put(key.substring(ftp-config..length()),
entry.getValue());
}
   
String routeId = exchange.getIn().getHeader(ftp-route-id,
String.class);
Route ftpRoute = context.getRoute(routeId);
FtpConsumer c = (FtpConsumer) ftpRoute.getConsumer();
FtpEndpointFTPFile rfe = (FtpEndpointFTPFile)
c.getEndpoint();
FtpConfiguration rfc = rfe.getConfiguration();
   
// Need to crack open FtpConsumer's endpointPath field
  since
// there's no mutator (setter)
Class? cls = 

Re: Camel routing issue

2013-04-02 Thread prabumc...@gmail.com
Thank you Claus..


*Regards*
Prabu.N


On Tue, Apr 2, 2013 at 2:12 PM, Claus Ibsen-2 [via Camel] 
ml-node+s465427n573019...@n5.nabble.com wrote:

 Yeah or jus static import those methods to make it easier to read

 import static org.apache.camel.builder.PredicateBuilder.and;
 import static org.apache.camel.builder.PredicateBuilder.or;



 On Tue, Apr 2, 2013 at 10:38 AM, [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=5730197i=0
 [hidden email] http://user/SendEmail.jtp?type=nodenode=5730197i=1wrote:


  So can i use like this..
 
  Predicate god =
  PredicateBuilder.and(admin,PredicateBuilder.or(body().contains(Camel
  Rider), header(type).isEqualTo(god)));
 
 
  On Tue, Apr 2, 2013 at 2:05 PM, Claus Ibsen-2 [via Camel] 
  [hidden email] http://user/SendEmail.jtp?type=nodenode=5730197i=2
 wrote:
 
   Hi
  
   You should static import those methods: and, or
   on the class org.apache.camel.builder.PredicateBuilder
  
  
 
 http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/builder/PredicateBuilder.html
  
  
  
   On Tue, Apr 2, 2013 at 10:17 AM, [hidden email]
  http://user/SendEmail.jtp?type=nodenode=5730195i=0
   [hidden email] http://user/SendEmail.jtp?type=nodenode=5730195i=1

  wrote:
  
  
I have found solution in internet using Predicate  we can achieve
 this,
   
But,one doubt in the link
http://camel.apache.org/predicate.html,Theymentioned that we can
 use
AND and OR in Predicate
   
I have added below code in project,But i am getting compilation
error.Please kindly help
   
*Predicate god = and(admin, or(body().contains(Camel Rider),
header(type).isEqualTo(god)));*
   
*Thanks*
Prabu.N
   
   
On Mon, Apr 1, 2013 at 9:05 PM, Prabu [hidden email]
  http://user/SendEmail.jtp?type=nodenode=5730195i=2
   wrote:
   
 Hi *Chris / **Claus*,

 I have one *Inbound* queue,based on header and content type,I want
 forward to outbound queue.
 *
 Example 1:
 *
 *
 Inbound.queue name : **Inbound.Test.DDD
 Outbound.queue name : SOURHQueueName

 *
 *Criteria or Condition :
 *
 Message property *PAST_EVENT_INTERVAL type* is : *0*
*AND*
 Message *Type* value is : *card.test *or* card.expiry.test*

 *Example 2:*

 *Inbound.queue name : **Inbound.Test.SSS
 Outbound.queue name : WESTQueueName
 *
 *Criteria or Condition :*
 Message property *PAST_EVENT_INTERVAL type* is : *0*
  *AND
 *
 Message *Type *value *start with* :*card.event*

 I want achieve this using camel routing java DSL.

 Please help me.How can i use AND,OR and regular expression in
 camel
routing

 *Regards*
 Prabu.N


 On Mon, Apr 1, 2013 at 7:43 PM, Chris Wolf [via Camel] 
 [hidden email] 
 http://user/SendEmail.jtp?type=nodenode=5730195i=3

  
   wrote:

 Hi Claus,

 Thanks for the response - I could not see any obvious way to
   configure
 an FTP Consumer at ***runtime***,
 either via bean, processor or consumer template.  If you have a
 concrete example, that would be great to see...

 ...otherwise, here's the solution I came up with:


 -Chris



   // simulate incoming message from JMS...
   from(timer:kickoff?repeatCount=1)
   .to(direct:start);

   // upon receipt of FTP config from JMS, invoke  FtpConfigurer
 bean
 to reconfigure
   // FTP route, then start it...
   from(direct:start)
   .beanRef(configRdr) // config reader bean not shown here
   .convertBodyTo(Document.class)
   // sets a bunch of headers from DOM, e.g.:


   
  
 
 .setHeader(ftp-config.host).xquery(//remote[remoteId/@value='CBOE34']/server/@value,

  

 String.class)
   .setHeader(ftp-route-id, constant(ftp.route))
   .beanRef(ftpConfigurer);

   // FTP route will only be started by FtpConfigurer bean after
 it's
 dynamically re-configured...
   from(ftp://bogushost/bogusdir?startScheduler=false;) // the
  URI
 will be reconfigured...
   .routeId(ftp.route).noAutoStartup()
   .log(Received file ${file:onlyname})
   .to(file:/tmp/local/data);

   public class FtpConfigurer {
 public void configureFtpConsumer(Exchange exchange) throws
   Exception
 {
 CamelContext context = exchange.getContext();
 MapString, Object headers =
 exchange.getIn().getHeaders();
 MapString, Object parameters = new HashMapString,
   Object();

 // Filter headers for ftp-config specific headers...
 for (Map.EntryString, Object entry :
 headers.entrySet()) {
 String key = entry.getKey();
 if (key.startsWith(ftp-config.))

  parameters.put(key.substring(ftp-config..length()),
 entry.getValue());
 }

 String routeId =
 

Re: recursion with Camel ?

2013-04-02 Thread Willem jiang
Hi,

I'm not quite understand you question.
Do you want to write a unit test or you just want to call this process in the 
camel route with loop?


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Tuesday, April 2, 2013 at 4:02 PM, kikou1984 wrote:

 Hi,  
  
 I m trying to simulate recursion with camel, i tried with a Loop but it s
 not the reel purpose.
  
  
 public ArrayList ArrayList String simule_EclatBQE(Exchange exchange){
  
 ArrayListArrayListlt;String lstOflst = new ArrayList ArrayList
 String();
 ArrayList String lstOne = new ArrayList String();
 ArrayList String lstTwo = new ArrayList String();
  
 lstOne.add(JE CONTIENS SORTIE A AGREGGER);
 lstTwo.add(Je CONTIENS SORTIE A RETRAITER);
  
 lstOflst.add(lstOne);
 lstOflst.add(lstTwo);
  
 exchange.getOut().setHeader(ToAggregate,1);
 exchange.getOut().setBody(lstOflst);
  
 return lstOflst;
  
 }
  
 I got this Bean, I want to re loop on this processor , but the In Body
 should be the Out Body for the first iteration.  
  
 Is it possible to make it with camel ?  
  
 Thxs.
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/recursion-with-Camel-tp5730193.html
 Sent from the Camel - Users mailing list archive at Nabble.com 
 (http://Nabble.com).





Re: Camle sql error

2013-04-02 Thread Willem jiang
Hi

You didn't specify the right header for the recipientList.
It should be start with sql:xxx not the sql string that you want to send to.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Tuesday, April 2, 2013 at 3:20 PM, kavan desai wrote:

 Hi
  
 I am sending following sql statement to get it executed via Camel-sql
 component, which is giving following error.
 select complianceid,orderid from WH_STG_ORDER where parentchildtype=# and
 complianceid in (#,#,#) and currency=# and tradedate =
 to_date(#,'mmdd') and ordtype is null
  
 Error -  
  
 org.apache.camel.NoSuchEndpointException: No endpoint could be found for:
 orderid from WH_STG_ORDER where parentchildtype=# and complianceid in
 (#,#,#) and currency=# and tradedate = to_date(#,'mmdd') and ordtype is
 null?dataSourceRef=dataSource, please check your classpath contains the
 needed Camel component jar.
 at
 org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:52)
 at
 org.apache.camel.util.ExchangeHelper.resolveEndpoint(ExchangeHelper.java:85)
 at
 org.apache.camel.processor.RecipientListProcessor.resolveEndpoint(RecipientListProcessor.java:219)
  
  
 I have already added Camel-sql dependency. If I remove second select field
 after ',' it works fine.
 Following is camel configuration  
  
 route id=sqlRoute
  
 from uri=direct://dwh/sql-query/
  
 setHeader
 headerName=RuleConditionsimple${in.body.args[0]}/simple/setHeader
  
 setHeader
 headerName=RuleQuerysimplesql://${in.body.args[0]}?dataSourceRef=dataSource/simple/setHeader
  
 transformsimplein.body.args[1]/simple/transform
  
 to uri=report://request/
 recipientListheaderRuleQuery/header/recipientList
 setHeader
 headerName=RuleConditionconstantRuleCondition/constant/setHeader
 to uri=report://reply/
 log message=${body}/
  
 /route
  
 I think ',' is not getting parsed properly,isn't it ?
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camle-sql-error-tp5730191.html
 Sent from the Camel - Users mailing list archive at Nabble.com 
 (http://Nabble.com).





Re: recursion with Camel ?

2013-04-02 Thread kikou1984
Hi,

Actually, i want to restart this bean each time by changing the body.

Here an exemple,

public void simule_EclatBQE(Exchange exchange){ 

 ListString in_lst = new ArrayListString();
 in_lst  = (ListString) exchange.getIn().getBody();

//treatment
ArrayListArrayListlt;String out_lstOflst = new ArrayList ArrayList
String();
ArrayList String lstOne = new ArrayList String();
ArrayList String lstTwo = new ArrayList String();
   
lstOne.add(JE CONTIENS SORTIE A AGREGGER);
lstTwo.add(Je CONTIENS SORTIE A RETRAITER);

out_lstOflst.add(lstOne);
out_lstOflst.add(lstTwo);

 exchange.getOut().setBody(out_lstOflst.get(1));
}

Then, The bean simule_EclatBQE should restart and it should take
out_lstOflst.get(1) in its input.

How can i make it ? 

Thxs




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


Re: Camle sql error

2013-04-02 Thread kavan desai
I tried to chage the header from RuleCondition to sql:RuleCondition however
then query i am passing not executed at all.


One of the reason is because of 
',' in the select statement, the later part is trated as seperate camel
message and for which end ponit not found.

I am seeing following bebug statement - 

[02/04/13 12:25:01:001 SGT] DEBUG bean.BeanProcessor: Setting bean
invocation result on the OUT message: [*select complianceid,orderid* from
WH_STG_ORDER where parentchildtype=# and complianceid in (#,#,#) and
currency=# and  tradedate = to_date(#,'mmdd') and ordtype is null, [P,
1/SUBM/AS/1/20130221/smWZ3Mb/1, 1/SUBM/AS/1/20130221/smWZ7dC/1,
1/SUBM/AS/1/20130221/smX9TpH/1, JPY, 20130226]]



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


Re: Refering implicitly to routeContext

2013-04-02 Thread Claus Ibsen
On Tue, Apr 2, 2013 at 11:21 AM, edvicif edvi...@gmail.com wrote:
 I like both idea. With the second one the problem is that it doesn't have
 this silent extension capability what I want :(

 Shall I create a JIRA task of this?


Yeah feel free to create a JIRA ticket.





 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Refering-implicitly-to-routeContext-tp5730047p5730204.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


CronSchedulePolicy with cxf endpoint

2013-04-02 Thread Richa
Hi,
I have a cron expression which triggers the route at a particular time
everyday. This works fine with all the endpoints like ftp,sftp, etc. But
when I use a cxf endpoint, the route runs for the first time, but the next
day the route does not start. Can you please tell me why this is happening?



--
View this message in context: 
http://camel.465427.n5.nabble.com/CronSchedulePolicy-with-cxf-endpoint-tp5730206.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: recursion with Camel ?

2013-04-02 Thread Claus Ibsen
Hi

I suggest looking at the dynamic router eip


On Tue, Apr 2, 2013 at 10:02 AM, kikou1984 hichem.ouesl...@atos.net wrote:
 Hi,

 I m trying to simulate recursion with camel, i tried with a Loop but it s
 not the reel purpose.


 public ArrayList ArrayList String simule_EclatBQE(Exchange exchange){

   ArrayListArrayListlt;String lstOflst = new ArrayList ArrayList
 String();
   ArrayList String lstOne = new ArrayList String();
   ArrayList String lstTwo = new ArrayList String();

   lstOne.add(JE CONTIENS SORTIE A AGREGGER);
   lstTwo.add(Je CONTIENS SORTIE A RETRAITER);

   lstOflst.add(lstOne);
   lstOflst.add(lstTwo);

   exchange.getOut().setHeader(ToAggregate,1);
   exchange.getOut().setBody(lstOflst);

   return lstOflst;

 }

 I got this Bean, I want to re loop on this processor , but the In Body
 should be the Out Body for the first iteration.

 Is it possible to make it with camel ?

 Thxs.



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



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Camle sql error

2013-04-02 Thread Claus Ibsen
You can configure to use a different separator on the recipient list eip.

On Tue, Apr 2, 2013 at 11:12 AM, kavan desai kavan.de...@barclays.com wrote:
 I tried to chage the header from RuleCondition to sql:RuleCondition however
 then query i am passing not executed at all.


 One of the reason is because of
 ',' in the select statement, the later part is trated as seperate camel
 message and for which end ponit not found.

 I am seeing following bebug statement -

 [02/04/13 12:25:01:001 SGT] DEBUG bean.BeanProcessor: Setting bean
 invocation result on the OUT message: [*select complianceid,orderid* from
 WH_STG_ORDER where parentchildtype=# and complianceid in (#,#,#) and
 currency=# and  tradedate = to_date(#,'mmdd') and ordtype is null, [P,
 1/SUBM/AS/1/20130221/smWZ3Mb/1, 1/SUBM/AS/1/20130221/smWZ7dC/1,
 1/SUBM/AS/1/20130221/smX9TpH/1, JPY, 20130226]]



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



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


One processor for multiple camelContext

2013-04-02 Thread valerian.merkling
Hi !

In my project there is a lot of communication by mail with attached zipped
xml files.

So i made two processor to zip the file, or unzip from a mail. 

My problem is that i have three differents bundles (three jar, three
camelContext), all of them using those two processors.

How can i make these processors available for everyone ?

I read a few doc about camel registry, but i don't get it.

When i write 

/bean id=beantest name=beantest class=test.TestRegisterProcessor//

Does it call the registry ? 

This (obviously) works :

File1 :
/bean id=beantest name=beantest class=test.TestRegisterProcessor/
camelContext id=first-context /
  route id=route1
  from .../
  to uri=beantest /
  /route
/camelContext
/
But how i can make this works :

File2 :
/camelContext id=second-context /
  route id=route2
  from .../
  to uri=beantest /
  /route
/camelContext/


Thanks for your help !



--
View this message in context: 
http://camel.465427.n5.nabble.com/One-processor-for-multiple-camelContext-tp5730213.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Multiple from for the same route

2013-04-02 Thread ABouchama
Hi,

I want to create a single route camel that have 3 from entries :

from uri=file:data/
from uri=http://www.google.com/
from uri=activemq:queue:incoming/
to uri=direct:invoke/

1. Is it possible to have these 3 from in the same route ? 
2. Is possible to externalize these 3 from in cfg file, and to load
automatically values from cfg when is changes, for example :

from uri=${properties}/
to uri=direct:invoke

Regards,




--
View this message in context: 
http://camel.465427.n5.nabble.com/Multiple-from-for-the-same-route-tp5730218.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: recursion with Camel ?

2013-04-02 Thread kikou1984
Hi,

I don t think i need a dynamic routes , i only want make a recursive form to
my Bean.
 

The output of the bean, should be  injected as input of the same bean !!!
like the exemple below.

If i have to use dynamic routes, how can i do , i read on the website but i
didn't understand how can i used for my case.


Txhs



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


Re: Multiple from for the same route

2013-04-02 Thread Claus Ibsen
Short answers

Ad 1)
Yes

Ad 2)
No

On Tue, Apr 2, 2013 at 4:25 PM, ABouchama tit...@yahoo.fr wrote:
 Hi,

 I want to create a single route camel that have 3 from entries :

 from uri=file:data/
 from uri=http://www.google.com/
 from uri=activemq:queue:incoming/
 to uri=direct:invoke/

 1. Is it possible to have these 3 from in the same route ?
 2. Is possible to externalize these 3 from in cfg file, and to load
 automatically values from cfg when is changes, for example :

 from uri=${properties}/
 to uri=direct:invoke

 Regards,




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Multiple-from-for-the-same-route-tp5730218.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Is the result of this builder reusable? XQueryBuilder.xquery(//foo);

2013-04-02 Thread Chris Wolf
I want to perform an XQuery outside of DSL (in a Processor).  Something like:

 XQueryBuilder hostXQ = XQueryBuilder
.xquery(//remote[remoteId/@value='CBOE34']/server/@value);
 String host = hostXQ.evaluateAsString(exchange);

Second question is can I parameterize the XQuery like so:

 XQueryBuilder hostXQ = XQueryBuilder
.xquery(//remote[remoteId/@value=$accountId]/server/@value);

hostXQ.setParameters(new HashMapString, Object() {{
put(accountId, CBOE34);}});
String host1 = hostXQ.evaluateAsString(exchange);

hostXQ.setParameters(new HashMapString, Object() {{
put(accountId, CBOE78);}});
String host2 = hostXQ.evaluateAsString(exchange);


Thanks,


Chris


Re: It is possible with Camel to use dynamic consumer? **after context start**

2013-04-02 Thread Claus Ibsen
Hi

There is a ticket scheduled for Camel 3.0 to allow enrich and
pollEnrich to support dynamic uris like the recipient list can do.

Though implementing this requires an API change and thus scheduled for 3.0.

You can always use a java bean to consume from an dynamic computed
endpoint. For example using consumer template etc.

For ftp endpoints you may want to set disconnect=true, to avoid having
the connection running for a longer period.




On Sun, Mar 31, 2013 at 10:08 PM, Chris Wolf cwolf.a...@gmail.com wrote:
 Claus,

 You addressed the issue of dynamic URIs for Consumers back in July-2009:

 http://camel.465427.n5.nabble.com/Dynamic-consumers-with-Camel-td476433.html

 However, all those use-cases, except for maybe #4, web console, which
 I can't run all are about
 calculating the URI *before* the context is started.  What I'm looking
 for is a way to create and insert
 or update a polling consumer's URI - at runtime - *after* the context
 is started.

 For example:

  from(direct:start)
 .beanRef(config)
 .convertBodyTo(Document.class)
 .setHeader(Ftp_URI).xquery(
 concat('ftp://' +...some more xpaths into the
 inbound config doc...), String.class)
  .pollEnrich(/* whoops! this is referenced at route
 setup time, not route runtime... - it won't work */)
  .to(log:...);

 So the question, more generally, is is it possible to alter the route
 definition - at runtime? i.e. after the route/context are started?

 You sorted of hinted at this in that July-2009 posting when you said:

 2) You can always stop, modify and start a route in Camel at runtime.

 I don't see how that would work since I would likely be attempting to
 modify the route at runtime
 from a bean method in the route - or are you suggesting one route
 stops/modifies another route?

 So the way I see it is - I would create the ftp route with a bogus URI
 and option startScheduler=false,
 on the ftp endpoint, or autoStart=false on the route.  Then in
 *another* route - the configurer route,
 I guess, access the ftp route and reconfigure the endpoint with the
 real settings, then start it's poll scheduler (or start it's route).

 Something like that?  Any easier, more direct way?

 Thanks,


 Chris



-- 
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: recursion with Camel ?

2013-04-02 Thread valerian.merkling
Why don't you just make your processor call a recursive function ? 

A processor isn't made to be able to invoke another processor, you need to
make it recursive with your route


bean id=myrecursivebean class=.../

camelContext errorHandlerRef=errorHandler
xmlns=http://camel.apache.org/schema/spring;
route
from uri=direct:a/
choice
when
simple$in.header.continue = 'true'/simple
to uri=myrecursivebean/
to uri=direct:a/
/when
otherwise
to uri=direct:b/
/otherwise
/choice
/route
/camelContext



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


Re: recursion with Camel ?

2013-04-02 Thread kikou1984
Hi,

Thxs for u r answer , i tried it and it works. sometimes  , I complicates
things.



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


Permission denied with Camel-FTP when configuring jail+chroot+sftp only with openssh

2013-04-02 Thread lleclerc
Hi,

I am using camel 2.10.3, I can get this route from(direct).to(sftp) to work
using openssh as server.
There is no problem.

I am now adding this to my server config (sshd_config) :
Match User myuser
ChrootDirectory /home
AllowTCPForwarding no
X11Forwarding no
ForceCommand internal-sftp

Which should restrain the access to SFTP only and folder /home only.

This new config will give me this from ssh :
This service allows sftp connections only.
Connection to localhost closed.

I can use sftp and it works perfectly. (ls, get, put, etc.)

My camel route doesn't allow it though, I tried to run my IDE as root, 
still the same exception, PermissionDenied.

Any idea on what I might be missing ?

Thanks






--
View this message in context: 
http://camel.465427.n5.nabble.com/Permission-denied-with-Camel-FTP-when-configuring-jail-chroot-sftp-only-with-openssh-tp5730230.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Deleting MQ Temporary Queue

2013-04-02 Thread PhilBurress
Our application is using MQ temporary dynamic queues for our replyTo queue in
a request/reply pattern. It works fine and is very fast, except the
temporary queues do not get deleted at the end of the transaction; only when
the application server is shut down. Is there a hook somewhere in Camel
where we can issue the delete queue call at the end of a transaction?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Deleting-MQ-Temporary-Queue-tp5730231.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: It is possible with Camel to use dynamic consumer? **after context start**

2013-04-02 Thread Chris Wolf
May I have the ticket #?  (so I can watch/follow)

When you say, use a java bean - what do you mean?

Instantiate the FTP component like?

FtpComponent comp = new FtpComponent(context);
@SuppressWarnings(unchecked)
FtpEndpointFTPFile endpt = (FtpEndpointFTPFile)

comp.createEndpoint(ftp://localhost/download?localWorkDirectory=/tmp/local/datanoop=trueusername=fredpassword=secret;);
final FtpConsumer cons = (FtpConsumer)
endpt.createConsumer(new Processor() {
@Override
public void process(Exchange exchange)
throws Exception {
System.out.printf(%s\n,
exchange.toString());
}
});
cons.setStartScheduler(true);
comp.start();
endpt.start();
cons.start();

On Tue, Apr 2, 2013 at 11:03 AM, Claus Ibsen claus.ib...@gmail.com wrote:
 Hi

 There is a ticket scheduled for Camel 3.0 to allow enrich and
 pollEnrich to support dynamic uris like the recipient list can do.

 Though implementing this requires an API change and thus scheduled for 3.0.

 You can always use a java bean to consume from an dynamic computed
 endpoint. For example using consumer template etc.

 For ftp endpoints you may want to set disconnect=true, to avoid having
 the connection running for a longer period.




 On Sun, Mar 31, 2013 at 10:08 PM, Chris Wolf cwolf.a...@gmail.com wrote:
 Claus,

 You addressed the issue of dynamic URIs for Consumers back in July-2009:

 http://camel.465427.n5.nabble.com/Dynamic-consumers-with-Camel-td476433.html

 However, all those use-cases, except for maybe #4, web console, which
 I can't run all are about
 calculating the URI *before* the context is started.  What I'm looking
 for is a way to create and insert
 or update a polling consumer's URI - at runtime - *after* the context
 is started.

 For example:

  from(direct:start)
 .beanRef(config)
 .convertBodyTo(Document.class)
 .setHeader(Ftp_URI).xquery(
 concat('ftp://' +...some more xpaths into the
 inbound config doc...), String.class)
  .pollEnrich(/* whoops! this is referenced at route
 setup time, not route runtime... - it won't work */)
  .to(log:...);

 So the question, more generally, is is it possible to alter the route
 definition - at runtime? i.e. after the route/context are started?

 You sorted of hinted at this in that July-2009 posting when you said:

 2) You can always stop, modify and start a route in Camel at runtime.

 I don't see how that would work since I would likely be attempting to
 modify the route at runtime
 from a bean method in the route - or are you suggesting one route
 stops/modifies another route?

 So the way I see it is - I would create the ftp route with a bogus URI
 and option startScheduler=false,
 on the ftp endpoint, or autoStart=false on the route.  Then in
 *another* route - the configurer route,
 I guess, access the ftp route and reconfigure the endpoint with the
 real settings, then start it's poll scheduler (or start it's route).

 Something like that?  Any easier, more direct way?

 Thanks,


 Chris



 --
 Claus Ibsen
 -
 Red Hat, Inc.
 FuseSource is now part of Red Hat
 Email: cib...@redhat.com
 Web: http://fusesource.com
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen


Re: CronSchedulePolicy with cxf endpoint

2013-04-02 Thread Christian Müller
Can you share your route/configuration with us?

Sent from a mobile device
Am 02.04.2013 11:46 schrieb Richa rsinha2...@gmail.com:

 Hi,
 I have a cron expression which triggers the route at a particular time
 everyday. This works fine with all the endpoints like ftp,sftp, etc. But
 when I use a cxf endpoint, the route runs for the first time, but the next
 day the route does not start. Can you please tell me why this is happening?



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/CronSchedulePolicy-with-cxf-endpoint-tp5730206.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

2013-04-02 Thread Christian Müller
UPDATE:

I use Java 1.6.0_43 for the following:

cmueller$ cd workspaceCamel/camel/components/camel-crypto/

remove the @Ignore annotation on
org.apache.camel.converter.crypto.PGPDataFormatElGamalTest.java

cmueller$ mvn clean test -Dtest=PGPDataFormatElGamalTest
...
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0

[INFO]

[INFO] BUILD SUCCESS
[INFO]


This makes sure the used JDK supports the strong encryption.



cp pubring-ElGamal.gpg ${KARAF_HOME}/etc/pubring-ElGamal.gpg

and start Karaf 2.2.10:

cmueller$ ./karaf clean
karaf@root features:chooseurl camel 2.10.4
adding feature url
mvn:org.apache.camel.karaf/apache-camel/2.10.4/xml/features
karaf@root features:install camel-spring
karaf@root features:install camel-crypto
karaf@root install -s
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.bcprov-jdk16/1.46_2

Update the keyFileName property in context.xml (attached) so it matches
your environment.

cp context.xml ${KARAF_HOME}/deploy/context.xml

But I got the following exception:
org.bouncycastle.openpgp.PGPException: exception encrypting session key
at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown
Source)[77:org.apache.servicemix.bundles.bcpg-jdk16:1.46.0.2]
at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown
Source)[77:org.apache.servicemix.bundles.bcpg-jdk16:1.46.0.2]
at
org.apache.camel.converter.crypto.PGPDataFormat.marshal(PGPDataFormat.java:86)[78:org.apache.camel.camel-crypto:2.10.4]
at
org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:59)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.processor.Pipeline.process(Pipeline.java:117)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)[71:org.apache.camel.camel-core:2.10.4]
at
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)[71:org.apache.camel.camel-core:2.10.4]
at

Re: Camel-Crypto ElGamal encryption works in mvn camel:run but not in Karaf/OSGi

2013-04-02 Thread Christian Müller
If I change the dependency from

org.bouncycastle/bcpg-jdk16/1.46 -
org.apache.servicemix.bundles/org.apache.servicemix.bundles.bcpg-jdk16/1.46_2
and
org.bouncycastle/bcprov-jdk16/1.46 -
org.apache.servicemix.bundles/org.apache.servicemix.bundles.bcprov-jdk16/1.46_2

in camel-crypto 2.10.4 and run the same test again, I get the same
exception:
org.apache.camel.CamelExecutionException: Exception occurred during
execution on the exchange: Exchange[Message: Hi Alice, Be careful Eve is
listening, signed Bob]
at
org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1332)
at
org.apache.camel.util.ExchangeHelper.extractResultBody(ExchangeHelper.java:618)
at
org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:454)
at
org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:450)
at
org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeaders(DefaultProducerTemplate.java:230)
at
org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeaders(DefaultProducerTemplate.java:216)
at
org.apache.camel.converter.crypto.AbstractPGPDataFormatTest.doRoundTripEncryptionTests(AbstractPGPDataFormatTest.java:35)
at
org.apache.camel.converter.crypto.PGPDataFormatTest.testEncryption(PGPDataFormatTest.java:36)
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:45)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:47)
at org.junit.rules.RunRules.evaluate(RunRules.java:18)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
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.bouncycastle.openpgp.PGPException: exception encrypting
session key
at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown
Source)
at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown
Source)
at
org.apache.camel.converter.crypto.PGPDataFormat.marshal(PGPDataFormat.java:86)
at
org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:59)
at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)
at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)
at

Re: Possible memory leak in org.apache.activemq.pool.PooledSession

2013-04-02 Thread vadim
After further investigation, I see how besides closing the session and prior
to that, a close call is made on ActiveMQMessageConsumer. So, there is no
harm in commenting out consumers.add(consumer) even in the case of
PollingConsumer.

vadim



--
View this message in context: 
http://camel.465427.n5.nabble.com/Possible-memory-leak-in-org-apache-activemq-pool-PooledSession-tp4964951p5730233.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Is the result of this builder reusable? XQueryBuilder.xquery(//foo);

2013-04-02 Thread Willem jiang
I think you can use the XQueryBuilder in the Processor just like you showed.
If you want to call the evaluateAsString multiple times, you need to make sure 
the message body is reread able.  
You can convert the message body into String before you process it in your 
processor.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem




On Tuesday, April 2, 2013 at 11:01 PM, Chris Wolf wrote:

 I want to perform an XQuery outside of DSL (in a Processor). Something like:
  
 XQueryBuilder hostXQ = XQueryBuilder
 .xquery(//remote[remoteId/@value='CBOE34']/server/@value);
 String host = hostXQ.evaluateAsString(exchange);
  
 Second question is can I parameterize the XQuery like so:
  
 XQueryBuilder hostXQ = XQueryBuilder
 .xquery(//remote[remoteId/@value=$accountId]/server/@value);
  
 hostXQ.setParameters(new HashMapString, Object() {{
 put(accountId, CBOE34);}});
 String host1 = hostXQ.evaluateAsString(exchange);
  
 hostXQ.setParameters(new HashMapString, Object() {{
 put(accountId, CBOE78);}});
 String host2 = hostXQ.evaluateAsString(exchange);
  
  
 Thanks,
  
  
 Chris  




Re: One processor for multiple camelContext

2013-04-02 Thread Willem jiang
Hi,

Please check out my comment in the below mail.  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
  http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Tuesday, April 2, 2013 at 9:24 PM, valerian.merkling wrote:

 Hi !
  
 In my project there is a lot of communication by mail with attached zipped
 xml files.
  
 So i made two processor to zip the file, or unzip from a mail.  
  
 My problem is that i have three differents bundles (three jar, three
 camelContext), all of them using those two processors.
  
 How can i make these processors available for everyone ?
  
 I read a few doc about camel registry, but i don't get it.
If you want to reference some object from the URI, you may need to get touch 
with concept of  camel registry.
If you want to access the Processor from your camel context, you need let Camel 
look up it from the registry. In most case you don't need to create the 
registry by yourself if you are using Spring or Blueprint. Camel will delegate 
the registry look up work to the Spring or Blueprint.

  
 When i write  
  
 /bean id=beantest name=beantest class=test.TestRegisterProcessor//
  
 Does it call the registry ?
It's common practice to register the bean into Spring application context. And 
Camel can help you to look up the Object by using the name beantest.  
  
  
 This (obviously) works :
  
 File1 :
 /bean id=beantest name=beantest class=test.TestRegisterProcessor/
 camelContext id=first-context /
 route id=route1
 from .../
 to uri=beantest /
 /route
 /camelContext
 /

The camel context can lookup the bean test from the Spring Application Context. 
 
 But how i can make this works :
  
 File2 :
 /camelContext id=second-context /
 route id=route2
 from .../
 to uri=beantest /
 /route
 /camelContext/
  
You need to make sure Camel can find out the bean test from the Spring 
application context.  
  
  
 Thanks for your help !
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/One-processor-for-multiple-camelContext-tp5730213.html
 Sent from the Camel - Users mailing list archive at Nabble.com 
 (http://Nabble.com).





Re: Transactional batching

2013-04-02 Thread boday
this is a really old thread, but I'm wondering if anyone has any updated
ideas on this...I have a similar requirement to read from an AMQ queue,
batch X messages together and then process.  I'm currently doing this with
the aggregator/hawtdb repo combination but performance is proving too
slow...

I'd think it would be faster/cleaner to just be able to read multiple from
the queue in a transaction, aggregate together, process, then end the
transaction...

any ideas?


David J. M. Karlsen wrote
 Looking at this thread I wonder the same.
 
 During a resource local jmstransaction you are able to fetch several
 messages - but there is no way in camel to control the commit size.
 You can do the same during a XA tx.
 
 I see no support for batching here:
 http://camel.apache.org/batch-consumer.html.
 
 Either transaction mode would benefit a lot if you could process several
 messages in one go.
 
 Typical usecase would be tx( N messages, process them in paralell,
 aggregate and send out )





-
Ben O'Day
IT Consultant -http://consulting-notes.com

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


Re: Jetty to ActiveMQ Failure

2013-04-02 Thread mferor76
I had the same issue.  After reading this I got the idea to use this config
for my PooledConnectionFactory and it works

bean id=pooledConnectionFactory
  class=org.apache.activemq.pool.PooledConnectionFactory
  init-method=start
  destroy-method=stop
property name=maxConnections value=8 /
property name=connectionFactory ref=jmsConnectionFactory /
property name=expiryTimeout value=-1 /
property name=idleTimeout value=-1 /
/bean

bean id=jmsConfig 
class=org.apache.camel.component.jms.JmsConfiguration
property name=connectionFactory ref=pooledConnectionFactory/
property name=concurrentConsumers value=8/
/bean

bean id=jms
class=org.apache.activemq.camel.component.ActiveMQComponent
property name=configuration ref=jmsConfig/
/bean

In the javadoc it says that the expiryTimeout is used to for activemq
failover.  Although I haven't test it I have hope that this would still work
since when I restart activemq it seemlessly reconnects as I would expect.

HTH



--
View this message in context: 
http://camel.465427.n5.nabble.com/Jetty-to-ActiveMQ-Failure-tp5725323p5730248.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Deleting MQ Temporary Queue

2013-04-02 Thread Claus Ibsen
On Tue, Apr 2, 2013 at 8:01 PM, PhilBurress nmclough...@amig.com wrote:
 Our application is using MQ temporary dynamic queues for our replyTo queue in
 a request/reply pattern. It works fine and is very fast, except the
 temporary queues do not get deleted at the end of the transaction; only when
 the application server is shut down. Is there a hook somewhere in Camel
 where we can issue the delete queue call at the end of a transaction?


No there is no such option.

Maybe MQ has some option to automatic delete temp queues which are no
longer in use.
ActiveMQ can do that.

Can you tell a little more about your configuration. Are you use a
different temp queue name per request/reply message. Or reuse the same
temp queue name for the lifetime of the Camel route?

We could possible add some option to instruct Camel to attempt to
delete the queue when you stop the route?
But would be good to hear a bit more about your setup.

And if you run for a while, how many temp queues do you have on MQ?

And what versions of Camel and MQ are you using?



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Deleting-MQ-Temporary-Queue-tp5730231.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen