Hi,

I don't think there's a "correct" way of doing things. It's just a matter
of usability vs time invested. As an example, we started by wrapping a
proprietary Java API inside a camel processor and just recently we went all
in by writing a custom camel endpoint for it.

That being said, if magento talks REST over HTTP I'd definitely start by
using the http4 camel component instead of writing custom beans.

Cheers ,
Giovanni

Il mar 14 feb 2017, 19:23 Erol <[email protected]> ha scritto:

> Hello
>
> I'm building a simple app to connect filesystem with magento (using rest
> API). I have 2 flows:
>
> - read stock.txt -> parse stock -> send updated stock to magento
> - read periodically orders from magento -> map to object -> write file to
> orders.xml
>
> How I currently solve this is:
>
> - use file component to read stock.txt -> bindy to parse csv -> bean to
> update magento
> - timer with period -> bean to read orders -> xml marshal -> use file
> component to write
>
> This works, but I feel like it's not correct. My next goal is to replace
> magento beans with magento endpoint. So I can write
>
> - use file component to read stock.txt -> bindy to parse csv -> to endpoint
> magento with method updatestock
> - from magento orders read periodically -> xml marshal -> file component to
> write
>
> The flow looks much more clear. But is this correct way?
>
> If I implement this as an endpoint, then if I want to support all methods
> (magento rest calls) in Producer and Consumer, code becomes huge and it's
> not nicely separated as with beans. But on the other hand, it looks more
> correct from flow point-of-view. Other idea is to have multiple endpoints
> (magento-orders, magento-stocks, ..).
>
> What is the correct way to implement this?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Implementing-custom-endpoint-with-multiple-methods-or-custom-beans-tp5793884.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to