Camel Twitter - Filter through message body

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Camel Twitter - Filter through message body

Gnanaguru S
Hi

Gladly I was working with Camel Twitter and Web socket example and found the options available with the component.

In the middle I got struck with a issue,

The example filters the tweets for "gaga", I changed it and it filters fine. But How can I pass this through a message. I have a JMS endpoint which will send this "gaga" and I should pass this as a parameter in twitter component.

I went through the forums and found that setting a header or property can help me in reusing it but I wanted to know is there any other way I can make it work. (Like using any camel:simple options)

Idea is I just wanted to try, Instead of hard coding the keyword, It should be more dynamic.

And thanks for a simple websocket program, which makes understand of web socket easier for a beginner.

regards
Guru
Reply | Threaded
Open this post in threaded view
|

Re: Camel Twitter - Filter through message body

Claus Ibsen-2
On Tue, Oct 2, 2012 at 12:34 PM, Gnanaguru S
<[hidden email]> wrote:

> Hi
>
> Gladly I was working with Camel Twitter and Web socket example and found the
> options available with the component.
>
> In the middle I got struck with a issue,
>
> The example filters the tweets for "gaga", I changed it and it filters fine.
> But How can I pass this through a message. I have a JMS endpoint which will
> send this "gaga" and I should pass this as a parameter in twitter component.
>
> I went through the forums and found that setting a header or property can
> help me in reusing it but I wanted to know is there any other way I can make
> it work. (Like using any camel:simple options)
>
> Idea is I just wanted to try, Instead of hard coding the keyword, It should
> be more dynamic.
>
> And thanks for a simple websocket program, which makes understand of web
> socket easier for a beginner.
>

There is a twitter producer that can do searches as well. Check out
the unit tests of the camel-twitter component to find more examples.


> regards
> Guru
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Twitter-Filter-through-message-body-tp5720356.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|

Re: Camel Twitter - Filter through message body

Gnanaguru S

I understood.

I tried the following producer. I tried to take the keyword from a file. ( Will my logic work ? I kept a keyword in a simple text file)

from("file://u:/take?noop=true")
                        .setHeader("CamelTwitterKeywords", header("bar"))
                        .to("twitter://search")
                        .to("websocket:camel-tweet?sendToAll=true");

I have configured the auth tokens, No issues with that.

I am getting this exception.

        at java.lang.Thread.run(Thread.java:662)
[-1) thread #0 - file://u:/take] GenericFileOnCompletion        WARN  Rollback f
ile strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessS
trategy@28b7f2d0 for file: GenericFile[u:\take\Data.txt]
[-1) thread #0 - file://u:/take] DefaultErrorHandler            ERROR Failed del
ivery for (MessageId: ID-Guru-PC-65468-1349180777016-0-11 on ExchangeId: ID-Guru
-PC-65468-1349180777016-0-12). Exhausted after delivery attempt: 1 caught: org.a
pache.camel.CamelExchangeException: No keywords to use for query. Exchange[Data.
txt]
org.apache.camel.CamelExchangeException: No keywords to use for query. Exchange[
Data.txt]
        at org.apache.camel.component.twitter.producer.SearchProducer.process(Se
archProducer.java:48)
        at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncP
rocessorBridge.process(AsyncProcessorConverterHelper.java:61)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProc
essor.java:120)
        at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.j
ava:292)
        at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:1
15)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:99)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.management.InstrumentationProcessor.process(Instrume
ntationProcessor.java:73)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:99)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.processor.interceptor.TraceInterceptor.process(Trace
Interceptor.java:91)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler
(RedeliveryErrorHandler.java:330)
        at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryE
rrorHandler.java:220)
        at org.apache.camel.processor.RouteContextProcessor.processNext(RouteCon
textProcessor.java:45)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.processor.interceptor.DefaultChannel.process(Default
Channel.java:303)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
        at org.apache.camel.processor.RouteContextProcessor.processNext(RouteCon
textProcessor.java:45)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWor
kProcessor.java:150)
        at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProc
essor.java:117)
        at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNe
xt(RouteInflightRepositoryProcessor.java:48)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:99)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.management.InstrumentationProcessor.process(Instrume
ntationProcessor.java:73)
        at org.apache.camel.component.file.GenericFileConsumer.processExchange(G
enericFileConsumer.java:336)
        at org.apache.camel.component.file.GenericFileConsumer.processBatch(Gene
ricFileConsumer.java:189)
        at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileC
onsumer.java:155)
        at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsum
er.java:139)
        at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer
.java:91)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:44
1)
        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java
:317)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
access$101(ScheduledThreadPoolExecutor.java:98)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
runPeriodic(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
run(ScheduledThreadPoolExecutor.java:204)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
        at java.lang.Thread.run(Thread.java:662)
[-1) thread #0 - file://u:/take] GenericFileOnCompletion        WARN  Rollback f
ile strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessS
trategy@28b7f2d0 for file: GenericFile[u:\take\Data.txt]
[-1) thread #0 - file://u:/take] DefaultErrorHandler            ERROR Failed del
ivery for (MessageId: ID-Guru-PC-65468-1349180777016-0-13 on ExchangeId: ID-Guru
-PC-65468-1349180777016-0-14). Exhausted after delivery attempt: 1 caught: org.a
pache.camel.CamelExchangeException: No keywords to use for query. Exchange[Data.
txt]
org.apache.camel.CamelExchangeException: No keywords to use for query. Exchange[
Data.txt]
        at org.apache.camel.component.twitter.producer.SearchProducer.process(Se
archProducer.java:48)
        at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncP
rocessorBridge.process(AsyncProcessorConverterHelper.java:61)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProc
essor.java:120)
        at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.j
ava:292)
        at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:1
15)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:99)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.management.InstrumentationProcessor.process(Instrume
ntationProcessor.java:73)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:99)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.processor.interceptor.TraceInterceptor.process(Trace
Interceptor.java:91)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler
(RedeliveryErrorHandler.java:330)
        at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryE
rrorHandler.java:220)
        at org.apache.camel.processor.RouteContextProcessor.processNext(RouteCon
textProcessor.java:45)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.processor.interceptor.DefaultChannel.process(Default
Channel.java:303)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
        at org.apache.camel.processor.RouteContextProcessor.processNext(RouteCon
textProcessor.java:45)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWor
kProcessor.java:150)
        at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProc
essor.java:117)
        at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNe
xt(RouteInflightRepositoryProcessor.java:48)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:99)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.management.InstrumentationProcessor.process(Instrume
ntationProcessor.java:73)
        at org.apache.camel.component.file.GenericFileConsumer.processExchange(G
enericFileConsumer.java:336)
        at org.apache.camel.component.file.GenericFileConsumer.processBatch(Gene
ricFileConsumer.java:189)
        at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileC
onsumer.java:155)
        at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsum
er.java:139)
        at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer
.java:91)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:44
1)
        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java
:317)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
access$101(ScheduledThreadPoolExecutor.java:98)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
runPeriodic(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
run(ScheduledThreadPoolExecutor.java:204)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)

Regards
Guru
Reply | Threaded
Open this post in threaded view
|

RE: Camel Twitter - Filter through message body

DEPREZ Arnaud     AWL-IT
Hi,

I think your "bar" header isn't set or I don't understand what you want to do.
When you read a file from the file component of Camel, Camel won't set a "bar" header for you.

The camel file component will set some header but not the "bar" one.


Arnaud Deprez


-----Original Message-----
From: Gnanaguru S [mailto:[hidden email]]
Sent: mardi 2 octobre 2012 14:27
To: [hidden email]
Subject: Re: Camel Twitter - Filter through message body



I understood.

I tried the following producer. I tried to take the keyword from a file. (
Will my logic work ? I kept a keyword in a simple text file)

from("file://u:/take?noop=true")
                        .setHeader("CamelTwitterKeywords", header("bar"))
                        .to("twitter://search")
                        .to("websocket:camel-tweet?sendToAll=true");

I have configured the auth tokens, No issues with that.

I am getting this exception.

        at java.lang.Thread.run(Thread.java:662)
[-1) thread #0 - file://u:/take] GenericFileOnCompletion        WARN
Rollback f
ile strategy:
org.apache.camel.component.file.strategy.GenericFileRenameProcessS
trategy@28b7f2d0 for file: GenericFile[u:\take\Data.txt]
[-1) thread #0 - file://u:/take] DefaultErrorHandler            ERROR Failed
del
ivery for (MessageId: ID-Guru-PC-65468-1349180777016-0-11 on ExchangeId:
ID-Guru
-PC-65468-1349180777016-0-12). Exhausted after delivery attempt: 1 caught:
org.a
pache.camel.CamelExchangeException: No keywords to use for query.
Exchange[Data.
txt]
org.apache.camel.CamelExchangeException: No keywords to use for query.
Exchange[
Data.txt]
        at
org.apache.camel.component.twitter.producer.SearchProducer.process(Se
archProducer.java:48)
        at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncP
rocessorBridge.process(AsyncProcessorConverterHelper.java:61)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProc
essor.java:120)
        at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.j
ava:292)
        at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:1
15)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:99)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at
org.apache.camel.management.InstrumentationProcessor.process(Instrume
ntationProcessor.java:73)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:99)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at
org.apache.camel.processor.interceptor.TraceInterceptor.process(Trace
Interceptor.java:91)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler
(RedeliveryErrorHandler.java:330)
        at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryE
rrorHandler.java:220)
        at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteCon
textProcessor.java:45)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at
org.apache.camel.processor.interceptor.DefaultChannel.process(Default
Channel.java:303)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
        at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteCon
textProcessor.java:45)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWor
kProcessor.java:150)
        at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProc
essor.java:117)
        at
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNe
xt(RouteInflightRepositoryProcessor.java:48)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:99)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at
org.apache.camel.management.InstrumentationProcessor.process(Instrume
ntationProcessor.java:73)
        at
org.apache.camel.component.file.GenericFileConsumer.processExchange(G
enericFileConsumer.java:336)
        at
org.apache.camel.component.file.GenericFileConsumer.processBatch(Gene
ricFileConsumer.java:189)
        at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileC
onsumer.java:155)
        at
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsum
er.java:139)
        at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer
.java:91)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:44
1)
        at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java
:317)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
access$101(ScheduledThreadPoolExecutor.java:98)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
runPeriodic(ScheduledThreadPoolExecutor.java:180)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
run(ScheduledThreadPoolExecutor.java:204)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
        at java.lang.Thread.run(Thread.java:662)
[-1) thread #0 - file://u:/take] GenericFileOnCompletion        WARN
Rollback f
ile strategy:
org.apache.camel.component.file.strategy.GenericFileRenameProcessS
trategy@28b7f2d0 for file: GenericFile[u:\take\Data.txt]
[-1) thread #0 - file://u:/take] DefaultErrorHandler            ERROR Failed
del
ivery for (MessageId: ID-Guru-PC-65468-1349180777016-0-13 on ExchangeId:
ID-Guru
-PC-65468-1349180777016-0-14). Exhausted after delivery attempt: 1 caught:
org.a
pache.camel.CamelExchangeException: No keywords to use for query.
Exchange[Data.
txt]
org.apache.camel.CamelExchangeException: No keywords to use for query.
Exchange[
Data.txt]
        at
org.apache.camel.component.twitter.producer.SearchProducer.process(Se
archProducer.java:48)
        at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncP
rocessorBridge.process(AsyncProcessorConverterHelper.java:61)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProc
essor.java:120)
        at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.j
ava:292)
        at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:1
15)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:99)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at
org.apache.camel.management.InstrumentationProcessor.process(Instrume
ntationProcessor.java:73)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:99)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at
org.apache.camel.processor.interceptor.TraceInterceptor.process(Trace
Interceptor.java:91)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler
(RedeliveryErrorHandler.java:330)
        at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryE
rrorHandler.java:220)
        at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteCon
textProcessor.java:45)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at
org.apache.camel.processor.interceptor.DefaultChannel.process(Default
Channel.java:303)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
        at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteCon
textProcessor.java:45)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWor
kProcessor.java:150)
        at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProc
essor.java:117)
        at
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNe
xt(RouteInflightRepositoryProcessor.java:48)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:99)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at
org.apache.camel.management.InstrumentationProcessor.process(Instrume
ntationProcessor.java:73)
        at
org.apache.camel.component.file.GenericFileConsumer.processExchange(G
enericFileConsumer.java:336)
        at
org.apache.camel.component.file.GenericFileConsumer.processBatch(Gene
ricFileConsumer.java:189)
        at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileC
onsumer.java:155)
        at
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsum
er.java:139)
        at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer
.java:91)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:44
1)
        at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java
:317)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
access$101(ScheduledThreadPoolExecutor.java:98)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
runPeriodic(ScheduledThreadPoolExecutor.java:180)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
run(ScheduledThreadPoolExecutor.java:204)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)

Regards
Guru



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Twitter-Filter-through-message-body-tp5720356p5720363.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Atos Worldline SA/NV - Chaussee de Haecht 1442 Haachtsesteenweg
- 1130 Brussels - Belgium
RPM-RPR Bruxelles-Brussel - TVA-BTW BE 0418.547.872
Bankrekening-Compte Bancaire-Bank Account 310-0269424-44
BIC BBRUBEBB - IBAN BE55 3100 2694 2444

"The information contained in this e-mail and any attachment thereto is confidential and may contain information which is protected by intellectual property rights.
This information is intended for the exclusive use of the recipient(s) named above.
This e-mail does not constitute any binding relationship or offer toward any of the addressees.
If you are not one of the addressees , one of their employees or a proxy holder entitled to hand over this message to the addressee(s), any use of the information contained herein (e.g. reproduction, divulgation, communication or distribution,...) is prohibited.
If you have received this message in error, please notify the sender and destroy it immediately after.
The integrity and security of this message cannot be guaranteed and it may be subject to data corruption, interception and unauthorized amendment, for which we accept no liability."
Reply | Threaded
Open this post in threaded view
|

RE: Camel Twitter - Filter through message body

Gnanaguru S

I think I misunderstood the header concept.

can you make ,me little more clear, I dont have the understanding of this header clearly. Sorry for that.

I just kept the keyword in a text file. And I need to send it to twitter for searching. Can you suggest what I should do with the above code.

regards
Guru

Reply | Threaded
Open this post in threaded view
|

Re: Camel Twitter - Filter through message body

Claus Ibsen-2
You can always do a dynamic to
http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html

On Tue, Oct 2, 2012 at 2:45 PM, Gnanaguru S
<[hidden email]> wrote:

>
> I think I misunderstood the header concept.
>
> can you make ,me little more clear, I dont have the understanding of this
> header clearly. Sorry for that.
>
> I just kept the keyword in a text file. And I need to send it to twitter for
> searching. Can you suggest what I should do with the above code.
>
> regards
> Guru
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Twitter-Filter-through-message-body-tp5720356p5720366.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|

Re: Camel Twitter - Filter through message body

Gnanaguru S

Great Claus.

It is working.

from("file://u:/take")
                        .to("twitter://search?keywords=${body}")
                        .to("websocket:camel-tweet?sendToAll=true");

Please clarify my doubt, In camel-example-twitter-websocket. The twitter JSON format is parsed somewhere ? for a better formatting.

regards
Guru
Reply | Threaded
Open this post in threaded view
|

Re: Camel Twitter - Filter through message body

Gnanaguru S

Hello Claus,

Glad to know about the dynamic to URI. Is it possible to take a value from one route and pass it as a parameter to another route in from uri.



Such that it can be a dynamic FROM ! I can understand that it is not possible directly. But can be suggest me a logic.

So that I can pass a value to a Twitter consumer.

regards
Guru
Reply | Threaded
Open this post in threaded view
|

Re: Camel Twitter - Filter through message body

Claus Ibsen-2
On Tue, Oct 2, 2012 at 3:20 PM, Gnanaguru S
<[hidden email]> wrote:

>
> Hello Claus,
>
> Glad to know about the dynamic to URI. Is it possible to take a value from
> one route and pass it as a parameter to another route in from uri.
>
>
>
> Such that it can be a dynamic FROM ! I can understand that it is not
> possible directly. But can be suggest me a logic.
>
> So that I can pass a value to a Twitter consumer.
>

Twitter consumer does not support dynamic search keywords. You would
need to stop the route, update the endpoint, and start the route
again, to have it take affect.



> regards
> Guru
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Twitter-Filter-through-message-body-tp5720356p5720369.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Reply | Threaded
Open this post in threaded view
|

Re: Camel Twitter - Filter through message body

Bruno Borges
Take a look at this code. It does change the consumer keyword by doing what
Claus described (remove/add route):

https://github.com/brunoborges/tdconcamel/blob/master/src/main/java/com/brunoborges/tdconcamel/TDCOnCamelRoute.java

Cheers
*Bruno Borges*
(11) 99564-9058
*www.brunoborges.com*



On Tue, Oct 2, 2012 at 7:13 AM, Claus Ibsen <[hidden email]> wrote:

> On Tue, Oct 2, 2012 at 3:20 PM, Gnanaguru S
> <[hidden email]> wrote:
> >
> > Hello Claus,
> >
> > Glad to know about the dynamic to URI. Is it possible to take a value
> from
> > one route and pass it as a parameter to another route in from uri.
> >
> >
> >
> > Such that it can be a dynamic FROM ! I can understand that it is not
> > possible directly. But can be suggest me a logic.
> >
> > So that I can pass a value to a Twitter consumer.
> >
>
> Twitter consumer does not support dynamic search keywords. You would
> need to stop the route, update the endpoint, and start the route
> again, to have it take affect.
>
>
>
> > regards
> > Guru
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Camel-Twitter-Filter-through-message-body-tp5720356p5720369.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: [hidden email]
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>