Re: Instagram Component ?

2016-03-25 Thread Claus Ibsen
Hi

Yeah we do not have such a component. And it would be great to have one.

We love contributions
http://camel.apache.org/contributing


On Fri, Mar 25, 2016 at 7:49 PM, Matt Sicker  wrote:
> No, there isn't an official component, and I don't see any third party
> ones, either.
>
> On 25 March 2016 at 13:40, Mark  wrote:
>
>> I'm wondering if there is an Instagram component in Camel.  If not I'd like
>> to start work on one and can submit a pull request back to the baseline.
>>
>
>
>
> --
> Matt Sicker 



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: Issue with dynamic uri

2016-03-25 Thread Claus Ibsen
Hi

Good to hear. But mind the consumer template should be created once
and re-used ideally.
http://camel.apache.org/why-does-camel-use-too-many-threads-with-producertemplate.html

If not you need to stop it after use so it can cleanup.



On Sat, Mar 26, 2016 at 6:03 AM, Jagannath Naidu
 wrote:
> Hi Claus,
>
> !!@#$@  it worked :-D. Thank you very much
>
> Below is what I am using.
>
> Logger log = Logger.getLogger(JettyRoute.class.getName());
>
> DynamicPollEnricher pollEnricher = new DynamicPollEnricher();
>
> public String process(Exchange exchange) throws Exception {
> log.info("START");
> // TODO Auto-generated method stub
> ConsumerTemplate consumerTemplate =
> exchange.getContext().createConsumerTemplate();
> String headVal = (String)exchange.getIn().getHeader("dynamic");
> String enrichURI = "activemq:queue:SECOND?selector=head='"+headVal+"'";
> log.info("HELOO " + headVal + " H " + enrichURI);
> /*ExchangeHelper.*/
> Exchange answer = consumerTemplate.receive(enrichURI, 2);
> log.info("Received Exchange Body:  "+answer.getIn().getBody(String.class));
> log.info("Received Exchange MessageId:  "+answer.getIn().getMessageId());
> String a = answer.getIn().getBody(String.class);
> return a;
> }
>
>
>
>
>
> On 25 March 2016 at 19:10, Claus Ibsen  wrote:
>
>> You can use a processor (or bean) - the code below is pseudo written
>> in the email
>>
>> process(Exchange exchange) {
>> // use simple to build the dynamic uri
>> String uri =
>> exchange.getContext().resolveLanguage("simple").evaluate("activemq:queue:SECOND?selector=${header.head}",
>> String.class);
>>
>> // create polling consumer to poll the message
>> PollingConsumer pc = exchange.getEndpoint(uri).createPollingConsumer();
>> pc.start();
>> try {
>> Exchange out = pc.receive(3);
>> if (out != null) {
>>.. merge from out into current exchange
>> Object newBody = out.getIn().getBody();
>> Object oldBody = exchange.getIn().getBody();
>> .. merge like you want to do in that strategy class.
>> .. or you can use the strategy here
>>// done out
>>   out.getUnitOfWork().done(out);
>> } finally {
>> pc.stop();
>> }
>>
>> On Fri, Mar 25, 2016 at 9:24 AM, Jagannath Naidu
>>  wrote:
>> > Thanks Claus,
>> >
>> > I came here for help after reading this link
>> >
>> http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
>> > .
>> > And I am fairly new to camel, would you mind sharing some/any sample code
>> > for this.
>> > Thank you very much.
>> >
>> > On 25 March 2016 at 13:35, Claus Ibsen  wrote:
>> >
>> >> If you are stuck on Camel 2.15.x you would need to write some java
>> >> code where you build the uri and use a consumer template to poll. And
>> >> do the enrichment from the java code.
>> >>
>> >>
>> >>
>> >> On Fri, Mar 25, 2016 at 9:02 AM, Jagannath Naidu
>> >>  wrote:
>> >> > Thank you fabrizio.
>> >> >
>> >> > But the issue is with passing dynamic uri to pollenrich.
>> >> >
>> >> > On 25 March 2016 at 13:25, fabrizio.spataro <
>> fabrizio.spat...@bizmate.it
>> >> >
>> >> > wrote:
>> >> >
>> >> >> Hello,
>> >> >>
>> >> >> abstractly dynamic uri can be do it using recipientList + simple
>> >> leanguage
>> >> >>
>> >> >>
>> >> > http://camel.apache.org/content-enricher.html
>> >> > says, you can use something like
>> >> > 
>> >> >   
>> >> >   
>> >> > seda:${header.name}
>> >> >   
>> >> >   
>> >> > 
>> >> >
>> >> > But I am restricted to use 2.15 only
>> >> >
>> >> > example here: http://camel.apache.org/recipient-list.html
>> >> >>
>> >> >> I want to replace this line
>> >> >
>> >> > > >> > strategyRef="myStrat" timeout="3"/>
>> >> >
>> >> > With something like this
>> >> >
>> >> > > uri="activemq:queue:SECOND?selector=${header.head}"
>> >> > strategyRef="myStrat" timeout="3"/>
>> >> >
>> >> >
>> >>
>> http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
>> >> > says it is possible with an alternative, but I am still clueless. I am
>> >> > fairly new to camel usage.
>> >> >
>> >> >
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://camel.465427.n5.nabble.com/Issue-with-dynamic-uri-tp5779689p5779690.html
>> >> >> Sent from the Camel - Users mailing list archive at Nabble.com.
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Thanks & Regards
>> >> >
>> >> > B Jagannath
>> >> > Keen & Able Computers Pvt. Ltd.
>> >> > +919871324006
>> >>
>> >>
>> >>
>> >> --
>> >> Claus Ibsen
>> >> -
>> >> http://davsclaus.com @davsclaus
>> >> Camel in Action 2: https://www.manning.com/ibsen2
>> >>
>> >
>> >
>> >
>> > --
>> > Thanks & Regards
>> >
>> > B Jagannath
>> > Keen & Able Computers Pvt. Ltd.
>> > +919871324006
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>>
>
>
>
> --
> Thanks & Regards
>
> B Jagannath
> Keen & Able Computers Pvt. Ltd.
> +919871324006

Re: Issue with dynamic uri

2016-03-25 Thread Jagannath Naidu
Hi Claus,

!!@#$@  it worked :-D. Thank you very much

Below is what I am using.

Logger log = Logger.getLogger(JettyRoute.class.getName());

DynamicPollEnricher pollEnricher = new DynamicPollEnricher();

public String process(Exchange exchange) throws Exception {
log.info("START");
// TODO Auto-generated method stub
ConsumerTemplate consumerTemplate =
exchange.getContext().createConsumerTemplate();
String headVal = (String)exchange.getIn().getHeader("dynamic");
String enrichURI = "activemq:queue:SECOND?selector=head='"+headVal+"'";
log.info("HELOO " + headVal + " H " + enrichURI);
/*ExchangeHelper.*/
Exchange answer = consumerTemplate.receive(enrichURI, 2);
log.info("Received Exchange Body:  "+answer.getIn().getBody(String.class));
log.info("Received Exchange MessageId:  "+answer.getIn().getMessageId());
String a = answer.getIn().getBody(String.class);
return a;
}





On 25 March 2016 at 19:10, Claus Ibsen  wrote:

> You can use a processor (or bean) - the code below is pseudo written
> in the email
>
> process(Exchange exchange) {
> // use simple to build the dynamic uri
> String uri =
> exchange.getContext().resolveLanguage("simple").evaluate("activemq:queue:SECOND?selector=${header.head}",
> String.class);
>
> // create polling consumer to poll the message
> PollingConsumer pc = exchange.getEndpoint(uri).createPollingConsumer();
> pc.start();
> try {
> Exchange out = pc.receive(3);
> if (out != null) {
>.. merge from out into current exchange
> Object newBody = out.getIn().getBody();
> Object oldBody = exchange.getIn().getBody();
> .. merge like you want to do in that strategy class.
> .. or you can use the strategy here
>// done out
>   out.getUnitOfWork().done(out);
> } finally {
> pc.stop();
> }
>
> On Fri, Mar 25, 2016 at 9:24 AM, Jagannath Naidu
>  wrote:
> > Thanks Claus,
> >
> > I came here for help after reading this link
> >
> http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
> > .
> > And I am fairly new to camel, would you mind sharing some/any sample code
> > for this.
> > Thank you very much.
> >
> > On 25 March 2016 at 13:35, Claus Ibsen  wrote:
> >
> >> If you are stuck on Camel 2.15.x you would need to write some java
> >> code where you build the uri and use a consumer template to poll. And
> >> do the enrichment from the java code.
> >>
> >>
> >>
> >> On Fri, Mar 25, 2016 at 9:02 AM, Jagannath Naidu
> >>  wrote:
> >> > Thank you fabrizio.
> >> >
> >> > But the issue is with passing dynamic uri to pollenrich.
> >> >
> >> > On 25 March 2016 at 13:25, fabrizio.spataro <
> fabrizio.spat...@bizmate.it
> >> >
> >> > wrote:
> >> >
> >> >> Hello,
> >> >>
> >> >> abstractly dynamic uri can be do it using recipientList + simple
> >> leanguage
> >> >>
> >> >>
> >> > http://camel.apache.org/content-enricher.html
> >> > says, you can use something like
> >> > 
> >> >   
> >> >   
> >> > seda:${header.name}
> >> >   
> >> >   
> >> > 
> >> >
> >> > But I am restricted to use 2.15 only
> >> >
> >> > example here: http://camel.apache.org/recipient-list.html
> >> >>
> >> >> I want to replace this line
> >> >
> >> >  >> > strategyRef="myStrat" timeout="3"/>
> >> >
> >> > With something like this
> >> >
> >> >  uri="activemq:queue:SECOND?selector=${header.head}"
> >> > strategyRef="myStrat" timeout="3"/>
> >> >
> >> >
> >>
> http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
> >> > says it is possible with an alternative, but I am still clueless. I am
> >> > fairly new to camel usage.
> >> >
> >> >
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >>
> http://camel.465427.n5.nabble.com/Issue-with-dynamic-uri-tp5779689p5779690.html
> >> >> Sent from the Camel - Users mailing list archive at Nabble.com.
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Thanks & Regards
> >> >
> >> > B Jagannath
> >> > Keen & Able Computers Pvt. Ltd.
> >> > +919871324006
> >>
> >>
> >>
> >> --
> >> Claus Ibsen
> >> -
> >> http://davsclaus.com @davsclaus
> >> Camel in Action 2: https://www.manning.com/ibsen2
> >>
> >
> >
> >
> > --
> > Thanks & Regards
> >
> > B Jagannath
> > Keen & Able Computers Pvt. Ltd.
> > +919871324006
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>



-- 
Thanks & Regards

B Jagannath
Keen & Able Computers Pvt. Ltd.
+919871324006


Re: Instagram Component ?

2016-03-25 Thread Matt Sicker
No, there isn't an official component, and I don't see any third party
ones, either.

On 25 March 2016 at 13:40, Mark  wrote:

> I'm wondering if there is an Instagram component in Camel.  If not I'd like
> to start work on one and can submit a pull request back to the baseline.
>



-- 
Matt Sicker 


Instagram Component ?

2016-03-25 Thread Mark
I'm wondering if there is an Instagram component in Camel.  If not I'd like
to start work on one and can submit a pull request back to the baseline.


Re: Invalid URLs in wiki

2016-03-25 Thread Gregoire Autric
hi, Mihali

thx for pointing this errors,

I will update wiki doc, now

Best Regards, Bien à vous,  どうぞお元気で,

Greg AUTRIC
- JBoss Middleware Consultant -


On Fri, Mar 25, 2016 at 5:08 PM, Mihali Mavromatis <
m.mavroma...@protonmail.com> wrote:

> Hi there,
>
> Just a wiki URLs issue:
>
> See http://camel.apache.org/mail.html
>
> In the section SUN JavaMail apparently none of the displayed URLs resolve
> correctly.
>
> For the JavaMail you might want this: https://javamail.java.net/
>
> For the POP3
>
> https://javamail.java.net/nonav/docs/api/com/sun/mail/pop3/package-summary.html
>
> For the IMAP
>
> https://javamail.java.net/nonav/docs/api/com/sun/mail/imap/package-summary.html
>
> thanks
> Mihali
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Invalid-URLs-in-wiki-tp5779716.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Invalid URLs in wiki

2016-03-25 Thread Mihali Mavromatis
Hi there,

Just a wiki URLs issue: 

See http://camel.apache.org/mail.html 

In the section SUN JavaMail apparently none of the displayed URLs resolve
correctly. 

For the JavaMail you might want this: https://javamail.java.net/

For the POP3
https://javamail.java.net/nonav/docs/api/com/sun/mail/pop3/package-summary.html 

For the IMAP
https://javamail.java.net/nonav/docs/api/com/sun/mail/imap/package-summary.html

thanks
Mihali



--
View this message in context: 
http://camel.465427.n5.nabble.com/Invalid-URLs-in-wiki-tp5779716.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Issue with dynamic uri

2016-03-25 Thread Claus Ibsen
You can use a processor (or bean) - the code below is pseudo written
in the email

process(Exchange exchange) {
// use simple to build the dynamic uri
String uri = 
exchange.getContext().resolveLanguage("simple").evaluate("activemq:queue:SECOND?selector=${header.head}",
String.class);

// create polling consumer to poll the message
PollingConsumer pc = exchange.getEndpoint(uri).createPollingConsumer();
pc.start();
try {
Exchange out = pc.receive(3);
if (out != null) {
   .. merge from out into current exchange
Object newBody = out.getIn().getBody();
Object oldBody = exchange.getIn().getBody();
.. merge like you want to do in that strategy class.
.. or you can use the strategy here
   // done out
  out.getUnitOfWork().done(out);
} finally {
pc.stop();
}

On Fri, Mar 25, 2016 at 9:24 AM, Jagannath Naidu
 wrote:
> Thanks Claus,
>
> I came here for help after reading this link
> http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
> .
> And I am fairly new to camel, would you mind sharing some/any sample code
> for this.
> Thank you very much.
>
> On 25 March 2016 at 13:35, Claus Ibsen  wrote:
>
>> If you are stuck on Camel 2.15.x you would need to write some java
>> code where you build the uri and use a consumer template to poll. And
>> do the enrichment from the java code.
>>
>>
>>
>> On Fri, Mar 25, 2016 at 9:02 AM, Jagannath Naidu
>>  wrote:
>> > Thank you fabrizio.
>> >
>> > But the issue is with passing dynamic uri to pollenrich.
>> >
>> > On 25 March 2016 at 13:25, fabrizio.spataro > >
>> > wrote:
>> >
>> >> Hello,
>> >>
>> >> abstractly dynamic uri can be do it using recipientList + simple
>> leanguage
>> >>
>> >>
>> > http://camel.apache.org/content-enricher.html
>> > says, you can use something like
>> > 
>> >   
>> >   
>> > seda:${header.name}
>> >   
>> >   
>> > 
>> >
>> > But I am restricted to use 2.15 only
>> >
>> > example here: http://camel.apache.org/recipient-list.html
>> >>
>> >> I want to replace this line
>> >
>> > > > strategyRef="myStrat" timeout="3"/>
>> >
>> > With something like this
>> >
>> > > > strategyRef="myStrat" timeout="3"/>
>> >
>> >
>> http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
>> > says it is possible with an alternative, but I am still clueless. I am
>> > fairly new to camel usage.
>> >
>> >
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://camel.465427.n5.nabble.com/Issue-with-dynamic-uri-tp5779689p5779690.html
>> >> Sent from the Camel - Users mailing list archive at Nabble.com.
>> >>
>> >
>> >
>> >
>> > --
>> > Thanks & Regards
>> >
>> > B Jagannath
>> > Keen & Able Computers Pvt. Ltd.
>> > +919871324006
>>
>>
>>
>> --
>> Claus Ibsen
>> -
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>>
>
>
>
> --
> Thanks & Regards
>
> B Jagannath
> Keen & Able Computers Pvt. Ltd.
> +919871324006



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


RE: Camel reading file periodically

2016-03-25 Thread Kasim Sert (Ibtech-Software Infrastructure)
Thank you, now working.

-Original Message-
From: benny.gi...@gmail.com [mailto:benny.gi...@gmail.com] 
Sent: Friday, March 25, 2016 3:20 PM
To: users@camel.apache.org
Subject: Re: Camel reading file periodically


Hi, 

With Noop=true, Camel will set idempotent=true as well, to avoid consuming the 
same files over and over again.
So just set idempotent to false.

http://camel.apache.org/file2.html

Regards,

Benjamin Girstl


> Am 25.03.2016 um 13:53 schrieb Kasim Sert (Ibtech-Software Infrastructure) 
> :
> 
> Hi,
> 
> Why this route reads file for only one time, and what should I do to make it 
> work like excpected ?
> 
>from("timer://myTimer?period=1000")
> .log("starting...")
>
> .pollEnrich("file:d:/Workspaces/camel/demo-camel/src/main/resources?fileName=sample.xml&noop=true&readLock=none",1000)
>.log("read message xml ${body}" );
> 
> 
> Prints:
> 
> 2016-03-25 14:45:21,274 [timer://myTimer] INFO  route1
>  - starting...
> 2016-03-25 14:45:22,287 [timer://myTimer] INFO  route1
>  - read message xml
> 2016-03-25 14:45:22,287 [timer://myTimer] INFO  route1
>  - starting...
> 2016-03-25 14:45:22,299 [timer://myTimer] INFO  route1
>  - read message xml 
> 2016-03-25 14:45:23,288 [timer://myTimer] INFO  route1
>  - starting...
> 2016-03-25 14:45:24,289 [timer://myTimer] INFO  route1
>  - read message xml
> 2016-03-25 14:45:24,289 [timer://myTimer] INFO  route1
>  - starting...
> 2016-03-25 14:45:25,290 [timer://myTimer] INFO  route1
>  - read message xml
> 2016-03-25 14:45:25,290 [timer://myTimer] INFO  route1
>  - starting...
> 2016-03-25 14:45:26,291 [timer://myTimer] INFO  route1
>  - read message xml
> 
> 
> [Facebook]  [Twitter] 
> 
> 
> [https://www.finansbank.com.tr/Disclaimer/BannerImages.aspx?date=25.03.201614:5300]
> 
> 
> Bu e-posta'n?n i?erdi?i bilgiler (ekleri dahil olmak ?zere) gizlidir. 
> Onay?m?z olmaks?z?n ???nc? ki?ilere a?iklanamaz. Bu mesaj?n g?nderilmek 
> istendi?i ki?i de?ilseniz, l?tfen mesaj? sisteminizden derhal siliniz. IBTech 
> A.?. bu mesaj?n i?erdi?i bilgilerin do?rulu?u veya eksiksiz oldu?u konusunda 
> bir garanti vermemektedir. Bu nedenle bilgilerin ne ?ekilde olursa olsun 
> i?eri?inden, iletilmesinden, al?nmas?ndan, saklanmas?ndan sorumlu de?ildir. 
> Bu mesaj?n i?eri?i yazar?na ait olup, IBTech A.?.'nin g?r??lerini 
> i?ermeyebilir.
> 
> The information contained in this e-mail (including any attachments)is 
> confidential. It must not be disclosed to any person without our authority. 
> If you are not the intended recipient, please delete it from your system 
> immediately. IBTech A.S. makes no warranty as to the accuracy or completeness 
> of any information contained in this message and hereby excludes any 
> liability of any kind for the information contained therein or for the 
> information transmission, reception, storage or use of such in any way 
> whatsoever. Any opinions expressed in this message are those of the author 
> and may not necessarily reflect the opinions of IBTech A.S.


Bu e-posta'nin i?erdigi bilgiler (ekleri dahil olmak 
?zere) gizlidir. Onayimiz olmaksizin ???nc? kisilere a?iklanamaz. Bu mesajin 
g?nderilmek istendigi kisi degilseniz, l?tfen mesaji sisteminizden derhal 
siliniz. IBTech A.S. bu mesajin i?erdigi bilgilerin dogrulugu veya eksiksiz 
oldugu konusunda bir garanti vermemektedir. Bu nedenle bilgilerin ne sekilde 
olursa olsun i?eriginden, iletilmesinden, alinmasindan, saklanmasindan sorumlu 
degildir. Bu mesajin i?erigi yazarina ait olup, IBTech A.S.'nin g?r?slerini 
i?ermeyebilir.

The information contained in this e-mail (including any 
attachments)is confidential. It must not be disclosed to any person without our 
authority. If you are not the intended recipient, please delete it from your 
system immediately. IBTech A.S. makes no warranty as to the accuracy or 
completeness of any information contained in this message and hereby excludes 
any liability of any kind for the information contained therein or for the 
information transmission, reception, storage or use of such in any way 
whatsoever. Any opinions expressed in this message are those of the author and 
may not necessarily reflect the opinions of IBTech 
A.S.

Re: Camel reading file periodically

2016-03-25 Thread benny . gi456

Hi, 

With Noop=true, Camel will set idempotent=true as well, to avoid consuming the 
same files over and over again.
So just set idempotent to false.

http://camel.apache.org/file2.html

Regards,

Benjamin Girstl


> Am 25.03.2016 um 13:53 schrieb Kasim Sert (Ibtech-Software Infrastructure) 
> :
> 
> Hi,
> 
> Why this route reads file for only one time, and what should I do to make it 
> work like excpected ?
> 
>from("timer://myTimer?period=1000")
> .log("starting...")
>
> .pollEnrich("file:d:/Workspaces/camel/demo-camel/src/main/resources?fileName=sample.xml&noop=true&readLock=none",1000)
>.log("read message xml ${body}" );
> 
> 
> Prints:
> 
> 2016-03-25 14:45:21,274 [timer://myTimer] INFO  route1
>  - starting...
> 2016-03-25 14:45:22,287 [timer://myTimer] INFO  route1
>  - read message xml
> 2016-03-25 14:45:22,287 [timer://myTimer] INFO  route1
>  - starting...
> 2016-03-25 14:45:22,299 [timer://myTimer] INFO  route1
>  - read message xml 
> 2016-03-25 14:45:23,288 [timer://myTimer] INFO  route1
>  - starting...
> 2016-03-25 14:45:24,289 [timer://myTimer] INFO  route1
>  - read message xml
> 2016-03-25 14:45:24,289 [timer://myTimer] INFO  route1
>  - starting...
> 2016-03-25 14:45:25,290 [timer://myTimer] INFO  route1
>  - read message xml
> 2016-03-25 14:45:25,290 [timer://myTimer] INFO  route1
>  - starting...
> 2016-03-25 14:45:26,291 [timer://myTimer] INFO  route1
>  - read message xml
> 
> 
> [Facebook]  [Twitter] 
> 
> 
> [https://www.finansbank.com.tr/Disclaimer/BannerImages.aspx?date=25.03.201614:5300]
> 
> 
> Bu e-posta'n?n i?erdi?i bilgiler (ekleri dahil olmak ?zere) gizlidir. 
> Onay?m?z olmaks?z?n ???nc? ki?ilere a?iklanamaz. Bu mesaj?n g?nderilmek 
> istendi?i ki?i de?ilseniz, l?tfen mesaj? sisteminizden derhal siliniz. IBTech 
> A.?. bu mesaj?n i?erdi?i bilgilerin do?rulu?u veya eksiksiz oldu?u konusunda 
> bir garanti vermemektedir. Bu nedenle bilgilerin ne ?ekilde olursa olsun 
> i?eri?inden, iletilmesinden, al?nmas?ndan, saklanmas?ndan sorumlu de?ildir. 
> Bu mesaj?n i?eri?i yazar?na ait olup, IBTech A.?.'nin g?r??lerini 
> i?ermeyebilir.
> 
> The information contained in this e-mail (including any attachments)is 
> confidential. It must not be disclosed to any person without our authority. 
> If you are not the intended recipient, please delete it from your system 
> immediately. IBTech A.S. makes no warranty as to the accuracy or completeness 
> of any information contained in this message and hereby excludes any 
> liability of any kind for the information contained therein or for the 
> information transmission, reception, storage or use of such in any way 
> whatsoever. Any opinions expressed in this message are those of the author 
> and may not necessarily reflect the opinions of IBTech A.S.


Re: Camel reading file periodically

2016-03-25 Thread Claus Ibsen
Hi

It only reads the file the 1st time, the other times the pollEnrich
cannot find any new file, and it timeout after 1 second, and the Camel
route continue, where you then log an empty message.

If you want to pickup files from a directory, then its better to start
from file instead of using a timer


from file
  log i have a file


Then the route will only trigger if there is a file





On Fri, Mar 25, 2016 at 1:53 PM, Kasim Sert (Ibtech-Software
Infrastructure)  wrote:
> Hi,
>
> Why this route reads file for only one time, and what should I do to make it 
> work like excpected ?
>
> from("timer://myTimer?period=1000")
>  .log("starting...")
> 
> .pollEnrich("file:d:/Workspaces/camel/demo-camel/src/main/resources?fileName=sample.xml&noop=true&readLock=none",1000)
> .log("read message xml ${body}" );
>
>
> Prints:
>
> 2016-03-25 14:45:21,274 [timer://myTimer] INFO  route1
>  - starting...
> 2016-03-25 14:45:22,287 [timer://myTimer] INFO  route1
>  - read message xml
> 2016-03-25 14:45:22,287 [timer://myTimer] INFO  route1
>  - starting...
> 2016-03-25 14:45:22,299 [timer://myTimer] INFO  route1
>  - read message xml 
> 2016-03-25 14:45:23,288 [timer://myTimer] INFO  route1
>  - starting...
> 2016-03-25 14:45:24,289 [timer://myTimer] INFO  route1
>  - read message xml
> 2016-03-25 14:45:24,289 [timer://myTimer] INFO  route1
>  - starting...
> 2016-03-25 14:45:25,290 [timer://myTimer] INFO  route1
>  - read message xml
> 2016-03-25 14:45:25,290 [timer://myTimer] INFO  route1
>  - starting...
> 2016-03-25 14:45:26,291 [timer://myTimer] INFO  route1
>  - read message xml
>
>
> [Facebook]  [Twitter] 
> 
>
> [https://www.finansbank.com.tr/Disclaimer/BannerImages.aspx?date=25.03.201614:5300]
>
>
> Bu e-posta'n?n i?erdi?i bilgiler (ekleri dahil olmak ?zere) gizlidir. 
> Onay?m?z olmaks?z?n ???nc? ki?ilere a?iklanamaz. Bu mesaj?n g?nderilmek 
> istendi?i ki?i de?ilseniz, l?tfen mesaj? sisteminizden derhal siliniz. IBTech 
> A.?. bu mesaj?n i?erdi?i bilgilerin do?rulu?u veya eksiksiz oldu?u konusunda 
> bir garanti vermemektedir. Bu nedenle bilgilerin ne ?ekilde olursa olsun 
> i?eri?inden, iletilmesinden, al?nmas?ndan, saklanmas?ndan sorumlu de?ildir. 
> Bu mesaj?n i?eri?i yazar?na ait olup, IBTech A.?.'nin g?r??lerini 
> i?ermeyebilir.
>
> The information contained in this e-mail (including any attachments)is 
> confidential. It must not be disclosed to any person without our authority. 
> If you are not the intended recipient, please delete it from your system 
> immediately. IBTech A.S. makes no warranty as to the accuracy or completeness 
> of any information contained in this message and hereby excludes any 
> liability of any kind for the information contained therein or for the 
> information transmission, reception, storage or use of such in any way 
> whatsoever. Any opinions expressed in this message are those of the author 
> and may not necessarily reflect the opinions of IBTech A.S.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Camel reading file periodically

2016-03-25 Thread Kasim Sert (Ibtech-Software Infrastructure)
Hi,

Why this route reads file for only one time, and what should I do to make it 
work like excpected ?

from("timer://myTimer?period=1000")
 .log("starting...")

.pollEnrich("file:d:/Workspaces/camel/demo-camel/src/main/resources?fileName=sample.xml&noop=true&readLock=none",1000)
.log("read message xml ${body}" );


Prints:

2016-03-25 14:45:21,274 [timer://myTimer] INFO  route1 
- starting...
2016-03-25 14:45:22,287 [timer://myTimer] INFO  route1 
- read message xml
2016-03-25 14:45:22,287 [timer://myTimer] INFO  route1 
- starting...
2016-03-25 14:45:22,299 [timer://myTimer] INFO  route1 
- read message xml 
2016-03-25 14:45:23,288 [timer://myTimer] INFO  route1 
- starting...
2016-03-25 14:45:24,289 [timer://myTimer] INFO  route1 
- read message xml
2016-03-25 14:45:24,289 [timer://myTimer] INFO  route1 
- starting...
2016-03-25 14:45:25,290 [timer://myTimer] INFO  route1 
- read message xml
2016-03-25 14:45:25,290 [timer://myTimer] INFO  route1 
- starting...
2016-03-25 14:45:26,291 [timer://myTimer] INFO  route1 
- read message xml


[Facebook]  [Twitter] 


[https://www.finansbank.com.tr/Disclaimer/BannerImages.aspx?date=25.03.201614:5300]


Bu e-posta'n?n i?erdi?i bilgiler (ekleri dahil olmak ?zere) gizlidir. Onay?m?z 
olmaks?z?n ???nc? ki?ilere a?iklanamaz. Bu mesaj?n g?nderilmek istendi?i ki?i 
de?ilseniz, l?tfen mesaj? sisteminizden derhal siliniz. IBTech A.?. bu mesaj?n 
i?erdi?i bilgilerin do?rulu?u veya eksiksiz oldu?u konusunda bir garanti 
vermemektedir. Bu nedenle bilgilerin ne ?ekilde olursa olsun i?eri?inden, 
iletilmesinden, al?nmas?ndan, saklanmas?ndan sorumlu de?ildir. Bu mesaj?n 
i?eri?i yazar?na ait olup, IBTech A.?.'nin g?r??lerini i?ermeyebilir.

The information contained in this e-mail (including any attachments)is 
confidential. It must not be disclosed to any person without our authority. If 
you are not the intended recipient, please delete it from your system 
immediately. IBTech A.S. makes no warranty as to the accuracy or completeness 
of any information contained in this message and hereby excludes any liability 
of any kind for the information contained therein or for the information 
transmission, reception, storage or use of such in any way whatsoever. Any 
opinions expressed in this message are those of the author and may not 
necessarily reflect the opinions of IBTech A.S.


Re: Apache camel. InterceptSendTo doesn't work with bean endpoint

2016-03-25 Thread aturkin
Hello. thank you for your reply!

I tried to use CamelSpringTestSupport and it works. My working example:
public class TestTest extends  CamelSpringTestSupport {
@Override
protected AbstractApplicationContext createApplicationContext() {
return new ClassPathXmlApplicationContext("test-camel.xml");
}
@Override
public boolean isUseAdviceWith(){ return true; }
@Test
public void test() throws Exception{ ...context.start();  } 
}

But I'd like to use annotation. I have found example:

https://github.com/CamelCookbook/camel-cookbook-examples/blob/master/camel-cookbook-testing/src/test/java/org/camelcookbook/examples/testing/advicewith/FixedEndpointEnhancedSpringTest.java
 

I tried to use it in my case but my test didn't passed again:
@RunWith(CamelSpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath:test-camel.xml"})
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
@UseAdviceWith(true)
public class TestTest2  {   
@EndpointInject(ref="requestEP")
ProducerTemplate requestEP;
@EndpointInject(ref="beanEP")
ProducerTemplate beanEP; 
@Autowired
ModelCamelContext context; 
@Test
public void test() throws Exception{

context.getRouteDefinition("testRoute").adviceWith( context , new
AdviceWithRouteBuilder(){
@Override
public void configure() throws Exception {
interceptSendToEndpoint(
beanEP.getDefaultEndpoint().getEndpointUri() ).
to("mock:send").
skipSendToOriginalEndpoint();
}
});
context.start();
TestUtils.waitingFor("Configuration applied", 2000);
MockEndpoint mockEP =
context.getEndpoint("mock:send",MockEndpoint.class);
mockEP.setExpectedCount( 1 );
   
context.createProducerTemplate().sendBody(requestEP.getDefaultEndpoint(),
"Message");
mockEP.assertIsSatisfied();
TestUtils.waitingFor("All rows commited", 2000);
}
}
And I have detected that if I comment string "context.start();" in my first
example I get "Exception" that there are no consumers, but if I comment this
string in my second example, I don't get the same error.
As I understand http://camel.apache.org/spring-testing.html In case using
@UseAdviceWith(true) CamelContexts don't start automatically. What is wrong
and how to make test with annotation corrected?

Thanks,
Andrew





--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-camel-InterceptSendTo-doesn-t-work-with-bean-endpoint-tp5779474p5779704.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Issue with dynamic uri

2016-03-25 Thread Jagannath Naidu
Thanks Claus,

I came here for help after reading this link
http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
.
And I am fairly new to camel, would you mind sharing some/any sample code
for this.
Thank you very much.

On 25 March 2016 at 13:35, Claus Ibsen  wrote:

> If you are stuck on Camel 2.15.x you would need to write some java
> code where you build the uri and use a consumer template to poll. And
> do the enrichment from the java code.
>
>
>
> On Fri, Mar 25, 2016 at 9:02 AM, Jagannath Naidu
>  wrote:
> > Thank you fabrizio.
> >
> > But the issue is with passing dynamic uri to pollenrich.
> >
> > On 25 March 2016 at 13:25, fabrizio.spataro  >
> > wrote:
> >
> >> Hello,
> >>
> >> abstractly dynamic uri can be do it using recipientList + simple
> leanguage
> >>
> >>
> > http://camel.apache.org/content-enricher.html
> > says, you can use something like
> > 
> >   
> >   
> > seda:${header.name}
> >   
> >   
> > 
> >
> > But I am restricted to use 2.15 only
> >
> > example here: http://camel.apache.org/recipient-list.html
> >>
> >> I want to replace this line
> >
> >  > strategyRef="myStrat" timeout="3"/>
> >
> > With something like this
> >
> >  > strategyRef="myStrat" timeout="3"/>
> >
> >
> http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
> > says it is possible with an alternative, but I am still clueless. I am
> > fairly new to camel usage.
> >
> >
> >>
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://camel.465427.n5.nabble.com/Issue-with-dynamic-uri-tp5779689p5779690.html
> >> Sent from the Camel - Users mailing list archive at Nabble.com.
> >>
> >
> >
> >
> > --
> > Thanks & Regards
> >
> > B Jagannath
> > Keen & Able Computers Pvt. Ltd.
> > +919871324006
>
>
>
> --
> Claus Ibsen
> -
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>



-- 
Thanks & Regards

B Jagannath
Keen & Able Computers Pvt. Ltd.
+919871324006


Re: Issue with dynamic uri

2016-03-25 Thread Claus Ibsen
If you are stuck on Camel 2.15.x you would need to write some java
code where you build the uri and use a consumer template to poll. And
do the enrichment from the java code.



On Fri, Mar 25, 2016 at 9:02 AM, Jagannath Naidu
 wrote:
> Thank you fabrizio.
>
> But the issue is with passing dynamic uri to pollenrich.
>
> On 25 March 2016 at 13:25, fabrizio.spataro 
> wrote:
>
>> Hello,
>>
>> abstractly dynamic uri can be do it using recipientList + simple leanguage
>>
>>
> http://camel.apache.org/content-enricher.html
> says, you can use something like
> 
>   
>   
> seda:${header.name}
>   
>   
> 
>
> But I am restricted to use 2.15 only
>
> example here: http://camel.apache.org/recipient-list.html
>>
>> I want to replace this line
>
>  strategyRef="myStrat" timeout="3"/>
>
> With something like this
>
>  strategyRef="myStrat" timeout="3"/>
>
> http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
> says it is possible with an alternative, but I am still clueless. I am
> fairly new to camel usage.
>
>
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Issue-with-dynamic-uri-tp5779689p5779690.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> Thanks & Regards
>
> B Jagannath
> Keen & Able Computers Pvt. Ltd.
> +919871324006



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: Customize the Http Response Code for REST Service

2016-03-25 Thread Claus Ibsen
Hi

Yeah there is also an example in the CiA 2nd ed book

xml

https://github.com/camelinaction/camelinaction2/blob/master/chapter10/servlet-swagger-xml/src/main/resources/camel.xml

and for java

https://github.com/camelinaction/camelinaction2/blob/master/chapter10/undertow-swagger/src/main/java/camelinaction/OrderRoute.java

On Fri, Mar 25, 2016 at 9:00 AM, fabrizio.spataro
 wrote:
> Hello,
>
> I had same problem and i resolve it using "onException tag" to intercept
> validation error and return another http response code
>
> Example DSL:
>
> 
>   
> java.your.exception
> 
> 403
> 
>  true
>
> .
> 
> 
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Customize-the-Http-Response-Code-for-REST-Service-tp5779682p5779691.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2


Re: Issue with dynamic uri

2016-03-25 Thread Jagannath Naidu
Thank you fabrizio.

But the issue is with passing dynamic uri to pollenrich.

On 25 March 2016 at 13:25, fabrizio.spataro 
wrote:

> Hello,
>
> abstractly dynamic uri can be do it using recipientList + simple leanguage
>
>
http://camel.apache.org/content-enricher.html
says, you can use something like

  
  
seda:${header.name}
  
  


But I am restricted to use 2.15 only

example here: http://camel.apache.org/recipient-list.html
>
> I want to replace this line



With something like this



http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
says it is possible with an alternative, but I am still clueless. I am
fairly new to camel usage.


>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Issue-with-dynamic-uri-tp5779689p5779690.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Thanks & Regards

B Jagannath
Keen & Able Computers Pvt. Ltd.
+919871324006


Re: Customize the Http Response Code for REST Service

2016-03-25 Thread fabrizio.spataro
Hello,

I had same problem and i resolve it using "onException tag" to intercept
validation error and return another http response code

Example DSL:


  
java.your.exception

403

 true
   
.







--
View this message in context: 
http://camel.465427.n5.nabble.com/Customize-the-Http-Response-Code-for-REST-Service-tp5779682p5779691.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Issue with dynamic uri

2016-03-25 Thread fabrizio.spataro
Hello,

abstractly dynamic uri can be do it using recipientList + simple leanguage

example here: http://camel.apache.org/recipient-list.html







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


Issue with dynamic uri

2016-03-25 Thread Jagannath Naidu
Hi List,

I have been trying to configure dynamic uri but could not find a relevant
way to complete this task. Below is the problem description.


1. Client 1 posts to ROUTE 1 and waits for a response
2. ROUTE 1 uses pollenrich and polls a queue (SECOND) and gets a specific
message  using selector "head='jagan'".

3. ROUTE 2 and ROUTE 3 are InOnly routes
4. ROUTE 2 sets header head:naidu and sends to queue SECOND
5. ROUTE 3 sets header head:jagan and sends to queue SECOND

6. ROUTE 1 users static uri "activemq:queue:SECOND?selector=head='jagan'"

Problem:
I want this to be dynamic. I want set this dynamically using the exchange
posted by client.

I followed this
http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html.
But I could not find a relevant consumer template working example.  Please
advice.

##
1. ROUTE 1
##
blueprint.xml



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


http://127.0.0.1:1230/qqq?restletMethod=POST"/>
jagan




MyStrat.java

public class MyStrat implements AggregationStrategy {
Logger log = Logger.getLogger(MyStrat.class);
public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
if (oldExchange == null) {
return newExchange;
}
String newBody = newExchange.getIn().getBody(String.class);
log.info("Hello 1" + newBody);
String oldBody = oldExchange.getIn().getBody(String.class);
log.info("hello 2" + oldBody);
newExchange.getIn().setBody(newBody);
log.info("hello 3" + newBody);
return newExchange;
##
ROUTE 2
##
blueprint.xml

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

  http://127.0.0.1:1236/abc?restletMethod=POST"/>

naidu




ROUTE 3

blueprint.xml

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

  http://127.0.0.1:1237/abc?restletMethod=POST"/>

jagan












-- 
Thanks & Regards

B Jagannath
Keen & Able Computers Pvt. Ltd.
+919871324006