Camel shutdown on windows

2010-08-26 Thread vcheruvu

Hi,

My application runs on windows through Eclipse IDE. It calls
org.apache.camel.spring.Main class to start the application. When I shutdown
the application through the stop button, I do not see any shutdown messages
from Camel on Eclipse console. So, I have placed breakpoints in many places
in DefaultShutDownStrategy class.  It never reached to the breakpoint. I
have also placed breakpoints in DefaultCamelContext.shutdown() and it never
reached there either.  It appears to me on windows, when I use stop button
through eclipse ide, it is doing force kill instead of graceful shutdown. I
looked for examples in your book and I didn't see any special notes on
graceful shutdown. How can I invoke graceful shutdown through eclipse ide on
windows?  



camelContext id=camel xmlns=http://camel.apache.org/schema/spring;
packagecom.example/package
jmxAgent id=agent createConnector=true  registryPort=22005/

route id=readRawData startupOrder=2 shutdownRoute=Defer

from
uri=file://source/raw/con_date?delay=6amp;delete=falseamp;exclude=.doneamp;move=.done/${file:name.noext}-${date:now:MMddHHmmss}amp;moveFailed=.error/${file:name.noext}-${date:now:MMddHHmmss}.erroramp;autoCreate=false/
unmarshal csv/ /unmarshal
split stopOnException=true
simplebody/simple
to 
uri=bean:saveData?method=convertDataAndRouteToPersist/
/split

/route
route id=persistStaticData startupOrder=1 
shutdownRoute=Defer
from
uri=vm:persistQueue?size=50amp;timeout=100amp;concurrentConsumers=80
/
convertBodyTo type=com.example.RawEntity/
to uri=jpa:com.example.RawEntity/
/route




Kind regards,
-Vid-


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


Re: Add header for each message

2010-08-26 Thread Willem Jiang

Hi,

I wrote some test to implements your request and found current Proxy way 
can't not inject the header as you want, because Camel will create a 
BeanInvocation to hold the invocation information of the dynamical 
proxy. It is hard to tell the route to filter the header from you message.


If you are using the ProducerTemplate to send the message into the camel 
route , it could be more easy to implement your requirement :)



Willem


senthil.arumugam wrote:

Hi,

I have created a producer interface to send messages to specified endpoint. 


Can I add a header to each message I send from my producer ? I would like to
get an example for the same. 


Is it possible to add an annotation in my producer like the below mentioned
? Will camel inject the property or header, when I am calling this method to
send a message ?

public interface Producer {
  void send(@Header(value=foo) String foo, Foo foo);
}

If camel injects header here, how can I check it using filter in my route
configuration with spring ?

Thanks in advance.

-SK




Re: XPath Issue

2010-08-26 Thread Ashwin Karpe

Hi,

Please check out the following page  http://camel.apache.org/properties.html
http://camel.apache.org/properties.html  to see how to do this.

Cheers,

Ashwin...

-
-
Ashwin Karpe
Apache Camel Committer  Sr Principal Consultant
Progress Software Corporation
http://fusesource.com http://fusesource.com 
-
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/XPath-Issue-tp2698773p2699429.html
Sent from the Camel - Users mailing list archive at Nabble.com.


XPath Issue

2010-08-26 Thread mitul1411

Hello all..
I am working on the xpath example with camel. This is the condition
:camel:xpath/person/city = 'London'/camel:xpath. Here, instead of London
, I want to take its value from a properties file.
Is it possible ?


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


Re: Camel shutdown on windows

2010-08-26 Thread Willem Jiang

I'm not sure how the Eclipse stop the process that it start.
But if you use Java to run the Main class, you can stop the Main by 
using the ctrl + c.


If you take a look at the Main class, it register a HangupInterceptor 
and it will close the Spring Application context which it starts.


Willem

vcheruvu wrote:

Hi,

My application runs on windows through Eclipse IDE. It calls
org.apache.camel.spring.Main class to start the application. When I shutdown
the application through the stop button, I do not see any shutdown messages
from Camel on Eclipse console. So, I have placed breakpoints in many places
in DefaultShutDownStrategy class.  It never reached to the breakpoint. I
have also placed breakpoints in DefaultCamelContext.shutdown() and it never
reached there either.  It appears to me on windows, when I use stop button
through eclipse ide, it is doing force kill instead of graceful shutdown. I
looked for examples in your book and I didn't see any special notes on
graceful shutdown. How can I invoke graceful shutdown through eclipse ide on
windows?  




camelContext id=camel xmlns=http://camel.apache.org/schema/spring;
packagecom.example/package
jmxAgent id=agent createConnector=true  registryPort=22005/

route id=readRawData startupOrder=2 shutdownRoute=Defer

from
uri=file://source/raw/con_date?delay=6amp;delete=falseamp;exclude=.doneamp;move=.done/${file:name.noext}-${date:now:MMddHHmmss}amp;moveFailed=.error/${file:name.noext}-${date:now:MMddHHmmss}.erroramp;autoCreate=false/
unmarshal csv/ /unmarshal
split stopOnException=true
simplebody/simple
to 
uri=bean:saveData?method=convertDataAndRouteToPersist/
/split

/route
route id=persistStaticData startupOrder=1 
shutdownRoute=Defer
from
uri=vm:persistQueue?size=50amp;timeout=100amp;concurrentConsumers=80
/
convertBodyTo type=com.example.RawEntity/
to uri=jpa:com.example.RawEntity/
/route




Kind regards,
-Vid-






Is there a way to synchronize route startup

2010-08-26 Thread Charles Moulliard
Hi,d

We have created a list of routes dynamically (where the from is different
based on topic name) using routeBuilder and next we add them to the
CamelContext using CamelContext.addRoutes(routeBuilder). As we have to
iterate through the list of routeBuilder to add them to the camelContext,
they are started sequentially.

Is there a way to add all the routes to the CamelContext in one step and
that Camel starts them in parallel ?

Regards,

Charles Moulliard

Senior Enterprise Architect (J2EE, .NET, SOA)
Apache Camel - Karaf - ServiceMix Committer
~~~
Blog : http://cmoulliard.blogspot.com |  Twitter :
http://twitter.com/cmoulliard
Linkedin : http://www.linkedin.com/in/charlesmoulliard | Skype: cmoulliard


location of camel-context.xml file

2010-08-26 Thread Glen Mazza
Hello, for a Mavenized camel project, is there a difference between 
placing it directly under the resources folder compared to 
resources/META-INF/spring folder (in terms of convenience or default 
detection by the Camel runtime)?  The Camel in Action book and Maven 
camel-archetype-java archetype do the latter, I was just wondering why.


Thanks,
Glen



Queue full

2010-08-26 Thread Mark Webb
I am getting an error in ActiveMQ as I test my routes.  I am sending
messages at a rate of about 1 every 10ms.  I am getting the following
error:

2010-08-26 15:41:13,937 | ERROR | Failed delivery for exchangeId:
767c7514-b6ae-49fb-805a-78b13a0425af. Exhausted after delivery
attempt: 1 caught: java.lang.IllegalStateException: Queue full |
org.apache.camel.processor.DefaultErrorHandler | Camel thread 0:
seda://xyzabc
java.lang.IllegalStateException: Queue full
at java.util.AbstractQueue.add(AbstractQueue.java:71)
at 
org.apache.camel.component.seda.SedaProducer.process(SedaProducer.java:96)
at 
org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:97)


How can I increase the capacity of the queue(s) that Camel is using?

Thanks


Re: location of camel-context.xml file

2010-08-26 Thread Willem Jiang

Hi Glen,

Spring will load the application context from the folder 
resources/META-INF/spring by default, so Camel just follow this rule :).


camel:run maven plugin supports to load the camel context from other 
place by using the option camel.fileApplicationContextUri or 
camel.applicationContextUri, but if you deploy the camel context into 
OSGi, the Spring DM still try to load it from META-INF/spring.


Willem

Glen Mazza wrote:
Hello, for a Mavenized camel project, is there a difference between 
placing it directly under the resources folder compared to 
resources/META-INF/spring folder (in terms of convenience or default 
detection by the Camel runtime)?  The Camel in Action book and Maven 
camel-archetype-java archetype do the latter, I was just wondering why.


Thanks,
Glen






Re: Queue full

2010-08-26 Thread Willem Jiang

Hi,

I think this can be configure from ActiveMQ, and Camel has nothing to do 
with it.


Can you go through the ActiveMQ site for this option ?

Willem

Mark Webb wrote:

I am getting an error in ActiveMQ as I test my routes.  I am sending
messages at a rate of about 1 every 10ms.  I am getting the following
error:

2010-08-26 15:41:13,937 | ERROR | Failed delivery for exchangeId:
767c7514-b6ae-49fb-805a-78b13a0425af. Exhausted after delivery
attempt: 1 caught: java.lang.IllegalStateException: Queue full |
org.apache.camel.processor.DefaultErrorHandler | Camel thread 0:
seda://xyzabc
java.lang.IllegalStateException: Queue full
at java.util.AbstractQueue.add(AbstractQueue.java:71)
at 
org.apache.camel.component.seda.SedaProducer.process(SedaProducer.java:96)
at 
org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:97)


How can I increase the capacity of the queue(s) that Camel is using?

Thanks





Re: Is there a way to synchronize route startup

2010-08-26 Thread Willem Jiang

Hi Charles,

If your camel context isn't started, camel will not start the 
routeBuilder until the camel context is started.


Willem
Charles Moulliard wrote:

Hi,d

We have created a list of routes dynamically (where the from is different
based on topic name) using routeBuilder and next we add them to the
CamelContext using CamelContext.addRoutes(routeBuilder). As we have to
iterate through the list of routeBuilder to add them to the camelContext,
they are started sequentially.

Is there a way to add all the routes to the CamelContext in one step and
that Camel starts them in parallel ?

Regards,

Charles Moulliard

Senior Enterprise Architect (J2EE, .NET, SOA)
Apache Camel - Karaf - ServiceMix Committer
~~~
Blog : http://cmoulliard.blogspot.com |  Twitter :
http://twitter.com/cmoulliard
Linkedin : http://www.linkedin.com/in/charlesmoulliard | Skype: cmoulliard