« Return to Thread: Configuring service encapsulation

Re: Configuring service encapsulation

by n4d4br0v1tchk4 :: Rate this Message:

Reply to Author | View in Thread

Hello again,
Thanks for your input, but I think I might have not been completely understood... Here's the situation, even without multicast routers... Basically what I want is this execution:
entry-point-service -> generic-service -> generic-service-component-1 -> generic-service-component-2 -> output-service
Of course that in this case I can chain them all, but if I use multicast routers I can't, so bear with this simplification for making my point.

       <service name="entry-point-service">
            <inbound>
                <stdio:inbound-endpoint system="IN" synchronous="false"/>
            </inbound>
            <outbound>
                <chaining-router>
                <vm:outbound-endpoint path="generic-service-in" synchronous="true"/>
                <vm:outbound-endpoint path="output-service-in"/>
                </chaining-router>
            </outbound>
       </service>
       
       <service name="generic-service">
        <inbound>
        <vm:inbound-endpoint path="generic-service-in" synchronous="true"/>
        </inbound>
        <outbound>
        <chaining-router>
        <vm:outbound-endpoint path="generic-service-component-1"/>
                   <vm:outbound-endpoint path="generic-service-component-2" transformer-refs="ToString"/>
        </chaining-router>
        </outbound>
       </service>
       
        <service name="output-service">
            <inbound>
                <vm:inbound-endpoint path="output-service-in" transformer-refs="ToString"/>
            </inbound>
            <outbound>
                <pass-through-router>
                    <stdio:outbound-endpoint system="OUT"/>
                </pass-through-router>
            </outbound>
        </service>

Both "generic-service-component-1" and "generic-service-component-2" are services with no outbound routers. The services work, I tested them on a simple chaining router.

This configuration throws me an error, because after "generic-service-component-2", the message is unroutable (from the logs). "generic-service" does not reply the result of "generic-service-component-2" back to the "entry-point-service", despite de synchronous tags. So I changed "entry-point-service" oubound router to this:

                <chaining-router>
                <vm:outbound-endpoint path="generic-service-in" synchronous="true"/>
                <reply-to address="vm://output-service-in"/>
                </chaining-router>

Now what happens is that "output-service" is called right after "generic-service-component-1" completes, and "generic-service-component-2" throws an exception because it fails to get the message:
1. Attempted read on closed stream. (java.io.IOException)

What I need is to learn how to write a synchronous service that has a chaining router and at the *end* replies back to the previous service router or to some reply-to address.

Thanks!
João

antoine.borg wrote:
One other thing to focus on - if you're using the multicasting router,
you are sending the same message to each endpoint. Is this router
configured to do so synchronously or asynchronously? If asynchronously,
then you may get any response from either service first.

A

Andrew Perepelytsya wrote:
>
> It could be that you need to strip replyTo headers, a
> message-properties-transformer can help.
>
> Andrew
>
>> On Jun 9, 2009 9:57 AM, "n4d4br0v1tchk4" <n4d4br0v1tchk4@hotmail.com
>> <mailto:n4d4br0v1tchk4@hotmail.com>> wrote:
>>
>>
>> Hi all,
>>
>> I'm trying to set up a configuration for mule that does not appear to be
>> trivial. I've gone through all the messaging style descriptions and
>> tutorials and still haven't figured it out. Basically what I want is
>> to get
>> some "service encapsulation" that I'm not getting.
>>
>> I want to call a number of services using multicast routing and then
>> to have
>> each of them call a number of other services in a chaining-router and
>> then
>> that the resulting message of those chains are returned asynchronously to
>> the reply-to address. But regardless of what I do, the service that is
>> called by the multicasting-router always returns the asynch message
>> when the
>> *first* service in the chain returns, and not when the last one
>> returns...
>>
>> How can I call a series of services in chain so that the asynch message
>> comes from the last service in the chain?
>>
>> Thanks!
>> João
>> --
>> View this message in context:
>> http://www.nabble.com/Configuring-service-encapsulation-tp23947021p23947021.html
>> Sent from the Mule - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> 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_@ricston.com <mailto:antoine.borg@ricston.com> |
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

 « Return to Thread: Configuring service encapsulation