Re: Camel-Hazelcast: How to setup multiple nodes?

2014-03-18 Thread doug5791
I started up a cluster of nodes running from localhost and then started my
camel-hazelcast route which appeared to join into the existing cluster with
no problem. After populating a List in Hazelcast I wrote a quick Hazelcast
client to check that the data was stored properly. It was.

Thanks for your help!
-Doug



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Hazelcast-How-to-setup-multiple-nodes-tp5748848p5748987.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel-Hazelcast: Adding values into a Map

2014-03-18 Thread doug5791
I am dealing with data in a route where the body of the exchange is a single
string. I have been able to add this string from the body of the exchange to
the Hazelcast grid, however, I would like to add the string to a Map instead
of a list. The documentation I found  here
http://camel.apache.org/hazelcast-component.html#HazelcastComponent-map  
does not show a clear example of how information from a real exchange is
added to the Map; only a template example.

Using the below route does not add the string values to the map: (probably
because there is no key?)

from(consumer:test)
.setHeader(HazelcastConstants.OPERATION,
constant(HazelcastConstants.PUT_OPERATION))
.toF(hazelcast:%shmap, HazelcastConstants.MAP_PREFIX);

Any ideas on how to provide a key for the value going into the map? Assuming
that is the issue.

Thanks ahead of time,
-Doug



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Hazelcast-Adding-values-into-a-Map-tp5749002.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: update HTTP request using previous response

2014-03-18 Thread Claus Ibsen
Hi

You likely need to reset the stream cache to be able to re-read it again
org.apache.camel.StreamCache#reset

On Tue, Mar 18, 2014 at 3:43 AM, aidatechinc hfao...@aidatech.com wrote:
 Thanks for taking the time to respond.   We did write a bean to handle the
 message, but we realize that since we enable the streamCache, the message
 gets overwritten while we are processing it.  Is that due to the stream?
 Ideally we want to handle and process one message at a time, but the stream
 seam that the body gets updated..If disable cache, then we get empty
 bodies..










 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/update-HTTP-request-using-previous-response-tp5748902p5749008.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
Make your Camel applications look hawt, try: http://hawt.io


Re: Camel-Hazelcast: Adding values into a Map

2014-03-18 Thread Stephan Burkard
On the page you mentioned is an example request that is done with a
producer template:

template.sendBodyAndHeader(direct:[put|get|update|delete|query],
my-foo, HazelcastConstants.OBJECT_ID, 4711);

my-foo = message body
HazelcastConstants.OBJECT_ID = message header name
4711 = message header value

So, to add the map key to your message you need to do

.setHeader(HazelcastConstants.OBJECT_ID, yourMapKey)


Stephan



On Mon, Mar 17, 2014 at 9:17 PM, doug5791 tobed...@uwgb.edu wrote:

 I am dealing with data in a route where the body of the exchange is a
 single
 string. I have been able to add this string from the body of the exchange
 to
 the Hazelcast grid, however, I would like to add the string to a Map
 instead
 of a list. The documentation I found  here
 http://camel.apache.org/hazelcast-component.html#HazelcastComponent-map
 does not show a clear example of how information from a real exchange is
 added to the Map; only a template example.

 Using the below route does not add the string values to the map: (probably
 because there is no key?)

 from(consumer:test)
 .setHeader(HazelcastConstants.OPERATION,
 constant(HazelcastConstants.PUT_OPERATION))
 .toF(hazelcast:%shmap, HazelcastConstants.MAP_PREFIX);

 Any ideas on how to provide a key for the value going into the map?
 Assuming
 that is the issue.

 Thanks ahead of time,
 -Doug



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Camel-Hazelcast-Adding-values-into-a-Map-tp5749002.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: how to catch Errors?

2014-03-18 Thread sekaijin
Hi. 
sorry for the late reply. 
This is the code that I wrote. but I have not been able to verify that it
worked. 

Thank
A + JYT



--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-catch-Errors-tp5748279p5749018.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Question about end of life date for camel library

2014-03-18 Thread Wai Lik Chong
Hi,

I have been using camel 2.1.0 in my project. I would like to know when is
the end of life support for the library version I am using. I have been
checking from the homepage https://camel.apache.org but not able get any
information.
In addition, I would also like to know the end of life date of every
version so that i can plan when to upgrade my library.
Thanks alot in advance for your help.

Wai Lik


Re: Question about end of life date for camel library

2014-03-18 Thread Claus Ibsen
Hi

See
http://camel.apache.org/download

When Camel 2.13.0 is released (soon) then Camel 2.11.x is retired and
no longer active supported.
The rule of thumb is that we support 2 patch branches back.

If you are looking for a longer support timeframe, you can try
commercial support
http://camel.apache.org/commercial-camel-offerings.html

On Tue, Mar 18, 2014 at 9:51 AM, Wai Lik Chong wailik.mo...@gmail.com wrote:
 Hi,

 I have been using camel 2.1.0 in my project. I would like to know when is
 the end of life support for the library version I am using. I have been
 checking from the homepage https://camel.apache.org but not able get any
 information.
 In addition, I would also like to know the end of life date of every
 version so that i can plan when to upgrade my library.
 Thanks alot in advance for your help.

 Wai Lik



-- 
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
Make your Camel applications look hawt, try: http://hawt.io


Camel routing using Predicates

2014-03-18 Thread arko1983
My code are as follows.

public void camelRedirect(String Rqvalue,String oprcode) {

final String urlOprn=oprcode;// 

final CamelContext context = new DefaultCamelContext(); 
try {
 context.start();
 
 RouteBuilder builder=new RouteBuilder() {  


@Override
public void configure() throws Exception {  


Predicate isWidgets = simple(${oprcode} == 
'ATM');
from(urlOprn) 
.choice()

.when(isWidgets)
.process(new Processor() {  

String recv=;
@Override
public void 
process(Exchange data) throws Exception {

System.out.println();

}
})
.otherwise()
.process(new Processor() {  


@Override
public void 
process(Exchange data) throws Exception {}
}); 
}


};  
context.addRoutes(builder); 

}
catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}   
}

String value of oprcode=ATM.I am getting the following exceptions:-
Failed to create route route1: Route[[From[ATM]] -
[Choice[[When[simple{${oprcode} == 'ATM... because of No endpoint could be
found for: ATM, please check your classpath contains the needed Camel
component jar.


I want to channel the requests through camel.



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


Re: Camel routing using Predicates

2014-03-18 Thread Claus Ibsen
Hi

${oprcode} is not a valid simple function.
http://camel.apache.org/simple

On Tue, Mar 18, 2014 at 10:24 AM, arko1983 arko1...@gmail.com wrote:
 My code are as follows.

 public void camelRedirect(String Rqvalue,String oprcode) {

 final String urlOprn=oprcode;//

 final CamelContext context = new DefaultCamelContext();
 try {
  context.start();

  RouteBuilder builder=new RouteBuilder() {

 @Override
 public void configure() throws Exception {

 Predicate isWidgets = simple(${oprcode} == 
 'ATM');
 from(urlOprn)
 .choice()

 .when(isWidgets)
 .process(new Processor() {
 String 
 recv=;
 @Override
 public void 
 process(Exchange data) throws Exception {
 
 System.out.println();

 }
 })
 .otherwise()
 .process(new Processor() {

 @Override
 public void 
 process(Exchange data) throws Exception {}
 });
 }


 };
 context.addRoutes(builder);

 }
 catch (Exception e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
 }
 }
 
 String value of oprcode=ATM.I am getting the following exceptions:-
 Failed to create route route1: Route[[From[ATM]] -
 [Choice[[When[simple{${oprcode} == 'ATM... because of No endpoint could be
 found for: ATM, please check your classpath contains the needed Camel
 component jar.


 I want to channel the requests through camel.



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Camel-routing-using-Predicates-tp5749029.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
Make your Camel applications look hawt, try: http://hawt.io


JMS Message Expiration period

2014-03-18 Thread Jose
Hi,

I am sending messages to a queue using Camel jms component. 

I want to specify an expiration period so that if a message is not consumed
within that period then the message should be sent to an error queue.

I have been investigating on Internet but it is still not very clear to me.

Do I need to use JMSExpiration header or timeToLive? Do I need to
specify them in the sender or in the  consumer? I have read
http://camel.apache.org/jms serveral times but it doesn't say much about it.

Could you please advice?

Thanks a lot.

Jose




--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Message-Expiration-period-tp5749032.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Question about end of life date for camel library

2014-03-18 Thread Claus Ibsen
On Tue, Mar 18, 2014 at 11:31 AM, Wai Lik Chong wailik.mo...@gmail.com wrote:
 Hi Claus,

 Thanks alot for answer.
 Is this rule of thumb will always apply to all other apache library such as
 apache abdera, axiom etc?


No each Apache projects has their own policy. Some projects only
support latest code, and others do support and release patch releases
etc. Mind that support is many things. You can always contact any
Apache project using the mailing list to ask for help - also for older
releases etc. Its just that some Apache projects do not fix and
release on older versions. eg its not fun to fix stuff in code that is
many years old etc. But the source code is free, and anyone can grab
the code, and apply their own fixes. For example if a fix has been
merged to a newer release, you can try to apply that same fix on the
source code of old fix to try to fix it yourself etc.


Also all support from Apache is community and volunteer based.
Some Apache projects has commercial support from companies. That are
usually the bigger Apache projects.

PS: Are you really using Apache Camel 2.1.0 - that is very old. Or do
you mean Camel 2.11 ? eg eleven?




 Thanks in advance
 Wai Lik


 On 18 March 2014 16:54, Claus Ibsen claus.ib...@gmail.com wrote:

 Hi

 See
 http://camel.apache.org/download

 When Camel 2.13.0 is released (soon) then Camel 2.11.x is retired and
 no longer active supported.
 The rule of thumb is that we support 2 patch branches back.

 If you are looking for a longer support timeframe, you can try
 commercial support
 http://camel.apache.org/commercial-camel-offerings.html

 On Tue, Mar 18, 2014 at 9:51 AM, Wai Lik Chong wailik.mo...@gmail.com
 wrote:
  Hi,
 
  I have been using camel 2.1.0 in my project. I would like to know when is
  the end of life support for the library version I am using. I have been
  checking from the homepage https://camel.apache.org but not able get any
  information.
  In addition, I would also like to know the end of life date of every
  version so that i can plan when to upgrade my library.
  Thanks alot in advance for your help.
 
  Wai Lik



 --
 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
 Make your Camel applications look hawt, try: http://hawt.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
Make your Camel applications look hawt, try: http://hawt.io


Testing new ScheduledBatchPollingConsumer

2014-03-18 Thread SteveCam
Hello,

I am trying to write a new Camel Component by extending the
ScheduledBatchPollingConsumer.

Its for the Amazon MWS Orders API, I now want to test it with a Mock
provided by Amazon in their download.

I cannot figure what I need to do to achieve this.

In my test class I have a setUp as follows.

public class MwsOrdersConsumerTest extends CamelTestSupport {

private MwsOrdersEndpoint endpoint;

@Before
public void setUp() throws Exception {

MwsOrdersConfiguration config = new MwsOrdersConfiguration();
//set the MWS client to be the mock client provided
config.setMWSOrdersClient(new MarketplaceWebServiceOrdersMock());
endpoint = new MwsOrdersEndpoint(aws-mws-orders, new
MwsOrdersComponent(new DefaultCamelContext()), config);
}

Now I need a @Test routine that will trigger the poll() method of my new
Consumer. But at the moment I cannot see what needs to be done to do that?

I am copying the aws-sqs code, but its still not clear how that works to me.

Thanks

Steve Cameron





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


JavaFX + Spring + Camel + Maven

2014-03-18 Thread Maurice
Dear Community,

i am trying to build a JavaFX standalone application using Spring as DI an
Camel for routing.
The application is working fine with Spring only using a modified FXML
Loader:


This is the context XML :

As soon as i uncomment the camelcontext tags i get the following exception:

Camel-core and camel-spring jars are on the classpath. What am i missing?



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


Re: JavaFX + Spring + Camel + Maven

2014-03-18 Thread Maurice
To answer my own question, i am missing the entries from the spring.handlers
and spring.schemas files from the camel-spring jar in my application Jar.
Now how do i do that?



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


Re: sjms and multiple threads

2014-03-18 Thread Bengt Rodehav
Here is some feedback.

It seems like Weblogic is not the bottleneck. I can write about 300
messages per second and read about 1400 messages per second.

In fact, as long as I use at least three threads, Camel does not seem to be
the problem. It's the unmarshalling of the XML file that takes 100 ms when
I run it in Karaf. For some reason it only takes about 10 ms when I do it
outside Karaf (as a Junit test in Eclipse). Have no idea why since I'm
unmarshalling the same file. In both cases I use the same Unmarshaller
implementation (com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl).

However this is not a Camel problem anymore. Thanks for your help.

/Bengt


2014-03-17 20:33 GMT+01:00 Bengt Rodehav be...@rodehav.com:

 Hi!

 I use the latest version of Camel, 2.12.3.

 /Bengt
 Den 17 mar 2014 18:10 skrev Scott England-Sullivan sully6...@gmail.com
 :

 Hi Bengt,

 What version of SJMS are you using?  In earlier versions I had code in
 that
 reused a single session for multiple consumers.  This in effect made it
 single threaded.  Later versions (2.13  2.12.3) have a patch that has
 removed the session restriction and uses a session per consumer.


 On Mon, Mar 17, 2014 at 10:34 AM, Bengt Rodehav be...@rodehav.com
 wrote:

  I've done some more research. It turns out that I was mistaken regarding
  the throughput. I had been watching the JMX attribute
 MeanProcessingTime
  which is the same regardless of the number of threads. However the
 actual
  time taken to process 1000 messages is 115 seconds using one thread but
 38
  seconds using three threads. Using more threads than three does not
  increase throughput.
 
  I think it's interesting that I can get my throughput down by (almost)
  exactly a factor of three if I use three threads.
 
  Another interesting fact is that for every message I read from JMS I
 create
  exactly three messages that I write on another queue. The number three
  keeps coming up...
 
  Since I do about 1500 reads and 4500 writes from/to Weblogic JMS per
 minute
  I guess it is possible that Weblogic JMS is the bottleneck. It is about
 100
  JMS operations/second.
 
  /Bengt
 
 
 
  2014-03-17 13:55 GMT+01:00 Bengt Rodehav be...@rodehav.com:
 
   Hello Charles,
  
   I looked at your unit test but I don't understand it all. It seems to
 use
   an inout pattern and logs the threadId which I guess is a way to see
 that
   different threads are used. I haven't logged that in my code yet.
  
   However, I do get multiple threads to work by using consumerCount,
   producerCount and threads - all set to the same value. But I don't
  get
   any better throughput which leads me to believe that somehow the
  execution
   is still serialized somewhere - i e there is a bottleneck somewhere.
  
   I think it should be a fairly common scenario to want to consumer JMS
   message in a multithreaded fashion in order to increase throughput.
 But
   perhaps no one has done this with sjms yet.
  
   /Bengt
  
  
  
  
   2014-03-17 11:27 GMT+01:00 Charles Moulliard ch0...@gmail.com:
  
   Commit available here :
  
  
 
 https://git-wip-us.apache.org/repos/asf?p=camel.git;a=commit;h=1a7b676e1b5c29b652e3faf16240ee3cc831a0c9
  
  
   On Mon, Mar 17, 2014 at 11:20 AM, Charles Moulliard 
 ch0...@gmail.com
   wrote:
  
I will commit soon a unit test. That could help us to verify if
   something
goes wrong.
   
   
On Mon, Mar 17, 2014 at 9:38 AM, Bengt Rodehav be...@rodehav.com
   wrote:
   
An update.
   
I noticed in the stack trace that it seems to be the *production*
 of
messages that get the exception Unable to complete sending the
   message:
Only one thread may use a JMS Session at a time. - not the
   *consumption*.
I also only showed you the first part of the route (cause I didn't
   think
the rest mattered). What I do is basically reading xml messages
 from
   one
queue, transforming them and the sending them to another queue.
   
Moreover, one incoming message may end up creating more than one
 (in
   this
case 3) out messages. I'm using a splitter to accomplish this. In
   pseudo
code the route looks like this:
   
   
  
 from(sjms:...).threads(10).process(converting...).split().to(sjms:...);
   
If I set consumerCount=10 on the consumer endpoint AND use
  threads(10)
then
I can see that more threads are created but I get the Only one
  thread
   may
use ... exception. Now, if I also set the producerCount=10 on the
producer
endpoint then this exception goes away and my route works.
   
Not exactly sure why this works. If anyone could explain the
   relationship
between consumer/producer count and threads I would appreciate
 it. A
theory
of mine is that there must be at least as many
 consumers/producers as
there
are threads or there is a risk that two threads will try to use
 the
   same
consumer/producer. If there is a one-to-one relationship between
consumer/producer and JMS 

Seeing Info message all over log file related to Woodstox

2014-03-18 Thread Nair, Madhu
Hi,
I see the following info message all over the log file and it occurs only in 
one environment and not in the other. I am assuming it occurs in one 
environment because of the randomness with which the server loads the jar files.

The message is:-
2014-03-06 22:23:47,401 | INFO | APPW111A:mmZreRm_-q | XmlErrorListener | Msg: 
DOMSource is known to have issues with
{0}. We suggest using Woodstox


The concern is with this part of the message DOMSource is known to have issues 
with
{0}. We suggest using Woodstox.

How do I get rid of this message? Looking at the source code for Camel it seems 
like this message occurs since we are not using the Woodstox parser.

Do I specify to Camel the Stax parser to use by using the system property 
javax.xml.stream.XMLInputFactory? Is there any other way?


Camel version is 2.9.2 and application server is WAS 7. JDK is 1.6.




Thanks,
Madhu






Re: Question about end of life date for camel library

2014-03-18 Thread Wai Lik Chong
Hi Claus,

Thanks for your information. That is awesome! Yes, i am currently still
using camel 2.1.0 in the project (never been upgraded since about 5 years
ago). I'm looking into the camel upgrade now, therefore i want assess which
camel version should go for based on the impact and support available.


On 18 March 2014 18:42, Claus Ibsen claus.ib...@gmail.com wrote:

 On Tue, Mar 18, 2014 at 11:31 AM, Wai Lik Chong wailik.mo...@gmail.com
 wrote:
  Hi Claus,
 
  Thanks alot for answer.
  Is this rule of thumb will always apply to all other apache library such
 as
  apache abdera, axiom etc?
 

 No each Apache projects has their own policy. Some projects only
 support latest code, and others do support and release patch releases
 etc. Mind that support is many things. You can always contact any
 Apache project using the mailing list to ask for help - also for older
 releases etc. Its just that some Apache projects do not fix and
 release on older versions. eg its not fun to fix stuff in code that is
 many years old etc. But the source code is free, and anyone can grab
 the code, and apply their own fixes. For example if a fix has been
 merged to a newer release, you can try to apply that same fix on the
 source code of old fix to try to fix it yourself etc.


 Also all support from Apache is community and volunteer based.
 Some Apache projects has commercial support from companies. That are
 usually the bigger Apache projects.

 PS: Are you really using Apache Camel 2.1.0 - that is very old. Or do
 you mean Camel 2.11 ? eg eleven?




  Thanks in advance
  Wai Lik
 
 
  On 18 March 2014 16:54, Claus Ibsen claus.ib...@gmail.com wrote:
 
  Hi
 
  See
  http://camel.apache.org/download
 
  When Camel 2.13.0 is released (soon) then Camel 2.11.x is retired and
  no longer active supported.
  The rule of thumb is that we support 2 patch branches back.
 
  If you are looking for a longer support timeframe, you can try
  commercial support
  http://camel.apache.org/commercial-camel-offerings.html
 
  On Tue, Mar 18, 2014 at 9:51 AM, Wai Lik Chong wailik.mo...@gmail.com
  wrote:
   Hi,
  
   I have been using camel 2.1.0 in my project. I would like to know
 when is
   the end of life support for the library version I am using. I have
 been
   checking from the homepage https://camel.apache.org but not able get
 any
   information.
   In addition, I would also like to know the end of life date of every
   version so that i can plan when to upgrade my library.
   Thanks alot in advance for your help.
  
   Wai Lik
 
 
 
  --
  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
  Make your Camel applications look hawt, try: http://hawt.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
 Make your Camel applications look hawt, try: http://hawt.io



Polling Email Component - Runtime Error

2014-03-18 Thread contactreji
Hi

I have a route as follows

*   route

from

uri=imaps://imap.gmail.com?username=mygmai...@gmail.comamp;password=mypasswordamp;delete=falseamp;unseen=trueamp;consumer.delay=6amp;mapMailMessage=trueamp;delete=true
/

to uri=seda:emails /

/route*


On execution, I am getting following runtime error. Can you tell me why
there is a NULL pointor exception. My email does contain content for the
Email Body though.


2014-03-18 20:28:58,677 [ing.Main.main()] INFO  SpringCamelContext
- Total 1 routes, of which 1 is started.
2014-03-18 20:28:58,678 [ing.Main.main()] INFO  SpringCamelContext
- Apache Camel 2.10.0.fuse-71-047 (CamelContext: camel-1) started in 0.852
seconds
2014-03-18 20:31:11,398 [/imap.gmail.com] WARN  MailConsumer  
- Caused by: [org.apache.camel.RuntimeCamelException - Failed to extract
body due to: null. Exchange: Exchange[MailMessage: messageNumber=[1],
from=[Sample Sender samplesen...@gmail.com], to=[reji.c...@gmail.com],
subject=[test], sentDate=[18 Mar, 2014 8:29:42 PM], receivedDate=[18 Mar,
2014 8:29:44 PM]]. Message: com.sun.mail.imap.IMAPMessage@121cbd6]
org.apache.camel.RuntimeCamelException: Failed to extract body due to: null.
Exchange: Exchange[MailMessage: messageNumber=[1], from=[Frenchi Elizabeth
bethf...@gmail.com], to=[reji.c...@gmail.com], subject=[test],
sentDate=[18 Mar, 2014 8:29:42 PM], receivedDate=[18 Mar, 2014 8:29:44 PM]].
Message: com.sun.mail.imap.IMAPMessage@121cbd6
at
org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:269)
at
org.apache.camel.component.mail.MailMessage.createBody(MailMessage.java:96)
at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:41)
at 
org.apache.camel.impl.MessageSupport.copyFrom(MessageSupport.java:135)
at
org.apache.camel.component.mail.MailMessage.copyFrom(MailMessage.java:130)
at org.apache.camel.impl.MessageSupport.copy(MessageSupport.java:124)
at org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:56)
at org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:33)
at
org.apache.camel.impl.DefaultUnitOfWork.init(DefaultUnitOfWork.java:91)
at
org.apache.camel.impl.DefaultUnitOfWork.init(DefaultUnitOfWork.java:71)
at
org.apache.camel.processor.UnitOfWorkProcessor.createUnitOfWork(UnitOfWorkProcessor.java:190)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)
at
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
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.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
at
org.apache.camel.component.mail.MailConsumer.processExchange(MailConsumer.java:238)
at
org.apache.camel.component.mail.MailConsumer.processBatch(MailConsumer.java:189)
at



--
View this message in context: 
http://camel.465427.n5.nabble.com/Polling-Email-Component-Runtime-Error-tp5749047.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JavaFX + Spring + Camel + Maven

2014-03-18 Thread Maurice
The solution is not a beauty but works with maven and Netbeans sofar:





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


Re: Polling Email Component - Runtime Error

2014-03-18 Thread Claus Ibsen
Because you use seda to hand off processing the mail. Use direct
instead, or use wait=always for seda to ensure the mail has been
processed, when you at the end is marking the mail as deleted etc.
That work must happen on same thread and after you have processed the
mail.


On Tue, Mar 18, 2014 at 4:08 PM, contactreji contactr...@gmail.com wrote:
 Hi

 I have a route as follows

 *   route

 from

 uri=imaps://imap.gmail.com?username=mygmai...@gmail.comamp;password=mypasswordamp;delete=falseamp;unseen=trueamp;consumer.delay=6amp;mapMailMessage=trueamp;delete=true
 /

 to uri=seda:emails /

 /route*


 On execution, I am getting following runtime error. Can you tell me why
 there is a NULL pointor exception. My email does contain content for the
 Email Body though.


 2014-03-18 20:28:58,677 [ing.Main.main()] INFO  SpringCamelContext
 - Total 1 routes, of which 1 is started.
 2014-03-18 20:28:58,678 [ing.Main.main()] INFO  SpringCamelContext
 - Apache Camel 2.10.0.fuse-71-047 (CamelContext: camel-1) started in 0.852
 seconds
 2014-03-18 20:31:11,398 [/imap.gmail.com] WARN  MailConsumer
 - Caused by: [org.apache.camel.RuntimeCamelException - Failed to extract
 body due to: null. Exchange: Exchange[MailMessage: messageNumber=[1],
 from=[Sample Sender samplesen...@gmail.com], to=[reji.c...@gmail.com],
 subject=[test], sentDate=[18 Mar, 2014 8:29:42 PM], receivedDate=[18 Mar,
 2014 8:29:44 PM]]. Message: com.sun.mail.imap.IMAPMessage@121cbd6]
 org.apache.camel.RuntimeCamelException: Failed to extract body due to: null.
 Exchange: Exchange[MailMessage: messageNumber=[1], from=[Frenchi Elizabeth
 bethf...@gmail.com], to=[reji.c...@gmail.com], subject=[test],
 sentDate=[18 Mar, 2014 8:29:42 PM], receivedDate=[18 Mar, 2014 8:29:44 PM]].
 Message: com.sun.mail.imap.IMAPMessage@121cbd6
 at
 org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:269)
 at
 org.apache.camel.component.mail.MailMessage.createBody(MailMessage.java:96)
 at 
 org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:41)
 at 
 org.apache.camel.impl.MessageSupport.copyFrom(MessageSupport.java:135)
 at
 org.apache.camel.component.mail.MailMessage.copyFrom(MailMessage.java:130)
 at org.apache.camel.impl.MessageSupport.copy(MessageSupport.java:124)
 at 
 org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:56)
 at 
 org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:33)
 at
 org.apache.camel.impl.DefaultUnitOfWork.init(DefaultUnitOfWork.java:91)
 at
 org.apache.camel.impl.DefaultUnitOfWork.init(DefaultUnitOfWork.java:71)
 at
 org.apache.camel.processor.UnitOfWorkProcessor.createUnitOfWork(UnitOfWorkProcessor.java:190)
 at
 org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)
 at
 org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
 at
 org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
 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.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
 at
 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
 at
 org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
 at
 org.apache.camel.component.mail.MailConsumer.processExchange(MailConsumer.java:238)
 at
 org.apache.camel.component.mail.MailConsumer.processBatch(MailConsumer.java:189)
 at



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Polling-Email-Component-Runtime-Error-tp5749047.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
Make your Camel applications look hawt, try: http://hawt.io


Re: Polling Email Component - Runtime Error

2014-03-18 Thread contactreji
Hi Claus

Thanks for that quick help.

I have modified my route file as follows and passed the Exchange into a
processor class where I process the 
contents.
*   route

from

uri=imaps://imap.gmail.com?username=mygmai...@gmail.comamp;password=passwordamp;delete=falseamp;unseen=trueamp;consumer.delay=6amp;mapMailMessage=trueamp;delete=true/
to uri=bean:processEmail /

/route*


Yet am getting following error. It looks more like issues with extracting
body from email. 

2014-03-18 21:04:05,883 [ing.Main.main()] INFO  SpringCamelContext
- Total 1 routes, of which 1 is started.
2014-03-18 21:04:05,886 [ing.Main.main()] INFO  SpringCamelContext
- Apache Camel 2.10.0.fuse-71-047 (CamelContext: camel-1) started in 0.820
seconds
2014-03-18 21:04:16,421 [/imap.gmail.com] WARN  MailConsumer  
- Caused by: [org.apache.camel.RuntimeCamelException - Failed to extract
body due to: null. Exchange: Exchange[MailMessage: messageNumber=[1],
from=[Frenchi Elizabeth bethf...@gmail.com], to=[reji.c...@gmail.com],
subject=[test], sentDate=[18 Mar, 2014 8:55:42 PM], receivedDate=[18 Mar,
2014 8:55:43 PM]]. Message: com.sun.mail.imap.IMAPMessage@151c590]
org.apache.camel.RuntimeCamelException: Failed to extract body due to: null.
Exchange: Exchange[MailMessage: messageNumber=[1], from=[Frenchi Elizabeth
bethf...@gmail.com], to=[reji.c...@gmail.com], subject=[test],
sentDate=[18 Mar, 2014 8:55:42 PM], receivedDate=[18 Mar, 2014 8:55:43 PM]].
Message: com.sun.mail.imap.IMAPMessage@151c590
at
org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:269)
at
org.apache.camel.component.mail.MailMessage.createBody(MailMessage.java:96)
at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:41)
at 
org.apache.camel.impl.MessageSupport.copyFrom(MessageSupport.java:135)
at
org.apache.camel.component.mail.MailMessage.copyFrom(MailMessage.java:130)
at org.apache.camel.impl.MessageSupport.copy(MessageSupport.java:124)
at org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:56)
at org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:33)
at
org.apache.camel.impl.DefaultUnitOfWork.init(DefaultUnitOfWork.java:91)
at
org.apache.camel.impl.DefaultUnitOfWork.init(DefaultUnitOfWork.java:71)
at
org.apache.camel.processor.UnitOfWorkProcessor.createUnitOfWork(UnitOfWorkProcessor.java:190)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)
at
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
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.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
at
org.apache.camel.component.mail.MailConsumer.processExchange(MailConsumer.java:238)
at
org.apache.camel.component.mail.MailConsumer.processBatch(MailConsumer.java:189)
at 
org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:115)
at
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:142)
at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:92)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown
Source)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at javax.mail.internet.ParameterList.set(ParameterList.java:165)
at
com.sun.mail.imap.protocol.BODYSTRUCTURE.parseParameters(BODYSTRUCTURE.java:404)
at 
com.sun.mail.imap.protocol.BODYSTRUCTURE.init(BODYSTRUCTURE.java:224)
at 
com.sun.mail.imap.protocol.BODYSTRUCTURE.init(BODYSTRUCTURE.java:109)
at 
com.sun.mail.imap.protocol.FetchResponse.parse(FetchResponse.java:158)
at 

RE: Seeing Info message all over log file related to Woodstox

2014-03-18 Thread Nair, Madhu
Thanks for the quick response.  I do have the woodstox jar in the classpath but 
still get this message. Do I force Camel to use the woodstox parser by setting 
the system property javax.xml.stream.XMLInputFactory to the Woodstox parser?



-Original Message-
From: Claus Ibsen [mailto:claus.ib...@gmail.com] 
Sent: Tuesday, March 18, 2014 11:38 AM
To: users@camel.apache.org
Subject: Re: Seeing Info message all over log file related to Woodstox

Hi

Yeah we should tone this down, so the INFO logging only happen once
https://issues.apache.org/jira/browse/CAMEL-7309

To use woodstock you just add it to the classpath i think 
http://woodstox.codehaus.org/

On Tue, Mar 18, 2014 at 3:21 PM, Nair, Madhu nair.ma...@aoins.com wrote:
 Hi,
 I see the following info message all over the log file and it occurs only in 
 one environment and not in the other. I am assuming it occurs in one 
 environment because of the randomness with which the server loads the jar 
 files.

 The message is:-
 2014-03-06 22:23:47,401 | INFO | APPW111A:mmZreRm_-q | 
 XmlErrorListener | Msg: DOMSource is known to have issues with {0}. We 
 suggest using Woodstox


 The concern is with this part of the message DOMSource is known to 
 have issues with {0}. We suggest using Woodstox.

 How do I get rid of this message? Looking at the source code for Camel it 
 seems like this message occurs since we are not using the Woodstox parser.

 Do I specify to Camel the Stax parser to use by using the system property 
 javax.xml.stream.XMLInputFactory? Is there any other way?


 Camel version is 2.9.2 and application server is WAS 7. JDK is 1.6.




 Thanks,
 Madhu







--
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 Make your Camel 
applications look hawt, try: http://hawt.io


Re: Seeing Info message all over log file related to Woodstox

2014-03-18 Thread Claus Ibsen
Hi

Yeah Camel uses
javax.xml.stream.XMLInputFactory#newInstance()

to get the factory, and that uses that system property to lookup the
factory. So you can switch to use woodstock then. Though that is for
the entire JVM.

Otherwise it ought to fallback to JAR classpath scanning. But I guess
woodstock and other xml parsers have that documented. You can search
the web for details. That would allow you to do this for this
deployment unit only. And leave the others as-is. In case using a jvm
system property is not possible.

On Tue, Mar 18, 2014 at 4:48 PM, Nair, Madhu nair.ma...@aoins.com wrote:
 Thanks for the quick response.  I do have the woodstox jar in the classpath 
 but still get this message. Do I force Camel to use the woodstox parser by 
 setting the system property javax.xml.stream.XMLInputFactory to the Woodstox 
 parser?



 -Original Message-
 From: Claus Ibsen [mailto:claus.ib...@gmail.com]
 Sent: Tuesday, March 18, 2014 11:38 AM
 To: users@camel.apache.org
 Subject: Re: Seeing Info message all over log file related to Woodstox

 Hi

 Yeah we should tone this down, so the INFO logging only happen once
 https://issues.apache.org/jira/browse/CAMEL-7309

 To use woodstock you just add it to the classpath i think 
 http://woodstox.codehaus.org/

 On Tue, Mar 18, 2014 at 3:21 PM, Nair, Madhu nair.ma...@aoins.com wrote:
 Hi,
 I see the following info message all over the log file and it occurs only in 
 one environment and not in the other. I am assuming it occurs in one 
 environment because of the randomness with which the server loads the jar 
 files.

 The message is:-
 2014-03-06 22:23:47,401 | INFO | APPW111A:mmZreRm_-q |
 XmlErrorListener | Msg: DOMSource is known to have issues with {0}. We
 suggest using Woodstox


 The concern is with this part of the message DOMSource is known to
 have issues with {0}. We suggest using Woodstox.

 How do I get rid of this message? Looking at the source code for Camel it 
 seems like this message occurs since we are not using the Woodstox parser.

 Do I specify to Camel the Stax parser to use by using the system property 
 javax.xml.stream.XMLInputFactory? Is there any other way?


 Camel version is 2.9.2 and application server is WAS 7. JDK is 1.6.




 Thanks,
 Madhu







 --
 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 Make your Camel 
 applications look hawt, try: http://hawt.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
Make your Camel applications look hawt, try: http://hawt.io


Re: Is RAW() required in message endpoint URI with percent-endcoded special characters?

2014-03-18 Thread Phil Mocek
On March 13, 2014, Phil Mocek wrote:
 Must percent-encoded special characters in a Camel message endpoint URI
 be wrapped in RAW() in order for Camel to correctly process the URI?

Nobody answered my question.  Off-list last week, I e-mailed Camel
contributor Claus Ibsen, who is named in relevant tickets, but did not
receive any response from him.  I am unauthorized to comment in the
Camel issue tracking system.

It seems that the answer is yes, and that the Camel documentation does
not reflect this.  I still hope to learn whether Camel's aws-sqs URI
scheme syntax (and maybe that of other schemes) has changed or if this
requirement is the result of the bug described in CAMEL-4954.

Following is the related guidance I provided to developers at my
place of business:


Since v2.9.0 or earlier, Camel has had [a bug][1] that causes it
to process some message endpoint URIs incorrectly (in particular,
those URIs that include [percent-encoded][2] [reserved
characters][3]).  As a workaround, one can use a slightly
different URI syntax.

According to the seemingly-outdated [Camel documentation of its
aws-sqs scheme][4], given the following:

Queue name: my-sqs-queue
AWS access key: AKIADKB5LS3V6L9XWB2
AWS secret key: wvAUnoM+RLZzdWmyBDI/dLRGEHa8BY57sKjy0tXO

the URI that should be used to configure an application for use of
this queue as a message channel is:


aws-sqs://my-sqs-queue?accessKey=AKIADKB5LS3V6L9XWB2secretKey=wvAUnoM%2BRLZzdWmyBDI%2FdLRGEHa8BY57sKjy0tXO

Instead, we'll use:


aws-sqs://my-sqs-queue?accessKey=AKIADKB5LS3V6L9XWB2secretKey=RAW(wvAUnoM%2BRLZzdWmyBDI%2FdLRGEHa8BY57sKjy0tXO)

The + and / characters, which sometimes occur in AWS secret
keys, have special meaning in URIs (i.e., they are reserved for
special use in the URI definition), so we percent-encode them in
our aws-sqs URIs just as we would in a URI of any other scheme.
Camel does not handle the result of that encoding correctly, so we
enclose it it in RAW( and ).

RAW() was [added with Camel 2.11][5].


References:

 [1]: https://issues.apache.org/jira/browse/CAMEL-4954
  CAMEL-4954: Camel 2.9.0 incapable of working with % in endpoint URIs
 [2]: https://tools.ietf.org/html/std66#section-2.1
  IETF STD 66: URI Generic Syntax: 2.1. Percent-Encoding
 [3]: https://tools.ietf.org/html/std66#section-2.2
  IETF STD 66: URI Generic Syntax: 2.2. Reserved Characters
 [4]: https://camel.apache.org/aws-sqs#AWS-SQS-URIFormat
  Apache Camel  Documentation  Components  AWS  AWS-SQS  URI
Format
 [5]: https://camel.apache.org/camel-2110-release.html
  Camel 2.11.0 release notes

-- 
Phil Mocek
http://mocek.org


Re: Polling Email Component - Runtime Error

2014-03-18 Thread Claus Ibsen
Hi

Yeah that is a bug in the java mail JAR. You may try upgrading that if
its fixed in a newer release.
Maybe its only a single email that has this problem? You can try
deleting it so you can poll the next.

You can also tell Camel to not map the mail message with
mapMailMessage=false, see more details at
http://camel.apache.org/mail

And I think you can plugin your custom mail mapper in the Camel mail
component to fix/workaround this problem.

On Tue, Mar 18, 2014 at 4:43 PM, contactreji contactr...@gmail.com wrote:
 Hi Claus

 Thanks for that quick help.

 I have modified my route file as follows and passed the Exchange into a
 processor class where I process the
 contents.
 *   route

 from

 uri=imaps://imap.gmail.com?username=mygmai...@gmail.comamp;password=passwordamp;delete=falseamp;unseen=trueamp;consumer.delay=6amp;mapMailMessage=trueamp;delete=true/
 to uri=bean:processEmail /

 /route*


 Yet am getting following error. It looks more like issues with extracting
 body from email.

 2014-03-18 21:04:05,883 [ing.Main.main()] INFO  SpringCamelContext
 - Total 1 routes, of which 1 is started.
 2014-03-18 21:04:05,886 [ing.Main.main()] INFO  SpringCamelContext
 - Apache Camel 2.10.0.fuse-71-047 (CamelContext: camel-1) started in 0.820
 seconds
 2014-03-18 21:04:16,421 [/imap.gmail.com] WARN  MailConsumer
 - Caused by: [org.apache.camel.RuntimeCamelException - Failed to extract
 body due to: null. Exchange: Exchange[MailMessage: messageNumber=[1],
 from=[Frenchi Elizabeth bethf...@gmail.com], to=[reji.c...@gmail.com],
 subject=[test], sentDate=[18 Mar, 2014 8:55:42 PM], receivedDate=[18 Mar,
 2014 8:55:43 PM]]. Message: com.sun.mail.imap.IMAPMessage@151c590]
 org.apache.camel.RuntimeCamelException: Failed to extract body due to: null.
 Exchange: Exchange[MailMessage: messageNumber=[1], from=[Frenchi Elizabeth
 bethf...@gmail.com], to=[reji.c...@gmail.com], subject=[test],
 sentDate=[18 Mar, 2014 8:55:42 PM], receivedDate=[18 Mar, 2014 8:55:43 PM]].
 Message: com.sun.mail.imap.IMAPMessage@151c590
 at
 org.apache.camel.component.mail.MailBinding.extractBodyFromMail(MailBinding.java:269)
 at
 org.apache.camel.component.mail.MailMessage.createBody(MailMessage.java:96)
 at 
 org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:41)
 at 
 org.apache.camel.impl.MessageSupport.copyFrom(MessageSupport.java:135)
 at
 org.apache.camel.component.mail.MailMessage.copyFrom(MailMessage.java:130)
 at org.apache.camel.impl.MessageSupport.copy(MessageSupport.java:124)
 at 
 org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:56)
 at 
 org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:33)
 at
 org.apache.camel.impl.DefaultUnitOfWork.init(DefaultUnitOfWork.java:91)
 at
 org.apache.camel.impl.DefaultUnitOfWork.init(DefaultUnitOfWork.java:71)
 at
 org.apache.camel.processor.UnitOfWorkProcessor.createUnitOfWork(UnitOfWorkProcessor.java:190)
 at
 org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)
 at
 org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
 at
 org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
 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.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
 at
 org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
 at
 org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
 at
 org.apache.camel.component.mail.MailConsumer.processExchange(MailConsumer.java:238)
 at
 org.apache.camel.component.mail.MailConsumer.processBatch(MailConsumer.java:189)
 at 
 org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:115)
 at
 org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:142)
 at
 org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:92)
 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
 at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
 at
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown
 Source)
 at
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown
 Source)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown 

Re: Is RAW() required in message endpoint URI with percent-endcoded special characters?

2014-03-18 Thread Claus Ibsen
On Tue, Mar 18, 2014 at 5:03 PM, Phil Mocek phil-li...@mocek.org wrote:
 On March 13, 2014, Phil Mocek wrote:
 Must percent-encoded special characters in a Camel message endpoint URI
 be wrapped in RAW() in order for Camel to correctly process the URI?

 Nobody answered my question.  Off-list last week, I e-mailed Camel
 contributor Claus Ibsen, who is named in relevant tickets, but did not
 receive any response from him.  I am unauthorized to comment in the
 Camel issue tracking system.


See last bullet in how to get help section at
http://camel.apache.org/support

Apache is a 100% open community, and its important that all
conversation happens in the open, and on Apache infrastructure (eg
mailing list / JIRA / etc) - so everybody can follow.



 It seems that the answer is yes, and that the Camel documentation does
 not reflect this.  I still hope to learn whether Camel's aws-sqs URI
 scheme syntax (and maybe that of other schemes) has changed or if this
 requirement is the result of the bug described in CAMEL-4954.

 Following is the related guidance I provided to developers at my
 place of business:


 Since v2.9.0 or earlier, Camel has had [a bug][1] that causes it
 to process some message endpoint URIs incorrectly (in particular,
 those URIs that include [percent-encoded][2] [reserved
 characters][3]).  As a workaround, one can use a slightly
 different URI syntax.

 According to the seemingly-outdated [Camel documentation of its
 aws-sqs scheme][4], given the following:

 Queue name: my-sqs-queue
 AWS access key: AKIADKB5LS3V6L9XWB2
 AWS secret key: wvAUnoM+RLZzdWmyBDI/dLRGEHa8BY57sKjy0tXO

 the URI that should be used to configure an application for use of
 this queue as a message channel is:


 aws-sqs://my-sqs-queue?accessKey=AKIADKB5LS3V6L9XWB2secretKey=wvAUnoM%2BRLZzdWmyBDI%2FdLRGEHa8BY57sKjy0tXO

 Instead, we'll use:


 aws-sqs://my-sqs-queue?accessKey=AKIADKB5LS3V6L9XWB2secretKey=RAW(wvAUnoM%2BRLZzdWmyBDI%2FdLRGEHa8BY57sKjy0tXO)

 The + and / characters, which sometimes occur in AWS secret
 keys, have special meaning in URIs (i.e., they are reserved for
 special use in the URI definition), so we percent-encode them in
 our aws-sqs URIs just as we would in a URI of any other scheme.
 Camel does not handle the result of that encoding correctly, so we
 enclose it it in RAW( and ).

 RAW() was [added with Camel 2.11][5].


You can configure endpoints in many ways in Camel. For example using
plain java code, with getter/setter etc. But most people favor using
the uri syntax directly in their routes.
And when you do that then care should be taken when using special
characters like + and % signs etc.

The RAW() syntax tells Camel to leave the uri normalized out of that
part, and the user want the data as-is.

So if your AWS keys are using such chars, then RAW is the correct way
to do that, if you configure using uri style.

And Apache loves contributions, so you are welcome to fix/help with
the docs, in case you think the AWS page need some help
http://camel.apache.org/contributing

For example from the user guide there is the how do i configure endpoints
http://camel.apache.org/user-guide.html

which documents the RAW () in endpoint uri style
http://camel.apache.org/how-do-i-configure-endpoints.html


 References:

  [1]: https://issues.apache.org/jira/browse/CAMEL-4954
   CAMEL-4954: Camel 2.9.0 incapable of working with % in endpoint URIs
  [2]: https://tools.ietf.org/html/std66#section-2.1
   IETF STD 66: URI Generic Syntax: 2.1. Percent-Encoding
  [3]: https://tools.ietf.org/html/std66#section-2.2
   IETF STD 66: URI Generic Syntax: 2.2. Reserved Characters
  [4]: https://camel.apache.org/aws-sqs#AWS-SQS-URIFormat
   Apache Camel  Documentation  Components  AWS  AWS-SQS  URI
 Format
  [5]: https://camel.apache.org/camel-2110-release.html
   Camel 2.11.0 release notes

 --
 Phil Mocek
 http://mocek.org



-- 
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
Make your Camel applications look hawt, try: http://hawt.io


Re: Polling Email Component - Runtime Error

2014-03-18 Thread contactreji
Hi Claus

I upgraded the Camel version as well as the camel-mail to
version2.11.1/version

I set the mapMailMessage=false too. I followed your advice at the link
https://issues.apache.org/jira/browse/CAMEL-6154 by setting
closeFolder=false

Still am stuck up with the error as below

*2014-03-18 22:02:56,406 [ing.Main.main()] INFO  SpringCamelContext
- Apache Camel 2.11.1 (CamelContext: camel-1) started in 2.275 seconds
2014-03-18 22:03:07,448 [/imap.gmail.com] WARN  MailConsumer  
- Caused by: [org.apache.camel.RuntimeCamelException - Error populating the
initial mail message attachments]
org.apache.camel.RuntimeCamelException: Error populating the initial mail
message attachments
at
org.apache.camel.component.mail.MailMessage.populateInitialAttachments(MailMessage.java:124)
at
org.apache.camel.impl.DefaultMessage.createAttachments(DefaultMessage.java:209)
at
org.apache.camel.impl.DefaultMessage.getAttachments(DefaultMessage.java:274)
at org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:62)
at org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:33)
at
org.apache.camel.impl.DefaultUnitOfWork.init(DefaultUnitOfWork.java:91)
at
org.apache.camel.impl.DefaultUnitOfWork.init(DefaultUnitOfWork.java:71)
at
org.apache.camel.processor.UnitOfWorkProcessor.createUnitOfWork(UnitOfWorkProcessor.java:190)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)
at
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
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.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)
at
org.apache.camel.component.mail.MailConsumer.processExchange(MailConsumer.java:255)
at
org.apache.camel.component.mail.MailConsumer.processBatch(MailConsumer.java:199)
at 
org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:118)
at
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:142)
at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:92)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
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:744)
Caused by: java.lang.NullPointerException
at javax.mail.internet.ParameterList.set(ParameterList.java:165)
at
com.sun.mail.imap.protocol.BODYSTRUCTURE.parseParameters(BODYSTRUCTURE.java:404)
at 
com.sun.mail.imap.protocol.BODYSTRUCTURE.init(BODYSTRUCTURE.java:224)
at 
com.sun.mail.imap.protocol.BODYSTRUCTURE.init(BODYSTRUCTURE.java:109)
at 
com.sun.mail.imap.protocol.BODYSTRUCTURE.init(BODYSTRUCTURE.java:109)
at
com.sun.mail.imap.protocol.FetchResponse.parseItem(FetchResponse.java:198)
at 
com.sun.mail.imap.protocol.FetchResponse.parse(FetchResponse.java:164)
at 
com.sun.mail.imap.protocol.FetchResponse.init(FetchResponse.java:92)
at
com.sun.mail.imap.protocol.IMAPProtocol.readResponse(IMAPProtocol.java:288)
at com.sun.mail.iap.Protocol.command(Protocol.java:313)
at com.sun.mail.imap.protocol.IMAPProtocol.fetch(IMAPProtocol.java:1543)
at com.sun.mail.imap.protocol.IMAPProtocol.fetch(IMAPProtocol.java:1535)
at
com.sun.mail.imap.protocol.IMAPProtocol.fetchBodyStructure(IMAPProtocol.java:1235)
at 
com.sun.mail.imap.IMAPMessage.loadBODYSTRUCTURE(IMAPMessage.java:1294)
at com.sun.mail.imap.IMAPMessage.getDataHandler(IMAPMessage.java:639)
at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:927)
at
org.apache.camel.component.mail.MailBinding.extractAttachmentsFromMail(MailBinding.java:291)
at

Re: Polling Email Component - Runtime Error

2014-03-18 Thread contactreji
Hi Claus

I am getting a new set of errors in log now.. There seems to be something
different here. This happended when I had set mapMailMessage=false
Have any idea whats the fix from this point onwards?

*
2014-03-18 22:22:11,966 [/imap.gmail.com] WARN  MailConsumer  
- Caused by: [org.apache.camel.RuntimeCamelException - Error populating the
initial mail message attachments]
org.apache.camel.RuntimeCamelException: Error populating the initial mail
message attachments
at
org.apache.camel.component.mail.MailMessage.populateInitialAttachments(MailMessage.java:124)
at
org.apache.camel.impl.DefaultMessage.createAttachments(DefaultMessage.java:209)
at
org.apache.camel.impl.DefaultMessage.getAttachments(DefaultMessage.java:274)
at org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:62)
at org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:33)
at
org.apache.camel.impl.DefaultUnitOfWork.init(DefaultUnitOfWork.java:91)
at
org.apache.camel.impl.DefaultUnitOfWork.init(DefaultUnitOfWork.java:71)
at org.apache.camel.processor.U*



--
View this message in context: 
http://camel.465427.n5.nabble.com/Polling-Email-Component-Runtime-Error-tp5749047p5749060.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: Seeing Info message all over log file related to Woodstox

2014-03-18 Thread Nair, Madhu
Thanks for the quick response. Will take a look.




-Original Message-
From: Claus Ibsen [mailto:claus.ib...@gmail.com] 
Sent: Tuesday, March 18, 2014 12:01 PM
To: users@camel.apache.org
Subject: Re: Seeing Info message all over log file related to Woodstox

Hi

Yeah Camel uses
javax.xml.stream.XMLInputFactory#newInstance()

to get the factory, and that uses that system property to lookup the factory. 
So you can switch to use woodstock then. Though that is for the entire JVM.

Otherwise it ought to fallback to JAR classpath scanning. But I guess woodstock 
and other xml parsers have that documented. You can search the web for details. 
That would allow you to do this for this deployment unit only. And leave the 
others as-is. In case using a jvm system property is not possible.

On Tue, Mar 18, 2014 at 4:48 PM, Nair, Madhu nair.ma...@aoins.com wrote:
 Thanks for the quick response.  I do have the woodstox jar in the classpath 
 but still get this message. Do I force Camel to use the woodstox parser by 
 setting the system property javax.xml.stream.XMLInputFactory to the Woodstox 
 parser?



 -Original Message-
 From: Claus Ibsen [mailto:claus.ib...@gmail.com]
 Sent: Tuesday, March 18, 2014 11:38 AM
 To: users@camel.apache.org
 Subject: Re: Seeing Info message all over log file related to Woodstox

 Hi

 Yeah we should tone this down, so the INFO logging only happen once
 https://issues.apache.org/jira/browse/CAMEL-7309

 To use woodstock you just add it to the classpath i think 
 http://woodstox.codehaus.org/

 On Tue, Mar 18, 2014 at 3:21 PM, Nair, Madhu nair.ma...@aoins.com wrote:
 Hi,
 I see the following info message all over the log file and it occurs only in 
 one environment and not in the other. I am assuming it occurs in one 
 environment because of the randomness with which the server loads the jar 
 files.

 The message is:-
 2014-03-06 22:23:47,401 | INFO | APPW111A:mmZreRm_-q | 
 XmlErrorListener | Msg: DOMSource is known to have issues with {0}. 
 We suggest using Woodstox


 The concern is with this part of the message DOMSource is known to 
 have issues with {0}. We suggest using Woodstox.

 How do I get rid of this message? Looking at the source code for Camel it 
 seems like this message occurs since we are not using the Woodstox parser.

 Do I specify to Camel the Stax parser to use by using the system property 
 javax.xml.stream.XMLInputFactory? Is there any other way?


 Camel version is 2.9.2 and application server is WAS 7. JDK is 1.6.




 Thanks,
 Madhu







 --
 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 Make your 
 Camel applications look hawt, try: http://hawt.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 Make your Camel 
applications look hawt, try: http://hawt.io


Re: Polling Email Component - Runtime Error

2014-03-18 Thread Claus Ibsen
Hi

In Camel 2.13 you can set context.setAllowUseOriginalMessage(false)
which could help with this problem.

For older releases it seems a defensive copy of the mail is done as
part of UoW and there is a failure in the attachments of the mail
message, from the NPE in java mail.

You can try upgrading java mail to latest you can download from
http://www.oracle.com/technetwork/java/javamail/index.html

For Camel 2.12.x and older we would need a fix in camel-mail to detect
the mapMailMessage=false and dont do the attachments extraction as
part of the UoW.

Fell free to log a ticket about that, then I can see if I can get this
fixed tomorrow.



On Tue, Mar 18, 2014 at 5:54 PM, contactreji contactr...@gmail.com wrote:
 Hi Claus

 I am getting a new set of errors in log now.. There seems to be something
 different here. This happended when I had set mapMailMessage=false
 Have any idea whats the fix from this point onwards?

 *
 2014-03-18 22:22:11,966 [/imap.gmail.com] WARN  MailConsumer
 - Caused by: [org.apache.camel.RuntimeCamelException - Error populating the
 initial mail message attachments]
 org.apache.camel.RuntimeCamelException: Error populating the initial mail
 message attachments
 at
 org.apache.camel.component.mail.MailMessage.populateInitialAttachments(MailMessage.java:124)
 at
 org.apache.camel.impl.DefaultMessage.createAttachments(DefaultMessage.java:209)
 at
 org.apache.camel.impl.DefaultMessage.getAttachments(DefaultMessage.java:274)
 at 
 org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:62)
 at 
 org.apache.camel.component.mail.MailMessage.copy(MailMessage.java:33)
 at
 org.apache.camel.impl.DefaultUnitOfWork.init(DefaultUnitOfWork.java:91)
 at
 org.apache.camel.impl.DefaultUnitOfWork.init(DefaultUnitOfWork.java:71)
 at org.apache.camel.processor.U*



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Polling-Email-Component-Runtime-Error-tp5749047p5749060.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
Make your Camel applications look hawt, try: http://hawt.io


Question: generated keys and SQL component

2014-03-18 Thread Matt Payne
Greetings!   Would you please help me find an example of using the SQL[1]
component and inserting into a table where the primary key is automatically
generated?   This is documented as possible with the JDBC component[2,3]:

If you insert data using SQL INSERT, then the RDBMS may support auto
generated keys. You can instruct the
JDBChttp://camel.apache.org/jdbc.html producer
to return the generated keys in headers.
To do that set the header CamelRetrieveGeneratedKeys=true. Then the
generated keys will be provided as headers with the keys listed in the
table above.

I am using SQL[1] component rather than JDBC[2] component because the SQL
component works with transactions.

Would you please help me find an example of using the SQL[1] component and
inserting into a table where the primary key is automatically generated?

Thanks! --Matt Payne

[1] http://camel.apache.org/sql-component.html
[2] http://camel.apache.org/jdbc.html
[3]
https://svn.apache.org/repos/asf/camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcGeneratedKeysTest.java


Re: camel cxf https

2014-03-18 Thread chaij
I can only get the wsdl using localhost. How can I get to it from other host?
The following address works.
http://localhost:9002/webservices/upload?wsdl

But if I use a IP address, it won't work
http://10.2.152.146:9002/webservices/upload?wsdl

Thanks!



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


Re: camel cxf https

2014-03-18 Thread Willem Jiang
Did you try to set the address with the host 0.0.0.0? 
If so you can access the service with localhost or  10.2.152.146 from you local 
box at the 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 March 19, 2014 at 7:58:02 AM, chaij (jin.c...@indigoarc.com) wrote:
 I can only get the wsdl using localhost. How can I get to it from other host?
 The following address works.
 http://localhost:9002/webservices/upload?wsdl
  
 But if I use a IP address, it won't work
 http://10.2.152.146:9002/webservices/upload?wsdl
  
 Thanks!
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/camel-cxf-https-tp5748846p5749066.html  
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



Re: Question about end of life date for camel library

2014-03-18 Thread Willem Jiang
Hi,

We only provide patch release the last 2 major release, which means you can at 
least have one year community support in Camel.
If we release Camel 2.13.0, we will retire the Camel 2.11.x fix branch.

--  
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 March 18, 2014 at 10:45:13 PM, Wai Lik Chong (wailik.mo...@gmail.com) wrote:
 Hi Claus,
  
 Thanks for your information. That is awesome! Yes, i am currently still
 using camel 2.1.0 in the project (never been upgraded since about 5 years
 ago). I'm looking into the camel upgrade now, therefore i want assess which
 camel version should go for based on the impact and support available.
  
  
 On 18 March 2014 18:42, Claus Ibsen wrote:
  
  On Tue, Mar 18, 2014 at 11:31 AM, Wai Lik Chong  
  wrote:
   Hi Claus,
  
   Thanks alot for answer.
   Is this rule of thumb will always apply to all other apache library such
  as
   apache abdera, axiom etc?
  
 
  No each Apache projects has their own policy. Some projects only
  support latest code, and others do support and release patch releases
  etc. Mind that support is many things. You can always contact any
  Apache project using the mailing list to ask for help - also for older
  releases etc. Its just that some Apache projects do not fix and
  release on older versions. eg its not fun to fix stuff in code that is
  many years old etc. But the source code is free, and anyone can grab
  the code, and apply their own fixes. For example if a fix has been
  merged to a newer release, you can try to apply that same fix on the
  source code of old fix to try to fix it yourself etc.
 
 
  Also all support from Apache is community and volunteer based.
  Some Apache projects has commercial support from companies. That are
  usually the bigger Apache projects.
 
  PS: Are you really using Apache Camel 2.1.0 - that is very old. Or do
  you mean Camel 2.11 ? eg eleven?
 
 
 
 
   Thanks in advance
   Wai Lik
  
  
   On 18 March 2014 16:54, Claus Ibsen wrote:
  
   Hi
  
   See
   http://camel.apache.org/download
  
   When Camel 2.13.0 is released (soon) then Camel 2.11.x is retired and
   no longer active supported.
   The rule of thumb is that we support 2 patch branches back.
  
   If you are looking for a longer support timeframe, you can try
   commercial support
   http://camel.apache.org/commercial-camel-offerings.html
  
   On Tue, Mar 18, 2014 at 9:51 AM, Wai Lik Chong  
   wrote:
Hi,
   
I have been using camel 2.1.0 in my project. I would like to know
  when is
the end of life support for the library version I am using. I have
  been
checking from the homepage https://camel.apache.org but not able get
  any
information.
In addition, I would also like to know the end of life date of every
version so that i can plan when to upgrade my library.
Thanks alot in advance for your help.
   
Wai Lik
  
  
  
   --
   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
   Make your Camel applications look hawt, try: http://hawt.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
  Make your Camel applications look hawt, try: http://hawt.io
 
  



Re: update HTTP request using previous response

2014-03-18 Thread aidatechinc
Geat. thanks for the tip.  The loop route actually did the trick.


On 03/18/2014 01:30 AM, Claus Ibsen-2 [via Camel] wrote:
 Hi

 You likely need to reset the stream cache to be able to re-read it again
 org.apache.camel.StreamCache#reset

 On Tue, Mar 18, 2014 at 3:43 AM, aidatechinc [hidden email] 
 /user/SendEmail.jtp?type=nodenode=5749012i=0 wrote:

  Thanks for taking the time to respond.   We did write a bean to 
 handle the
  message, but we realize that since we enable the streamCache, the 
 message
  gets overwritten while we are processing it.  Is that due to the 
 stream?
  Ideally we want to handle and process one message at a time, but the 
 stream
  seam that the body gets updated..If disable cache, then we get empty
  bodies..
 
 
 
 
 
 
 
 
 
 
  --
  View this message in context: 
 http://camel.465427.n5.nabble.com/update-HTTP-request-using-previous-response-tp5748902p5749008.html
  Sent from the Camel - Users mailing list archive at Nabble.com.



 -- 
 Claus Ibsen
 -
 Red Hat, Inc.
 Email: [hidden email] /user/SendEmail.jtp?type=nodenode=5749012i=1
 Twitter: davsclaus
 Blog: http://davsclaus.com
 Author of Camel in Action: http://www.manning.com/ibsen
 Make your Camel applications look hawt, try: http://hawt.io


 
 If you reply to this email, your message will be added to the 
 discussion below:
 http://camel.465427.n5.nabble.com/update-HTTP-request-using-previous-response-tp5748902p5749012.html
  

 To unsubscribe from update HTTP request using previous response, click 
 here 
 http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5748902code=SEZBT1VBWkBBSURBVEVDSC5DT018NTc0ODkwMnwtMTcwNTU2MTkzNg==.
 NAML 
 http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
  






--
View this message in context: 
http://camel.465427.n5.nabble.com/update-HTTP-request-using-previous-response-tp5748902p5749069.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: update HTTP request using previous response

2014-03-18 Thread aidatechinc
thanks that did the trick.

On 03/17/2014 11:16 AM, Stephan Burkard [via Camel] wrote:
 You could perhaps use the Loop EIP: https://camel.apache.org/loop.html

 It uses the result of the previous loop iteration for the next. You 
 have to
 define the criteria to stop the loop (for example as header variable).

 Hope this helps
 Stephan




 On Mon, Mar 17, 2014 at 3:13 AM, aidatechinc [hidden email] 
 /user/SendEmail.jtp?type=nodenode=5748979i=0 wrote:

  Hello,
What is the best way to update a HTTP request using the response. 
 So the
  service returns a position and this position needs to be sent in 
 subsequent
  request.
 
  1) post message with position 0
  2) read response
  3) update request with new position from response
  4) go back and post again
 
 
  any guide will be appreciated.
 
 
 
  --
  View this message in context:
  
 http://camel.465427.n5.nabble.com/update-HTTP-request-using-previous-response-tp5748902.html
  Sent from the Camel - Users mailing list archive at Nabble.com.
 


 
 If you reply to this email, your message will be added to the 
 discussion below:
 http://camel.465427.n5.nabble.com/update-HTTP-request-using-previous-response-tp5748902p5748979.html
  

 To unsubscribe from update HTTP request using previous response, click 
 here 
 http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5748902code=SEZBT1VBWkBBSURBVEVDSC5DT018NTc0ODkwMnwtMTcwNTU2MTkzNg==.
 NAML 
 http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
  






--
View this message in context: 
http://camel.465427.n5.nabble.com/update-HTTP-request-using-previous-response-tp5748902p5749070.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Is RAW() required in message endpoint URI with percent-endcoded special characters?

2014-03-18 Thread Willem Jiang
Hi Phil,

You can find the special characters which we handled in camel here[1], maybe we 
need to revisit the unsafe characters again in new version of Camel.

[1] 
https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/util/UnsafeUriCharactersEncoder.java

--  
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 March 19, 2014 at 1:37:02 AM, Phil Mocek (phil-li...@mocek.org) wrote:
 Claus Ibsen wrote:
  You can configure endpoints in many ways in Camel.
  
 Understood. To indicate that I was aware of that and that I had
 consulted the relevant documentation prior to posing my question
 on the list, I cited the Camel docs in my original post, providing
 URIs of the relevant pages and sections. Maybe you missed those.
  
  And when you [use URI syntax directly in your routes] then care
  should be taken when using special characters like + and % signs
  etc.
  
 I have found no documentation of what characters Camel considers
 special. Where can I read the definition of special characters
 as it pertains to Camel?
  
 As I referenced in my posts, I am aware of the IETF specification
 for URIs (IETF STD 66), and I know that it requires one to
 [percent-escape][1] any characters [designated as reserved in that
 spec][2], such as '+'. I have twice in this thread provided not
 only narrative of my having done so, but examples of URIs
 containing information with reserved characters that I
 percent-encoded before I included them in the URI. Maybe you
 missed those.
  
  And Apache loves contributions, so you are welcome to fix/help
  with the docs, in case you think the AWS page need some help
  http://camel.apache.org/contributing
  
 I would happily do so. But in order to verify the accuracy of the
 docs, I need to know how Camel is expected to work. So I asked.
 Changing the documentation as I believe needs to be done would
 constitute a change to [Camel's aws-sqs URI scheme syntax][3].
  
 What I, and anyone else using Camel aws-sqs URIs needs to know is
 what I asked very clearly last week: Must percent-encoded special
 characters in a Camel message endpoint URI be wrapped in RAW() in
 order for Camel to correctly process the URI?
  
 Nobody has yet answered that question. I don't know where else to
 find the answer. Even the source code is not clearly the place to
 look, since this involves a bug that may not have been fixed.
  
 I believe that either A) the [bug of topic here][4] persists in
 Camel, in which case I offer to assist in changing the
 documentation to suggest the suggested workaround, or B) this is
 not, in fact, a bug, because the syntax for aws-sqs URIs now
 *requires* use of RAW(), in which case I offer to assist in
 changing the documentation to describe the new syntax.
  
 Note that by requires I mean requires in order for Camel to
 function correctly with all valid URIs. I understand that
 sometimes we can avoid such requirements when we are confident
 that our programs will encounter only a particular subset of valid
 URIs--in this case, those that do not contain percent-encoded
 data. But that only means that it is not required on some
 circumstances. It would still be accurate to say that in order
 for Camel to work in all supported circumstances, this is a
 requirement.
  
  Apache is a 100% open community, and its important that all
  conversation happens in the open, and on Apache infrastructure
  (eg mailing list / JIRA / etc) - so everybody can follow.
  
 Understood and agreed. That's why I e-mailed the list. Having
 received no answer to the question posed in my list post, I
 e-mailed the person who worked a ticket relevant to my question,
 who happened ot be active on the list. Had you answered, I would
 have followed up on the list with a summary of such so that other
 people who search the list seeking the same information would find
 it. As I wrote previously, your issue tracking system did not
 appear to allow outside contributions of comments.
  
 I truly appreciate your efforts to enforce basic netiquette, as
 those traditions are largely ignored nowadays, and they once made
 technical mailing lists like this one run much more smoothly. I
 am well aware of those traditions.
  
  
 References:
  
 [1]:  
 IETF STD 66: URI Generic Syntax: 2.1. Percent-Encoding
 [2]:  
 IETF STD 66: URI Generic Syntax: 2.2. Reserved Characters
 [3]:  
 Apache Camel  Documentation  Components  AWS  AWS-SQS URI
 [4]:  
 CAMEL-4954: Camel 2.9.0 incapable of working with % in endpoint URIs
  
 --
 Phil Mocek
 https://mocek.org
  



Updating state in a route.

2014-03-18 Thread Corey Nolet
I am working on a throttling system for my ingest that will check to see if
my upstream JMS broker is backed up to a particular threshold and, if it is
backed up, begin to route messages to disk instead of sending them to the
database.

I'm wondering the best way to implement this using the correct EIP
paradigms. I'll need to periodically (maybe every 2 minutes) check on the
state of the broker and I was thinking of implementing a quartz route that
would check the state and send a message into my main ingest routes with a
special header (like throttle=true/false).

I was thinking my main ingest routes can maintain their own state and
further set some type of header like shouldThrottle on each of their
messages so that I can use content based routing to determine where the
messages should go:

(header.get(shouldThrottle) == true) ? to('disk') : to('database')

Does this seem like a reasonable solution or am I going about this the
wrong way? I know EIP is all about trying to keep state in the streams
instead of the processors. I'm not sure if there's a better solution than
having the state checker send a message to the main ingest processors so
they can set their own state.


Thanks much!


Camel HDFS Component Documentation

2014-03-18 Thread Corey Nolet
I am currently looking to use the camel hdfs component so that I can have
my camel route output to a sequence file. I dug around the documentation
but didn't see a good way (or any useful examples) of how to format my
exchange so that the output would be correclty written to the sequence
file.

I dug through the code and found this line:

Object key = exchange.getIn().getHeader(HdfsHeader.KEY.name());

I need to manually put put this into the header of my exchanges, right?

Thanks!


Re: Camel CXF Endpoint Performance - Threading

2014-03-18 Thread Willem.Jiang
Hi,

The AsyncProcessorHelper.proccess() method just provides a sync processing
invocation  which is based on the Async API. I need to know some detail
about your route which makes camel does that change.
 
It looks like you are using direct endpoint to route the message to next
camel route, as the direct endpoint provides the async API and CXF consumer
is using async API by default, so I doubt your InquiryRoute may have some
endpoint which just can call the sync process API.

You can use seda endpoint to replace direct endpoint to decouple the threads
from the InquiryCxfRoute and InquiryRoute. 

Regards,

Willem



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-CXF-Endpoint-Performance-Threading-tp5748984p5749074.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JMS Message Expiration period

2014-03-18 Thread Willem.Jiang
timeToLive is the uri option, you can set it on the jms endpoint which you
want to route the message from camel route to jms broker.

Willem



--
View this message in context: 
http://camel.465427.n5.nabble.com/JMS-Message-Expiration-period-tp5749032p5749075.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: JavaFX + Spring + Camel + Maven

2014-03-18 Thread Willem.Jiang
Thanks for sharing the solution with us.
Do you to need wrap up a new application jar for JavaFX to use?
Why does the camel-spring.jar be used directly?



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


Re: Camel HDFS Component Documentation

2014-03-18 Thread Willem Jiang
Yeah, you are right.

--  
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 March 19, 2014 at 10:51:44 AM, Corey Nolet (cjno...@gmail.com) wrote:
 I am currently looking to use the camel hdfs component so that I can have
 my camel route output to a sequence file. I dug around the documentation
 but didn't see a good way (or any useful examples) of how to format my
 exchange so that the output would be correclty written to the sequence
 file.
  
 I dug through the code and found this line:
  
 Object key = exchange.getIn().getHeader(HdfsHeader.KEY.name());
  
 I need to manually put put this into the header of my exchanges, right?
  
 Thanks!