What is the best way to have java components call other services ?

View: New views
4 Messages — Rating Filter:   Alert me  

What is the best way to have java components call other services ?

by karunasri kapu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

We are working on a project that uses Thrift as the client/server protocol, so I have setup an HTTP endpoint to receive the binary encoded thrift requests.  Some of these requests can be entirely processed within a single POJO and return a result to the client.  Some requests will require other services to be invoked to generate the responses.

I have been reading about various ways to have java service components invoke other services including Mule Client calls and Component Bindings.  The Thrift requests are binary streams with the method being invoked provided in the request, so there is no easy way to filter the incoming requests using a filtering router for example.  Standard Thrift processing involves unpacking the request and invoking a local method that matches the method in the request.  Once in the local method I need to make requests of other services.  This makes it impractical to write a custom transport for Thrift since every thrift service has unique encoding, it is much easier to use a generic transport and rely on the auto-generated thrift files for the decoding and invocation of the local methods.

In some cases I may need to make async calls to other services in processing a thrift request since they make take a bit of time to process.  Which of the available methods of service invocation would be best for this ?

Thanks in advance for any advice,
Joel Goldberger

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: What is the best way to have java components call other services ?

by Andrew Perepelytsya :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Re: What is the best way to have java components call other se

by karunasri kapu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Andrew - Is this preferable to implementing the Callable interface and calling other services directly from the Java ?  In some cases the other services I will be calling are also Thrift services, so I will need to connect to them using TCP sockets and send binary streams.

Presumably I can use whatever encoding I like rather than the webrequest/string encodings shown in the example, is that correct ?

- Joel -

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: What is the best way to have java components call other se

by antoine.borg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Infinitely preferable to putting things in code. Having Bindings means
that you can keep all Mule config inside the config file and decouple
the Java code from the Mule config.

HTH

A

Joel Goldberger wrote:

> Andrew - Is this preferable to implementing the Callable interface and calling other services directly from the Java ?  In some cases the other services I will be calling are also Thrift services, so I will need to connect to them using TCP sockets and send binary streams.
>
> Presumably I can use whatever encoding I like rather than the webrequest/string encodings shown in the example, is that correct ?
>
> - Joel -
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>
>
>  
--

Antoine Borg, Senior Consultant | Tel: +32 28 504 696
ricston Ltd., BP 2, 1180 Uccle, Brussels, BELGIUM

See our full schedule of Mule and Android courses:
http://www.ricston.com/courses/schedules/

email: _antoine.borg_@... <mailto:antoine.borg@...> |
blog: blog.ricston.com <http://blog.ricston.com> | web: ricston.com
<http://www.ricston.com/>



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email