Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

Multicast Transport Reference

The http://en.wikipedia.org/wiki/Multicast[Multicast] transport allow sending messages to or receiving messages from groups of multicast sockets. It is implemented on top of UDP and is highly scalable since knowledge of the receivers is not required.

Transport Info

Transport Doc Inbound Outbound Request Transactions Streaming Retries MEPs Default MEP Maven Artifact

Multicast

JavaDoc SchemaDoc

check

check

check

image

image

image

one-way, request-response

request-response

org.mule. transport:mule-transport-multicast

 

Legend

Transport - The name/protocol of the transport
Docs - Links to the JavaDoc and SchemaDoc for the transport
Inbound - Whether the transport can receive inbound events and can be used for an inbound endpoint
Outbound - Whether the transport can produce outbound events and be used with an outbound endpoint
Request - Whether this endpoint can be queried directly with a request call (via MuleClinet or the EventContext)
Transactions - Whether transactions are supported by the transport. Transports that support transactions can be configured in either local or distributed two-phase commit (XA) transaction.
Streaming - Whether this transport can process messages that come in on an input stream. This allows for very efficient processing of large data. For more information, see Streaming.
Retry - Whether this transport supports retry policies. Note that all transports can be configured with Retry policies, but only the ones marked here are officially supported by MuleSoft
MEPs - Message Exchange Patterns supported by this transport
Default MEP - The default MEP for endpoints that use this transport that do not explicitly configure a MEP
Maven Artifact - The group name a artifact name for this transport in Maven

Namespace and Syntax

XML namespace:


         
      
1
xmlns:multicast="http://www.mulesoft.org/schema/mule/multicast"

XML Schema location:


         
      
1
http://www.mulesoft.org/schema/mule/multicast http://www.mulesoft.org/schema/mule/multicast/3.3/mule-multicast.xsd

Connector syntax:


         
      
1
2
3
<multicast:connector name="mcConnector" receiveBufferSize="1024" sendBufferSize="1024"
               timeout="0" keepSendSocketOpen="false" broadcast="false"
               timeToLive="127" loopback="true'/>

Endpoint syntax:
You can define your endpoints 2 different ways:

  1. Prefixed endpoint:

    
                
             
    1
    
    <multicast:inbound-endpoint host="localhost" port="65433"/>
  2. Non-prefixed URI:

    
                
             
    1
    
    <inbound-endpoint address="multicast://localhost:65433"/>

See the sections below for more information.

Considerations

IP Multicasting is a service provided by IP (the internet protocol layer), that allows one-to-many communication. The most common use of IP Multicasting is to send UDP datagrams to multiple sockets located on different systems. Mule supports this with the Multicast transport. Note that, except for the communication being many-to-one instead of one-to-one, the Multicast transport is very similar to the UDP transport and the same considerations should be observed.

As shown in the examples below, the Multicast transport has two purposes:

  • Send messages to a group of IP Multicasting sockets

  • Read messages sent to a group of IP Multicasting sockets

Features

The Multicasting module allows a Mule application both to send and receive IP Multicasting datagrams, and to declaratively customize the following features of IP Multicasting (with the standard name for each feature, where applicable):

  • The timeout for sending or receiving messages (SO_TIMEOUT).

  • Whether to allow sending broadcast messages (SO_BROADCAST).

  • Whether to close a socket after sending a message.

  • The maximum size of messages that can be received.

  • The time to live for the packets that are sent

  • Whether to loop packets back to the local socket

Multicast endpoints can be used in one of two ways:

  • To receive an IP Multicasting datagram, create an inbound Multicast endpoint.

  • To send an IP Multicasting datagram, create an outbound Multicast endpoint.

Usage

To use Multicast endpoints

  • Add the MULE Multicast namespace to your configuration:

    • Define the multicast prefix using xmlns:multicast= http://www.mulesoft.org/schema/mule/multicast"

    • Define the schema location with http://www.mulesoft.org/schema/mule/multicast http://www.mulesoft.org/schema/mule/multicast/3.3/mule-multicast.xsd

  • Define one or more connectors for Multicast endpoints.

    • Create a Multicast connector:

      
                     
                  
      1
      
      <multicast:connector name="multicastConnector"/>
  • Create Multicast endpoints.

    • Datagrams will be received on inbound endpoints. The bytes in the datagram will become the message payload.

    • Datagrams will be sent to outbound endpoints. The bytes in the message payload will become the datagram.

    • Both kinds of endpoints are identified by a host name and a port. The host name, in this case, is one of the standard IP multicast addresses defined http://www.iana.org/assignments/multicast-addresses/multicast-addresses.xml[here]. When a datagram is sent to a multicasting host/port combination, all sockets subscribed to that host/port receive the message.

Multicast endpoints are always one-way.

Example Configurations

Copy datagrams from one port to another in a flow


         
      
1
2
3
4
5
6
7
8
<multicast:connector name="connector"/> ❶
 
<flow name="copy">
    <multicast:inbound-endpoint host="224.0.0.0" port="4444" exchange-pattern="one-way"/> ❷
    <pass-through-router>
        <multicast:outbound-endpoint host="224.0.0.0" port="5555" exchange-pattern="one-way" /> ❸
    </pass-through-router>
</flow>

The connector ❶ uses all default properties. The inbound endpoint ❷ receives multicasting datagrams and copies them to the outbound endpoint ❸, which will copy them to a different multicasting group.

Configuration Options

Multicast Connector attributes

Name Description Default

broadcast

set this to true to allow sending to broadcast ports

false

keepSendSocketOpen

Whether to keep the the socket open after sending a message

false

loopback

Whether to loop messages back to the socket that sent them

false

receiveBufferSize

This is the size of the largest (in bytes) datagram that can be received.

16 Kbytes

sendBufferSize

The size of the network send buffer

16 Kbytes

timeout

the timeout used for both sending and receiving

system default

timeToLive

how long the packet stays active. This is a number between 1 and 225

System default

Configuration Reference

Element Listing

Multicast Transport

The Multicast transport can dispatch Mule events using IP multicasting.

Connector

Inbound endpoint

Attributes of <inbound-endpoint…​>

Name Type Required Default Description

host

string

no

port

port number

no

Child Elements of <inbound-endpoint…​>

Name Cardinality Description

Outbound endpoint

Attributes of <outbound-endpoint…​>

Name Type Required Default Description

host

string

no

port

port number

no

Child Elements of <outbound-endpoint…​>

Name Cardinality Description

Endpoint

Attributes of <endpoint…​>

Name Type Required Default Description

host

string

no

port

port number

no

Child Elements of <endpoint…​>

Name Cardinality Description

Schema

Javadoc API Reference

The Javadoc for this module can be found here:

Maven

The Multicast Module can be included with the following dependency:


         
      
1
2
3
4
5
<dependency>
  <groupId>org.mule.transports</groupId>
  <artifactId>mule-transport-multicast</artifactId>
  <version>3.3.1</version>
</dependency>

Notes

Before Mule 3.1.1, there were two different attributes for setting timeout on Multicast connectors, sendTimeout and receiveTimeout. It was necessary to set them to the same value. Now there is only timeout for either send or receive.