views:

22

answers:

2

I can't really see a difference between a multicasting-router and a static-recipient-list-router. Why would I use one over the other?

According to Mule-2.x user guide

Recipient List

the Recipient list router can be used to send the same event to multiple endpoints over the same endpoint or to implement routing-slip behaviour where the next destination for the event is determined from the event properties or payload. Mule provides an abstract Recipient list implementation org.mule.routing.outbound.AbstractRecipientList that provides a thread-safe base for specialised implementations. Mule also provides a Static recipient list that takes a configured list of endpoints from the current event or statically declared on the endpoint.

 <outbound>
     <static-recipient-list-router>
        <payload-type-filter expectedType="javax.jms.Message"/>
        <recipients>
                <spring:value="jms://orders.queue"/>
                <spring:value="jms://tracking.queue"/>
        </recipients>
     </static-recipient-list-router> </outbound>

Multicasting Router

The Multicasting router can be used to send the same event over multiple endpoints. When using this router care must be taken to configure the correct transformers on the endpoints to handle the event source type.

 <outbound>
     <multicasting-router>
        <jms:endpoint queue="test.queue"
 transformer-refs="StringToJmsMessage"/>
        <http:endpoint host="10.192.111.11"
 transformer-refs="StringToHttpClientRequest"/>
        <tcp:endpoint host="10.192.111.12"
 transformer-refs="StringToByteArray"/>
        <payload-type-filter expectedType="java.lang.String"/>
     </multicasting-router> </outbound>

Remember that care should be taken to ensure that the message being routed is transformed to a format that the endpoint understands.

A: 

This is how I understand these:

The static-recipient-list router will send the payload to each recipient in the order that they are listed. This gives you the ability to modify the payload before proceeding to the next endpoint. This also gives you the ability to stop processing in the event of an error.

The multicast-router sends the same payload to all endpoints at the same time. You will not be able to change the payload for each endpoint. You will not be able to stop other endpoints from processing if one of the endpoints fail.

hoffmandirt
A: 

Straight from the horse's mouth ( Mule in Action, by David Dossot, John D'Emic, p. 98..100

The static-recipient-list router lets you simultaneously send the same message to multiple endpoints. You'll usually use a static recipient list when each endpoint is using the same transport. This is often the case with VM and JMS endpoints.

Use static recipient lists when sending the same message to endpoints using identical transports

The multicasting router is similar to the static recipient list in that it simultaneously sends the same message across a set of outbound endpoints. The difference is that the multicasting router is used when the endpoint list contains different types of transports.

Use the multicasting router when sending the same message to endpoints using different transports

I82Much