2
votes

Can a message be sent to multiple endpoints from within the send mediator in a proxy service?

This link from the WSO2 ESB Send Mediator documentation says under the Syntax chapter that If the message is to be sent to one or more endpoints, then the following is used:

<send>
    (endpointref | endpoint)+
</send>

where the endpointref token refers to the following:

<endpoint key="name"/>

I've tried to include two endpoints under send, but the second one gets removed automatically when saving the proxy service (inside the Developer Studio or straight in the ESB Stratos interface). I did go to the Synapse page for the Send Mediator to see if they say anything special and their format says:

(endpointref | endpoint)?

Now assuming these characters represent regular expression, ? stands for 0 or 1 times, + is 1 or more times. Did WSO2 implement this extra "one or more endpoints" feature on top of Synapse Send Mediator or is it just a mistake on the documentation pages. If they did, what's the exact syntax to make it work?

Thank you!

3

3 Answers

2
votes

Actually you can use Recipienlist endpoint to send a single message to multiple endpoints. After defining recipient list store taht as localentry and provide that as endpoint key.

2
votes

You can do something like this:

<send>
    <endpoint key="jmsMBendpoint1"/>
    </send>
                                     <send>
                                        <endpoint key="jmsMBendpoint2"/>
                                     </send>

.I have used this approach and is working for me.

0
votes

You can use the clone mediator to send to multiple endpoints with specifying respective endpoints as in the below configuration.

<sequence xmlns="http://ws.apache.org/ns/synapse" name="send_to_all">
   <clone sequential="false">
      <target endpoint="endpoint1"/>
      <target endpoint="endpoint2"/>
      <target endpoint="endpoint3"/>     
   </clone>
   <drop/>
</sequence>