« Return to Thread: Configuring service encapsulation

Re: Configuring service encapsulation

by n4d4br0v1tchk4 :: Rate this Message:

Reply to Author | View in Thread

Oh, yeah, just to be sure, here is the new part of the configuration with the Printer and Router:

           <outbound>
                <multicasting-router>
                <vm:outbound-endpoint path="generic-service1-in" synchronous="true"/>
                <vm:outbound-endpoint path="generic-service2-in"  synchronous="true"/>
                <reply-to address="vm://aggregator-async" />
                </multicasting-router>
            </outbound>
           
            <async-reply timeout="3000">
                <vm:inbound-endpoint path="aggregator-async" transformer-refs="MessagePrinter" />
                <custom-async-reply-router class="my.package.CustomRouter" />
            </async-reply>


Hey Mario,

I tried your suggestions, but no effect. Meanwhile, I found out my exceptions were just transformers and my debug wrongly handling the exceptions. I have re-added the synchronous=true on the inbound endpoint of the generic-services (i had removed it in one of the attempts to make it work) but with no effect. Anyway, it stays.
Also tried synchronous outbound endpoints at the multicast router and i get the same. In order to find out what the same is, i coded a custom router (CustomRouter) and added a debug transformer (MessagePrinter) to the reply-to inbound endpoint. What happens i can now see it's always the same. Here it is in sequence:

* MessagePrinter receives a org.mule.transport.http.ReleasingInputStream message
* CustomRouter fails to get the 2 expected messages
* MessagePrinter receives a org.mule.transport.http.ReleasingInputStream message
* CustomRouter fails to get the 2 expected messages
* MessagePrinter receives a generic-service1 message
* MessagePrinter receives an equal generic-service1 message from another dispatcher
* CustomRouter identifies both messages as generic-service1 messages but fails since he has no generic-service2 message
* MessagePrinter receives a org.mule.transport.http.ReleasingInputStream message
* CustomRouter fails to get the 2 expected messages
* MessagePrinter receives a generic-service2 message
* MessagePrinter receives an equal generic-service2 message

I dont understand why the CustomRouter does not wait for the generic-service2 message!

I tried different times and sometimes the order changes: the generic-service2 message is received (and correcly processed) first, and generic-service1 message comes late and is ignored by the CustomRouter. This only happens when the outbound endpoints on the multicast router are *not* synchronous - if they are is always generic-service1 message first as you would expect.

Tried to change the enableCorrelation value on the multicasting router with no apparent effect. Also tried the async-reply timeout set to 3 different values (1000, 3000 and 5000) with also no efect.

I think I'm almost there but I really need to get this to work asap :\

Thanks and cheers,
João

Mario Klaver wrote:
Hi João,

Don't give up, you are almost there ;-)

First, I don't know if you made a typo but I miss the synchronous=true on the inbound endpoint of generic-service1.

Second, have you tried to set the synchronous=true on the outbound-endpoints of the multicasting-router? If these are set to synchronous then each endpoint processes the original message sequentially, and the results are collected into a single reply and then sent to the reply-to address. If this works you can go one step further and let the endpoints process the message simultaneously by setting the endpoints to asynchronous (synchronous="false").

Good luck

Mario

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

    http://xircles.codehaus.org/manage_email


 « Return to Thread: Configuring service encapsulation