You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by humayun0156 <hu...@gmail.com> on 2013/07/12 23:02:23 UTC

REST best practices

i'm new in camel. i want to design a camel application which sync two
servers. 
server1:
this server send a message to camel application. this message has a HTTP
link which we should download and this downloaded message has another
multiple HTTP link which we should download by HTTP GET request and so on.
Now we aggregate all the downloaded things and send it to server2 HTTP post
request and from the response of post request we should modify some of
server1 resource by PUT request.

so my question is which component should i use in this scenario which
support dynamically picked HTTP uri?

Thanks in advance.



--
View this message in context: http://camel.465427.n5.nabble.com/REST-best-practices-tp5735585.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: REST best practices

Posted by Christian Müller <ch...@gmail.com>.
There is no component which supports this specific requirement. You have to
write your own bean which parse the returned HTML and find the HTTP URI's.
Afterwards you can use the producer template [1] to access this URI's.

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

Best,
Christian
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

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


On Fri, Jul 12, 2013 at 11:02 PM, humayun0156 <hu...@gmail.com> wrote:

> i'm new in camel. i want to design a camel application which sync two
> servers.
> server1:
> this server send a message to camel application. this message has a HTTP
> link which we should download and this downloaded message has another
> multiple HTTP link which we should download by HTTP GET request and so on.
> Now we aggregate all the downloaded things and send it to server2 HTTP post
> request and from the response of post request we should modify some of
> server1 resource by PUT request.
>
> so my question is which component should i use in this scenario which
> support dynamically picked HTTP uri?
>
> Thanks in advance.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/REST-best-practices-tp5735585.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: REST best practices

Posted by humayun0156 <hu...@gmail.com>.
Yes, i've solved my problem. 




--
View this message in context: http://camel.465427.n5.nabble.com/REST-best-practices-tp5735585p5735785.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: REST best practices

Posted by AlanFoster <al...@alanfoster.me>.
Hi,

I imagine your implementation may be able to leverage the enrich enricher[0]
pattern after receiving the initial request - or make use of recipientsList
with in/out MEP and an expression language of your choice to extract out the
required URL if it's dynamic - as suggested by your last line; Then you can
use the splitter[1] pattern to xpath out all of the required links. On the
splitter component you will provide an aggregator, which will aggregate all
of the required downloads together. Then you can perform a simple `to` for
the following notification to the second server.

Hopefully this will help you out. Let me know if I misunderstood your use
case :)

Cheers,
Alan

[0] http://camel.apache.org/content-enricher.html
[1] http://camel.apache.org/splitter.html



--
View this message in context: http://camel.465427.n5.nabble.com/REST-best-practices-tp5735585p5735634.html
Sent from the Camel - Users mailing list archive at Nabble.com.