Parallel file processing with Camel

2013-10-23 Thread piyushbhatt
Hi,

We are using Camel and have developed an FTP client using it. We generate
hundreds of files which we need to push in a very short time window to the
FTP server. All these files reside in the same directory. Camel is not able
to keep pace with number of files so we do manual parallel pushing using
filezilla client

Is there a way to configure Camel to start multiple threads on a single
directory and push files in parallel

Piyush 



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


Re: Parallel file processing with Camel

2013-10-23 Thread contactreji
I would recommend avoiding filezilla. Could you try with an alternative FTP 
server.  There is a FTP server which is shipped with Linux os. Give a try with 
that.  

Meanwhile try FTP options like stream data .. 
Refer camel documentation for stream options
Reji 

"piyushbhatt [via Camel]"  wrote:

>
>
>Hi,
>
>We are using Camel and have developed an FTP client using it. We generate
>hundreds of files which we need to push in a very short time window to the
>FTP server. All these files reside in the same directory. Camel is not able
>to keep pace with number of files so we do manual parallel pushing using
>filezilla client
>
>Is there a way to configure Camel to start multiple threads on a single
>directory and push files in parallel
>
>Piyush 
>
>
>
>___
>If you reply to this email, your message will be added to the discussion below:
>http://camel.465427.n5.nabble.com/Parallel-file-processing-with-Camel-tp5742049.html
>
>To unsubscribe from Camel - Users, visit 
>http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=Y29udGFjdHJlamlAZ21haWwuY29tfDQ2NTQyOHwxMDA0OTE4MjMz



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

Can't sent many sms with smpp. Producer binding problems.

2013-10-23 Thread mamouros
I am using camel smpp to send sms to an smsc but when testing it live, i get
"Negative response 0005 found" which means "ESME_RALYBND  5  ESME
already in bound state (example: sending a second bind command during an
existing SMPP session)". In the beginning I thought it happened because of
one thread or more tried to bind to the same smpp address after another
thread had allready bind. Thats why I made it run by a single thread so I
won't have the same problem but nothing. Still got the above negative
response.



from camel-context.xml
RecipientListBean creates and sets header recipients=
"smpp://1234123123@123.123.123.123:1234"

   



sms_rate

recipients




   


log from karaf:

##  21/10/13 11:28:19:375 :: 219 :: RECEIVED DELIVER_SM
2013-10-21 11:28:19,437 | INFO  |  - smsSendThread | SMPPSession
 
| org.jsmpp.session.SMPPSession 222 | 171 -
org.apache.servicemix.bundles.jsmpp - 2.1.0.4 | Connected
2013-10-21 11:28:19,438 | INFO  | Thread-263   | SMPPSession
 
| sion.SMPPSession$PDUReaderWorker  537 | 171 -
org.apache.servicemix.bundles.jsmpp - 2.1.0.4 | Starting PDUReaderWorker
with processor degree:3 ...
2013-10-21 11:28:19,544 | INFO  |  - smsSendThread | SmppProducer   
 
| amel.component.smpp.SmppProducer  103 | 172 - org.apache.camel.camel-smpp
- 2.11.0 | Connected to: smpp://1234123123@123.123.123.123:1234
2013-10-21 11:28:19,544 | INFO  | Thread-264   | SMPPSession
 
| on.SMPPSession$EnquireLinkSender  596 | 171 -
org.apache.servicemix.bundles.jsmpp - 2.1.0.4 | Starting EnquireLinkSender
2013-10-21 11:28:19,700 | INFO  |  - smsSendThread | SmsSender  
 
| org.appart.smpp.SmsSender  55 | 683 - BulkSmsCamel - 2.0.0 |
**  21/10/13 11:28:19:700 :: 230 :: SUBMITTED SUBMIT_SM
2013-10-21 11:28:19,925 | INFO  | pool-24-thread-3 | SmsReceiver
 
| org.appart.smpp.SmsReceiver   132 | 683 - BulkSmsCamel - 2.0.0 |
##  21/10/13 11:28:19:925 :: 228 :: RECEIVED DELIVER_SM
2013-10-21 11:28:19,953 | INFO  |  - smsSendThread | SMPPSession
 
| org.jsmpp.session.SMPPSession 222 | 171 -
org.apache.servicemix.bundles.jsmpp - 2.1.0.4 | Connected
2013-10-21 11:28:19,955 | INFO  | Thread-265   | SMPPSession
 
| sion.SMPPSession$PDUReaderWorker  537 | 171 -
org.apache.servicemix.bundles.jsmpp - 2.1.0.4 | Starting PDUReaderWorker
with processor degree:3 ...
2013-10-21 11:28:19,978 | ERROR |  - smsSendThread | SMPPSession
 
| org.jsmpp.session.SMPPSession 244 | 171 -
org.apache.servicemix.bundles.jsmpp - 2.1.0.4 | Receive negative bind
response
org.jsmpp.extra.NegativeResponseException: Negative response 0005 found
at
org.jsmpp.session.AbstractSession.validateResponse(AbstractSession.java:215)[171:org.apache.servicemix.bundles.jsmpp:2.1.0.4]
at
org.jsmpp.session.AbstractSession.executeSendCommand(AbstractSession.java:271)[171:org.apache.servicemix.bundles.jsmpp:2.1.0.4]
at
org.jsmpp.session.SMPPSession.sendBind(SMPPSession.java:294)[171:org.apache.servicemix.bundles.jsmpp:2.1.0.4]
at
org.jsmpp.session.SMPPSession.connectAndBind(SMPPSession.java:232)[171:org.apache.servicemix.bundles.jsmpp:2.1.0.4]
at
org.jsmpp.session.SMPPSession.connectAndBind(SMPPSession.java:200)[171:org.apache.servicemix.bundles.jsmpp:2.1.0.4]
at
org.apache.camel.component.smpp.SmppProducer.createSession(SmppProducer.java:91)[172:org.apache.camel.camel-smpp:2.11.0]
at
org.apache.camel.component.smpp.SmppProducer.doStart(SmppProducer.java:76)[172:org.apache.camel.camel-smpp:2.11.0]
at
org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)[60:org.apache.camel.camel-core:2.11.0]
at
org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:64)[60:org.apache.camel.camel-core:2.11.0]
at
org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:393)[60:org.apache.camel.camel-core:2.11.0]
at
org.apache.camel.impl.ProducerCache.acquireProducer(ProducerCache.java:114)[60:org.apache.camel.camel-core:2.11.0]
at
org.apache.camel.processor.RecipientListProcessor.createProcessorExchangePairs(RecipientListProcessor.java:160)[60:org.apache.camel.camel-core:2.11.0]
at
org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:206)[60:org.apache.camel.camel-core:2.11.0]
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[60:org.apache.camel.camel-core:2.11.0]
at
org.apache.camel.p

define properties in context.xml

2013-10-23 Thread Olaf
Hello,

is it possible to define properties in spring xml directly without using a
.properties file? And then use them in java like that:

from(imap://imap.server.com?username={{user}}&password={{pass}})

or

from({{imapUri}})

I'd like to have only one xml config file

Thanks for help!



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


Re: Request for help with Twitter component | Sending direct messages to multiple users

2013-10-23 Thread Claus Ibsen
I dont assume the camel-twitter can send DM to 2+ recipients in one go.
Though you can look at the twitter4j api whether that would be possible.

In Camel you can use a recipient list or multicast to send the same
message to N+ endpoints.
http://camel.apache.org/eip

Or use a dynamic router to "loop" until you should not send anymore messages.

Or use a java bean and implement logic in a for / while loop and use a
producer template / pojo producer to send the message etc.


On Wed, Oct 23, 2013 at 8:43 AM, P Manchanda  wrote:
> Hi,
>
> I am using the Apache Camel's Twitter Component to integrate my web app with 
> Twitter. My requirements is to send the direct messages to different twitter 
> users who follow my company's twitter account. Going through the 
> documentation, I am able to figure out how to send a direct message to a 
> single user. But I am not able to find a way to send same direct message to 
> multiple users.
>
> The incoming message would be available to me on a JMS queue. However, for 
> testing purpose I am reading it from a text file.
>
> My route looks like this for a single user:
>
> from("file://c:/test")
> .to("log:TWITTER?showAll=true&multiline=true&level=ERROR")
>  
> .to("twitter://directmessage?consumerKey=<>&consumerSecret=<>&accessToken=<>&accessTokenSecret=<>&user=<>");
>
> There is another URI option 'userIds' but it seems to work only with the 
> streaming/filter Consumer endpoint.
>
> Thanks for the help.
>
> ___
> Thks & brgds
> P Manchanda
> Mobile: +91-9811210374



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


Re: Parallel file processing with Camel

2013-10-23 Thread Claus Ibsen
Hi

You can use threads, see bottom of this page
http://camel.apache.org/async.html



On Wed, Oct 23, 2013 at 9:16 AM, piyushbhatt  wrote:
> Hi,
>
> We are using Camel and have developed an FTP client using it. We generate
> hundreds of files which we need to push in a very short time window to the
> FTP server. All these files reside in the same directory. Camel is not able
> to keep pace with number of files so we do manual parallel pushing using
> filezilla client
>
> Is there a way to configure Camel to start multiple threads on a single
> directory and push files in parallel
>
> Piyush
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Parallel-file-processing-with-Camel-tp5742049.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


Re: define properties in context.xml

2013-10-23 Thread Claus Ibsen
You can define them in a java.util.Properties bean - Maybe Spring has
a XML namespace syntax for that to make it nicer looking.

Then you can refer to this bean using ref: as shown on
http://camel.apache.org/using-propertyplaceholder.html

On Wed, Oct 23, 2013 at 10:16 AM, Olaf  wrote:
> Hello,
>
> is it possible to define properties in spring xml directly without using a
> .properties file? And then use them in java like that:
>
> from(imap://imap.server.com?username={{user}}&password={{pass}})
>
> or
>
> from({{imapUri}})
>
> I'd like to have only one xml config file
>
> Thanks for help!
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/define-properties-in-context-xml-tp5742054.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


Re: define properties in context.xml

2013-10-23 Thread Olaf
Thanks! I'll try that



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


camel-cxf and activemq example

2013-10-23 Thread harry
Hi,
Can anybody help me finding any working example/tutorial on
camel-cxf,activemq example in jboss fuse6. Any quick help is highly
appriciated.

Thanks



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


Encapsulate each field by double quotes

2013-10-23 Thread Aviraj
Hello,
I am trying to encapsulate the data in CSV file by double quotes with
CSVStrategy Configuration. But the data in the CSV is not encapsulated by
double quotes. The code snippet is as below,
public void configure() throws Exception {
CsvDataFormat format = new CsvDataFormat();
format.setStrategy(new CSVStrategy(',', '"', '#'));

from(TEST)
.to("sql:" + TEST_SQL+ "?dataSource=#dataSource")
.process(new TestProcessor())
.setHeader(FILE_NAME, "Test.csv")
.setBody(simple("${body}"))
.marshal(format)
.convertBodyTo(String.class)
.to("file:?tempFileName=${file:onlyname.noext}.tmp")
}

@Experts: Please let me know whether I am missing something here?

Thanks in advance!



--
View this message in context: 
http://camel.465427.n5.nabble.com/Encapsulate-each-field-by-double-quotes-tp5742070.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Body is null exception when producing JMS messages from a Quartz endpoint

2013-10-23 Thread berdoni
Hi,

I have the the following route:
from("quartz://MyTrigger/TriggerRouteStart?cron=0+0/5+*+*+*+?")
.routeId("TriggerRouteStart")
.to("activemq:queue:TriggerRouteStart");

This route should trigger every 5mins and put a message to TriggerRouteStart
queue however I get the following error. Shall I set the body before sending
any message to the Queue? I see in Camel documentation the following example
route which is similar:
from("quartz://myGroup/myTimerName?cron=0+0/5+12-18+?+*+MON-FRI").to("activemq:Totally.Rocks");

Here is my exception:
ERROR|2013-10-23 15:20:59,026|DefaultQuartzScheduler-camel_Worker-10|   

QuartzEndpoint - Error processing exchange. Exchange[Message: [Body is
null]]. Caused by: [org.quartz.JobExecutionException -
org.apache.camel.CamelExecutionException: Exception occurred during
execution on the exchange: Exchange[Message: [Body is null]]]
INFO |2013-10-23 15:20:59,027|DefaultQuartzScheduler-camel_Worker-10|   
   
JobRunShell - Job DEFAULT.quartz-endpoint14 threw a JobExecutionException: 
org.quartz.JobExecutionException: org.apache.camel.CamelExecutionException:
Exception occurred during execution on the exchange: Exchange[Message: [Body
is null]] [See nested exception: org.apache.camel.CamelExecutionException:
Exception occurred during execution on the exchange: Exchange[Message: [Body
is null]]]




--
View this message in context: 
http://camel.465427.n5.nabble.com/Body-is-null-exception-when-producing-JMS-messages-from-a-Quartz-endpoint-tp5742072.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Body is null exception when producing JMS messages from a Quartz endpoint

2013-10-23 Thread Claus Ibsen
Yes you need to set the body to something, such as constant("") for an
empty string or what you want.

On Wed, Oct 23, 2013 at 2:25 PM, berdoni  wrote:
> Hi,
>
> I have the the following route:
> from("quartz://MyTrigger/TriggerRouteStart?cron=0+0/5+*+*+*+?")
> .routeId("TriggerRouteStart")
> .to("activemq:queue:TriggerRouteStart");
>
> This route should trigger every 5mins and put a message to TriggerRouteStart
> queue however I get the following error. Shall I set the body before sending
> any message to the Queue? I see in Camel documentation the following example
> route which is similar:
> from("quartz://myGroup/myTimerName?cron=0+0/5+12-18+?+*+MON-FRI").to("activemq:Totally.Rocks");
>
> Here is my exception:
> ERROR|2013-10-23 15:20:59,026|DefaultQuartzScheduler-camel_Worker-10|
> QuartzEndpoint - Error processing exchange. Exchange[Message: [Body is
> null]]. Caused by: [org.quartz.JobExecutionException -
> org.apache.camel.CamelExecutionException: Exception occurred during
> execution on the exchange: Exchange[Message: [Body is null]]]
> INFO |2013-10-23 15:20:59,027|DefaultQuartzScheduler-camel_Worker-10|
> JobRunShell - Job DEFAULT.quartz-endpoint14 threw a JobExecutionException:
> org.quartz.JobExecutionException: org.apache.camel.CamelExecutionException:
> Exception occurred during execution on the exchange: Exchange[Message: [Body
> is null]] [See nested exception: org.apache.camel.CamelExecutionException:
> Exception occurred during execution on the exchange: Exchange[Message: [Body
> is null]]]
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Body-is-null-exception-when-producing-JMS-messages-from-a-Quartz-endpoint-tp5742072.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


how to give the dynamic value to the tokenizeXML

2013-10-23 Thread dkum003
Hi,

I want to give the dynamic value to the tokenizeXML.

My code snippet is below:

.split()
.tokenizeXML(tokenType, 100)
.streaming()

Here my requirement to change the value of tokenType for every run.

Thanks & Regards,
Dhananjay Kumar
Amadeus Lab
SSE



--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-give-the-dynamic-value-to-the-tokenizeXML-tp5742075.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Encapsulate each field by double quotes

2013-10-23 Thread Claus Ibsen
I suggest to look in the commons CSV project about how to use double
quotes. And if that is supported, and that you configure the
CSVStrategy correct?

Also you can try alternatives than CSV such as camel-beanio etc as its
an up to date and maintained project, where as commons csv is a sort
of dead project.



On Wed, Oct 23, 2013 at 1:54 PM, Aviraj  wrote:
> Hello,
> I am trying to encapsulate the data in CSV file by double quotes with
> CSVStrategy Configuration. But the data in the CSV is not encapsulated by
> double quotes. The code snippet is as below,
> public void configure() throws Exception {
> CsvDataFormat format = new CsvDataFormat();
> format.setStrategy(new CSVStrategy(',', '"', '#'));
>
> from(TEST)
> .to("sql:" + TEST_SQL+ "?dataSource=#dataSource")
> .process(new TestProcessor())
> .setHeader(FILE_NAME, "Test.csv")
> .setBody(simple("${body}"))
> .marshal(format)
> .convertBodyTo(String.class)
> .to("file:?tempFileName=${file:onlyname.noext}.tmp")
> }
>
> @Experts: Please let me know whether I am missing something here?
>
> Thanks in advance!
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Encapsulate-each-field-by-double-quotes-tp5742070.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


Re: Body is null exception when producing JMS messages from a Quartz endpoint

2013-10-23 Thread Claus Ibsen
Hi

This sounds like a classpath issue. Make sure to use the same Camel
version for all your Camel JARs.

On Wed, Oct 23, 2013 at 4:00 PM, berdoni  wrote:
> I did it by adding the following processor but the problem persists.
>
> .process(new Processor() {
> public void process(Exchange exchange) {
> Message in = exchange.getIn();
> in.setBody("Dummy Body");
> }
> })
>
>
> I found that it works when I downgrade from 2.12.1 to 2.10.3. There is a
> small detail at the bottom of the exception trace:
> "java.lang.NoSuchMethodError:org.apache.camel.util.ObjectHelper.notNull(Ljava/lang/Object;Ljava/lang/String;)V"
>
> I read about this issue in the following post:
> http://camel.465427.n5.nabble.com/camel-2-11-release-with-activemq-camel-5-8-td5733244.html
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Body-is-null-exception-when-producing-JMS-messages-from-a-Quartz-endpoint-tp5742072p5742076.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


Crashing on Startup

2013-10-23 Thread Gershaw, Geoffrey A. (KFFC 223)
Hello All,

I am running Camel 2.11.0 and it appears it crashed this AM. This is all we 
have in the log. The dump must be moved somewhere to conserve disk. Any 
thoughts?

Thanks


02:00:12,387 [main] INFO  com.csfb.fid.credit.cds.MainSpring  - Starting Camel. 
Use ctrl + c to terminate the JVM.

02:00:12,392 [main] INFO  org.apache.camel.main.MainSupport  - Apache Camel 
2.11.0 starting
02:00:14,191 [main] INFO  org.apache.camel.spring.SpringCamelContext  - Apache 
Camel 2.11.0 (CamelContext: camel-1) is start
ing
02:00:14,237 [main] INFO  org.apache.camel.management.ManagementStrategyFactory 
 - JMX enabled.
02:00:14,372 [main] INFO  org.apache.camel.impl.converter.DefaultTypeConverter  
- Loaded 176 type converters




=== 
Please access the attached hyperlink for an important electronic communications 
disclaimer: 
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
=== 



Re: Body is null exception when producing JMS messages from a Quartz endpoint

2013-10-23 Thread berdoni
The v2.12.1 Camel version is used for all camel components, however camel-jms
2.10.3 is used by activemq-camel component. This jar causes the classpath
issue as Christian mentioned in his relevant post.

I have updated my pom and it seems OK now with Camel v2.12.1.


org.apache.activemq
activemq-camel
5.8.0

  
org.apache.camel
camel-jms





org.apache.camel
camel-jms
2.12.1


Thanks
Nikos




--
View this message in context: 
http://camel.465427.n5.nabble.com/Body-is-null-exception-when-producing-JMS-messages-from-a-Quartz-endpoint-tp5742072p5742082.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: error while testing: duplicate id detected

2013-10-23 Thread Claus Ibsen
Hi

You add the routes 2 times with both in the spring XML file using
 and

   @Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new App.AppRoute();
}




On Tue, Oct 22, 2013 at 9:56 PM, Olaf  wrote:
> Hello,
>
> I have a simple route, which works fine
>
> from("file://data/inbox?noop=true")
> .beanRef("someProcessor")
> .process(new SomeOtherProcessor()).id("otherProcessor")
> .to("log:foo").id("loggingFoo");
>
> But testing doesn't work. As one can see, I don't have duplicate id's.
>
> org.apache.camel.FailedToStartRouteException: Failed to start route route1
> because of duplicate id detected: otherProcessor. Please correct ids to be
> unique among all your routes.
> at
> org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:759)
> at
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1914)
> at
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1670)
> at
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1544)
> at
> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:179)
> at 
> org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
> at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1512)
> at
> org.apache.camel.test.junit4.CamelTestSupport.startCamelContext(CamelTestSupport.java:476)
> at
> org.apache.camel.test.junit4.CamelTestSupport.doSetUp(CamelTestSupport.java:310)
> at
> org.apache.camel.test.junit4.CamelTestSupport.setUp(CamelTestSupport.java:216)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:601)
> at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
> at org.junit.rules.RunRules.evaluate(RunRules.java:20)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> at
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:601)
> at
> org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
> at
> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
> at
> org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
> at
> org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
> at 
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
> ###
>
> public class AppTest extends CamelSpringTestSupport {
>
>
> @Override
> public String isMockEndpoints() {return "*";}
>
> @Test()
> public void testAppRoute() throws Exception {
> MockEndpoint to = getMockEndpoint("mock:log:foo"

Re: Body is null exception when producing JMS messages from a Quartz endpoint

2013-10-23 Thread berdoni
I did it by adding the following processor but the problem persists.

.process(new Processor() {
public void process(Exchange exchange) {
Message in = exchange.getIn();
in.setBody("Dummy Body");
}
})


I found that it works when I downgrade from 2.12.1 to 2.10.3. There is a
small detail at the bottom of the exception trace:
"java.lang.NoSuchMethodError:org.apache.camel.util.ObjectHelper.notNull(Ljava/lang/Object;Ljava/lang/String;)V"

I read about this issue in the following post:
http://camel.465427.n5.nabble.com/camel-2-11-release-with-activemq-camel-5-8-td5733244.html




--
View this message in context: 
http://camel.465427.n5.nabble.com/Body-is-null-exception-when-producing-JMS-messages-from-a-Quartz-endpoint-tp5742072p5742076.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: how to give the dynamic value to the tokenizeXML

2013-10-23 Thread Claus Ibsen
You would need to use java code where you can dynamic set the token
and return the tokenizer

.split().method(MyBean.class, "myMethod")

And then implement the method

public static Expression myMethod(Exchange exchange) {
   ...

 TokenizeLanguage tok = new TokenizeLanguage();
  tok.setXml(true);
  tok.setIncludeTokens(true);
  tok.setGroup(100);

  tok.setToken(Here is my string as the token I wanna use);


  return tok.createExpression(exchange);
}

On Wed, Oct 23, 2013 at 3:32 PM, dkum003  wrote:
> Hi,
>
> I want to give the dynamic value to the tokenizeXML.
>
> My code snippet is below:
>
> .split()
> .tokenizeXML(tokenType, 100)
> .streaming()
>
> Here my requirement to change the value of tokenType for every run.
>
> Thanks & Regards,
> Dhananjay Kumar
> Amadeus Lab
> SSE
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/how-to-give-the-dynamic-value-to-the-tokenizeXML-tp5742075.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


Re: how to give the dynamic value to the tokenizeXML

2013-10-23 Thread contactreji
Hi Kumar

You can have  logic to calculate it in components like processor and add it
to the exchange header.. And later in splitter component, you can refer the
value from header using {in.header.tokenNameFromHeader}

Look out for more ideas from forums users too!

Cheers
Reji


On Wed, Oct 23, 2013 at 6:32 AM, dkum003 [via Camel] <
ml-node+s465427n574207...@n5.nabble.com> wrote:

> Hi,
>
> I want to give the dynamic value to the tokenizeXML.
>
> My code snippet is below:
>
> .split()
> .tokenizeXML(tokenType, 100)
> .streaming()
>
> Here my requirement to change the value of tokenType for every run.
>
> Thanks & Regards,
> Dhananjay Kumar
> Amadeus Lab
> SSE
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/how-to-give-the-dynamic-value-to-the-tokenizeXML-tp5742075.html
>  To unsubscribe from Camel - Users, click 
> here
> .
> NAML
>




--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-give-the-dynamic-value-to-the-tokenizeXML-tp5742075p5742092.html
Sent from the Camel - Users mailing list archive at Nabble.com.

[BLOG] JMS-style selectors on Amazon SQS with Apache Camel

2013-10-23 Thread Christian Posta
For those interested, I've put together a blog that shows a new
functionality with upcoming Apache Camel 2.13.0.

The code with the blog shows using the new json-path component as well...

Take a look and interested in any feedback:

http://www.christianposta.com/blog/?p=340



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta


Re: [BLOG] JMS-style selectors on Amazon SQS with Apache Camel

2013-10-23 Thread jb

Hi Christian,

thanks for sharing this, it's very interesting.

Did you update the article section of the website ?

Thanks again
Regards
JB

On 2013-10-23 17:45, Christian Posta wrote:

For those interested, I've put together a blog that shows a new
functionality with upcoming Apache Camel 2.13.0.

The code with the blog shows using the new json-path component as 
well...


Take a look and interested in any feedback:

http://www.christianposta.com/blog/?p=340




endChoice() in Camel Scala DSL

2013-10-23 Thread abhinavm
Hello,

I have a scenario, where some code needs to go into choice, some in
otherwise, and some common clean-up code needs to be executed after that in
both scenarios. Since I could not find endChoice() or end() in the Scala
DSL, I tried the following piece of code, but could not achieve what I
wanted. Basically it would consider all the code after otherwise as a part
of otherwise. Can someone please tell me where I am going wrong ? 

  .choice(){
when(exchange => exchange.getIn.getBody(classOf[String]) != null){
  process(new ResponseProcessor)
  .log(LoggingLevel.INFO,"File with content: ${body}")
  .log("Completed Job")
} otherwise{
  log(LoggingLevel.INFO,"Empty Body")
}
  }
  .log("Should Reach Here in all scenarios")


Thanks





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


Re: ActiveMq-InOut: save exchange body

2013-10-23 Thread Christian Müller
What kind of issue do you face?

Best,

Christian
-

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Tue, Oct 22, 2013 at 12:43 PM, ak-dak  wrote:

> Hi,
>
> the enricher is a good component but it seems not to work in asynchronous
> routes. My routes are connected with each other over ActiveMq and exchange
> pattern "InOnly".
>
> Best regards
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/ActiveMq-InOut-save-exchange-body-tp5741975p5742025.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: camel-cxf and activemq example

2013-10-23 Thread Christian Müller
Did you checked [1]?

[1] http://camel.apache.org/examples.html

Best,

Christian
-

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Wed, Oct 23, 2013 at 12:46 PM, harry  wrote:

> Hi,
> Can anybody help me finding any working example/tutorial on
> camel-cxf,activemq example in jboss fuse6. Any quick help is highly
> appriciated.
>
> Thanks
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/camel-cxf-and-activemq-example-tp5742069.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: Body is null exception when producing JMS messages from a Quartz endpoint

2013-10-23 Thread Christian Müller
Good to know you got it working...

Best,

Christian
-

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Wed, Oct 23, 2013 at 4:19 PM, berdoni  wrote:

> The v2.12.1 Camel version is used for all camel components, however
> camel-jms
> 2.10.3 is used by activemq-camel component. This jar causes the classpath
> issue as Christian mentioned in his relevant post.
>
> I have updated my pom and it seems OK now with Camel v2.12.1.
>
> 
> org.apache.activemq
> activemq-camel
> 5.8.0
> 
> 
> org.apache.camel
> camel-jms
> 
> 
> 
>
> 
> org.apache.camel
> camel-jms
> 2.12.1
> 
>
> Thanks
> Nikos
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Body-is-null-exception-when-producing-JMS-messages-from-a-Quartz-endpoint-tp5742072p5742082.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Best way to consuming same queue from two brokers?

2013-10-23 Thread dunnlow
Using Camel 2.10.3

My question: What is the best way to consume msgs from multiple
brokers/queues and feed those messages through a single route?

Explanation:

I currently consume from an activemq broker.  I have several different
routes that consume messages from different queues on that broker.  Now, the
admins have updated to a network of brokers.  

The producers of the messages are using failover (there are only two brokers
at the moment).  Because those producers could place msgs on either broker,
I want to check both brokers (I had a past issue on a different project
where the producers failed over briefly and sent msgs to the backup that
were never consumed even though I was using a failover url.  My solution at
the time was to always check/consume from both primary and backup - ignoring
failover - using a second activemq config to the secondary broker).

My problem is that now I have many routes and I want msgs from either the
primary or backup jms queue to propagate through those routes without having
to duplicate the route for each broker.  For example, I DONT want to do this
for each route (my actual routes are more complex than these):











 

I realize I could make the route above a direct route and then consume from
each broker and send to it, but this still seems ugly:














 

I've considered combining into a single in-memory queue, but I've never done
that before and would worry about robustness of the queue (I can't lose any
messages).  

What is the smart way to do this?

Thanks very much for any insight!

-J




--
View this message in context: 
http://camel.465427.n5.nabble.com/Best-way-to-consuming-same-queue-from-two-brokers-tp5742100.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Best way to consuming same queue from two brokers?

2013-10-23 Thread James Carman
The NoB should be routing your messages for you, shouldn't it?


On Wed, Oct 23, 2013 at 1:52 PM, dunnlow  wrote:
> Using Camel 2.10.3
>
> My question: What is the best way to consume msgs from multiple
> brokers/queues and feed those messages through a single route?
>
> Explanation:
>
> I currently consume from an activemq broker.  I have several different
> routes that consume messages from different queues on that broker.  Now, the
> admins have updated to a network of brokers.
>
> The producers of the messages are using failover (there are only two brokers
> at the moment).  Because those producers could place msgs on either broker,
> I want to check both brokers (I had a past issue on a different project
> where the producers failed over briefly and sent msgs to the backup that
> were never consumed even though I was using a failover url.  My solution at
> the time was to always check/consume from both primary and backup - ignoring
> failover - using a second activemq config to the secondary broker).
>
> My problem is that now I have many routes and I want msgs from either the
> primary or backup jms queue to propagate through those routes without having
> to duplicate the route for each broker.  For example, I DONT want to do this
> for each route (my actual routes are more complex than these):
>
> 
> 
> 
> 
> 
>
> 
> 
> 
> 
>  
>
> I realize I could make the route above a direct route and then consume from
> each broker and send to it, but this still seems ugly:
>
> 
> 
> 
> 
>
> 
> 
> 
> 
>
> 
> 
> 
>  
>
> I've considered combining into a single in-memory queue, but I've never done
> that before and would worry about robustness of the queue (I can't lose any
> messages).
>
> What is the smart way to do this?
>
> Thanks very much for any insight!
>
> -J
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Best-way-to-consuming-same-queue-from-two-brokers-tp5742100.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Spring ASM issue with Camel + CXF

2013-10-23 Thread Charles Moulliard
Hi,

Using Spring 3.1.3.RELEASE + Camel 2.12.1 + CXF 2.7.7, I get this exception

java.lang.IncompatibleClassChangeError: class
org.springframework.core.LocalVariableTableParameterNameDiscoverer$ParameterNameDiscoveringVisitor
has interface org.springframework.asm.ClassVisitor as super class

when I run Camel in Tomcat (but I can also reproduce this error when
running locally my camel project so they are not related).

https://gist.github.com/7123359

I have added this exclusion to camel-cxf but that does not help a lot


org.apache.camel
camel-cxf


org.springframework
spring-asm




but that does not help a lot. Any idea is welcome ?

Regards,

-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io


Re: error while testing: duplicate id detected

2013-10-23 Thread Olaf
Oh, no... 
Thank you very much!



--
View this message in context: 
http://camel.465427.n5.nabble.com/error-while-testing-duplicate-id-detected-tp5742041p5742102.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Spring ASM issue with Camel + CXF

2013-10-23 Thread Daniel Kulp
I’d suggest a “mvn dependency:tree” and see what’s there.   It sounds like a 
mis-match of versions of spring jars.   Possibly a 3.2.x version of spring-asm 
being picked up but a 3.1.x version of core or similar.

Dan



On Oct 23, 2013, at 1:59 PM, Charles Moulliard  wrote:

> Hi,
> 
> Using Spring 3.1.3.RELEASE + Camel 2.12.1 + CXF 2.7.7, I get this exception
> 
> java.lang.IncompatibleClassChangeError: class
> org.springframework.core.LocalVariableTableParameterNameDiscoverer$ParameterNameDiscoveringVisitor
> has interface org.springframework.asm.ClassVisitor as super class
> 
> when I run Camel in Tomcat (but I can also reproduce this error when
> running locally my camel project so they are not related).
> 
> https://gist.github.com/7123359
> 
> I have added this exclusion to camel-cxf but that does not help a lot
> 
>
>org.apache.camel
>camel-cxf
>
>
>org.springframework
>spring-asm
>
>
>
> 
> but that does not help a lot. Any idea is welcome ?
> 
> Regards,
> 
> -- 
> Charles Moulliard
> Apache Committer / Architect @RedHat
> Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

-- 
Daniel Kulp
dk...@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com



Re: Best way to consuming same queue from two brokers?

2013-10-23 Thread dunnlow
Thanks James.  Well, yes... sort of.  If a producer sends to one broker, I
can consume from either as expected...IF both brokers are ok.  My concern
(that I have from my relayed past experience) is that if I use the failover
uri and there is a problem, that my consumer will miss some of the message
produced.  Maybe this isn't a legitimate concern (although, in my
skepticism's defense, the admin who configured it expressed a lack in
confidence about it's configuration).  Thus, I think the safest way forward
may be to point a consumer to each of the brokers.  Considering more brokers
may come online, what I guess there would be ideally it to funnel all of the
brokers into a single endpoint from which I could process.  Does that make
sense or am I way overcomplicating it?  Thanks again.


James Carman wrote
> The NoB should be routing your messages for you, shouldn't it?





--
View this message in context: 
http://camel.465427.n5.nabble.com/Best-way-to-consuming-same-queue-from-two-brokers-tp5742100p5742105.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Best way to consuming same queue from two brokers?

2013-10-23 Thread James Carman
Remember that a NoB is not a "cluster", per se.  There is no
replication between brokers.  So, if one broker goes down while there
are messages sitting on it, then those messages are lost until the
broker comes back online.  If you're looking for high availability,
then you're barking up the wrong tree.  You need to look into a
Master/Slave setup.

On Wed, Oct 23, 2013 at 2:57 PM, dunnlow  wrote:
> Thanks James.  Well, yes... sort of.  If a producer sends to one broker, I
> can consume from either as expected...IF both brokers are ok.  My concern
> (that I have from my relayed past experience) is that if I use the failover
> uri and there is a problem, that my consumer will miss some of the message
> produced.  Maybe this isn't a legitimate concern (although, in my
> skepticism's defense, the admin who configured it expressed a lack in
> confidence about it's configuration).  Thus, I think the safest way forward
> may be to point a consumer to each of the brokers.  Considering more brokers
> may come online, what I guess there would be ideally it to funnel all of the
> brokers into a single endpoint from which I could process.  Does that make
> sense or am I way overcomplicating it?  Thanks again.
>
>
> James Carman wrote
>> The NoB should be routing your messages for you, shouldn't it?
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Best-way-to-consuming-same-queue-from-two-brokers-tp5742100p5742105.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to Use ProducerTemplate for testing secure CXF-WS?

2013-10-23 Thread sjfloat
Frank,

Did you have any luck with this? I'm attempting to do something similar.



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-Use-ProducerTemplate-for-testing-secure-CXF-WS-tp5730894p5742107.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: endChoice() in Camel Scala DSL

2013-10-23 Thread Willem jiang
Hi
As Scala supports to passing a block, you don't need to use endChoice() or 
end() to close the choice() 
Here is an example for it
choice {
when(simple("${body} == 'foo'")) to "mock:foo"
otherwise to "mock:other"
}
to("mock:end")


-- 
Willem Jiang



On Wednesday, October 23, 2013 at 11:46 PM, abhinavm wrote:

> Hello,
> 
> I have a scenario, where some code needs to go into choice, some in
> otherwise, and some common clean-up code needs to be executed after that in
> both scenarios. Since I could not find endChoice() or end() in the Scala
> DSL, I tried the following piece of code, but could not achieve what I
> wanted. Basically it would consider all the code after otherwise as a part
> of otherwise. Can someone please tell me where I am going wrong ? 
> 
> .choice(){
> when(exchange => exchange.getIn.getBody(classOf[String]) != null){
> process(new ResponseProcessor)
> .log(LoggingLevel.INFO,"File with content: ${body}")
> .log("Completed Job")
> } otherwise{
> log(LoggingLevel.INFO,"Empty Body")
> }
> }
> .log("Should Reach Here in all scenarios")
> 
> 
> Thanks
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/endChoice-in-Camel-Scala-DSL-tp5742094.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).





how to know which email receipt is failure for what reason

2013-10-23 Thread ishwar
hi,
i am sending the email using following code.

public boolean sendEmail(JSONObject data)
{
boolean status=false;
camel = new DefaultCamelContext();
template = camel.createProducerTemplate();

Map map = new HashMap();
map.put("To",data.getString("toaddress"));
String body = data.getString("body");
map.put("Subject", data.getString("subject"));
map.put("From", "...@yahoo.com");



template.sendBodyAndHeaders("smtps://smtp.gmail.com?username=s...@gmail.com&password=ixxx",
body, map);

status=true;
return status;

}

This code is working fine for sending single receipt as well as multiple
receipt but the problem is that how do i know which email receipt is fail
and for what reason.i am new in camel so i do not know whether camel is
proving or not?





--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-know-which-email-receipt-is-failure-for-what-reason-tp5742112.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel is not transfering the files sometimes

2013-10-23 Thread Bharath
Hi, 

   My Camel application has a simple route say from(file).to(sftp).Files
transferred successfully when i deploy my application initially and after
sometime the files are not moving from the Source location to the
destination and the source location is getting accumulated by files..There
is nothing in the log file too..what could be the reason??did my camel
application freezes?? 


Cheers!!! 
Bharath.R



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-is-not-transfering-the-files-sometimes-tp5742111.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: ActiveMq-InOut: save exchange body

2013-10-23 Thread ak-dak
Hi,

I have a simple example which works as expected:
---
*Camel-Routes:*

   


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
















*Bean-Class:*
public class MyBean {

public void print(Exchange exchange) {
System.out.println("start");
exchange.getOut().setBody("beforeEnrich: ");
}

public void enrich(Exchange exchange) {
System.out.println("enrich");

exchange.getOut().setBody("enrich-body");
}

public void printAfterEnrich(Exchange exchange) {
System.out.println("printAfterEnrich-body: " +
exchange.getIn().getBody());
}   
}

*Enricher-Class:*
public class MyEnrichStrategy implements AggregationStrategy {

@Override
public Exchange aggregate(Exchange original, Exchange resource) {
String originalBody = original.getIn().getBody(String.class);
String resourceResponse = 
resource.getIn().getBody(String.class);

originalBody += resourceResponse;
original.getIn().setBody(originalBody);

return original;
}   
}

---

But if I separate the routes with activeMq it doesn't works anymore.
Thats are not working camel routes:

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




















I got a time out exception:

08:27:08,236 WARN 
[org.apache.camel.component.jms.reply.TemporaryQueueReplyManager] Timeout
occurred after 2 millis waiting for reply message with correlationID
[ID-P00563-49858-1382595520631-4-17]. Setting ExchangeTimedOutException on
(MessageId: ID-P00563-49858-1382595520631-4-16 on ExchangeId:
ID-P00563-49858-1382595520631-4-22) and continue routing.
08:27:08,236 ERROR [org.apache.camel.processor.DefaultErrorHandler] Failed
delivery for (MessageId: ID-P00563-49858-1382595520631-4-16 on ExchangeId:
ID-P00563-49858-1382595520631-4-15). Exhausted after delivery attempt: 1
caught: org.apache.camel.ExchangeTimedOutException: The OUT message was not
received within: 2 millis due reply message with correlationID:
ID-P00563-49858-1382595520631-4-17 not received.
Exchange[JmsMessage@0x1997f541]: org.apache.camel.ExchangeTimedOutException:
The OUT message was not received within: 2 millis due reply message with
correlationID: ID-P00563-49858-1382595520631-4-17 not received.
Exchange[JmsMessage@0x1997f541]
at
org.apache.camel.component.jms.reply.ReplyManagerSupport.processReply(ReplyManagerSupport.java:133)
[camel-jms-2.10.1.jar:2.10.1]
at
org.apache.camel.component.jms.reply.TemporaryQueueReplyHandler.onTimeout(TemporaryQueueReplyHandler.java:61)
[camel-jms-2.10.1.jar:2.10.1]
at
org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:53)
[camel-jms-2.10.1.jar:2.10.1]
at
org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:30)
[camel-jms-2.10.1.jar:2.10.1]
at
org.apache.camel.support.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:203)
[camel-core-2.10.0.jar:2.10.0]
at
org.apache.camel.support.DefaultTimeoutMap.run(DefaultTimeoutMap.java:159)
[camel-core-2.10.0.jar:2.10.0]
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
[rt.jar:1.7.0_13]
at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
[rt.jar:1.7.0_13]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
[rt.jar:1.7.0_13]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
[rt.jar:1.7.0_13]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
[rt.jar:1.7.0_13]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[rt.jar:1.7.0_13]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[rt.jar:1.7.0_13]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]

08:27:08,236 WARN  [org.apache.camel.component.jms.EndpointMessageListener]
Execution of JMS message listener fai

Re: Best way to consuming same queue from two brokers?

2013-10-23 Thread contactreji
Hi Dunnlow

If you are using in memory queue, have you thought about using seda: instead
of direct : ? 
seda would be able to store message since its asynchronous and can buffer up
data in case other routes dont come up on time . 

But direct is highly synchronous. Might have data loss of consumers are not
in sync with it.

Reji



--
View this message in context: 
http://camel.465427.n5.nabble.com/Best-way-to-consuming-same-queue-from-two-brokers-tp5742100p5742115.html
Sent from the Camel - Users mailing list archive at Nabble.com.