public class MulticastSendingMessageHandler extends UnicastSendingMessageHandler
MessageHandler
implementation that maps a Message into
a UDP datagram packet and sends that to the specified multicast address
(224.0.0.0 to 239.255.255.255) and port.
The only difference between this and its super class is the
ability to specify how many acknowledgments are required to
determine success.logger
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
MulticastSendingMessageHandler(String address,
int port)
Constructs a MulticastSendingMessageHandler to send data to the multicast address/port.
|
MulticastSendingMessageHandler(String address,
int port,
boolean lengthCheck)
Constructs a MulticastSendingMessageHandler to send data to the multicast address/port
and enables setting the lengthCheck option (if set, a length is prepended to the packet and checked
at the destination).
|
MulticastSendingMessageHandler(String address,
int port,
boolean lengthCheck,
boolean acknowledge,
String ackHost,
int ackPort,
int ackTimeout)
Constructs a MulticastSendingMessageHandler to send data to the multicast address/port
and enables setting the acknowledge option, where the destination sends a receipt acknowledgment.
|
MulticastSendingMessageHandler(String address,
int port,
boolean acknowledge,
String ackHost,
int ackPort,
int ackTimeout)
Constructs a MulticastSendingMessageHandler to send data to the multicast address/port
and enables setting the acknowledge option, where the destination sends a receipt acknowledgment.
|
Modifier and Type | Method and Description |
---|---|
protected DatagramSocket |
getSocket() |
void |
setLocalAddress(String localAddress)
On a multi-homed system, specifies the ip address of the network interface used to communicate.
|
void |
setMinAcksForSuccess(int minAcksForSuccess)
If acknowledge = true; how many acks needed for success.
|
void |
setTimeToLive(int timeToLive)
Set the underlying
MulticastSocket time to live property. |
doStart, doStop, getAckPort, getComponentType, getSoReceiveBufferSize, getTheSocket, handleMessageInternal, isAcknowledge, onInit, restartAckThread, run, send, setAckCounter, setReliabilityAttributes, setSocket, setSocketAttributes, setSoReceiveBufferSize, setTaskExecutor, shutDown
getDestinationAddress, getHost, getPort, getSoSendBufferSize, getSoTimeout, isRunning, setSoSendBufferSize, setSoTimeout, start, stop
getOrder, handleMessage, setOrder, setShouldTrack
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getComponentName
public MulticastSendingMessageHandler(String address, int port)
address
- The multicast address.port
- The port.public MulticastSendingMessageHandler(String address, int port, boolean lengthCheck)
address
- The multicast address.port
- The port.lengthCheck
- Enable the lengthCheck option.public MulticastSendingMessageHandler(String address, int port, boolean acknowledge, String ackHost, int ackPort, int ackTimeout)
address
- The multicast address.port
- The port.acknowledge
- Whether or not acknowledgments are required.ackHost
- The host to which acknowledgments should be sent; required if acknowledge is true.ackPort
- The port to which acknowledgments should be sent; required if acknowledge is true.ackTimeout
- How long to wait (milliseconds) for an acknowledgment.public MulticastSendingMessageHandler(String address, int port, boolean lengthCheck, boolean acknowledge, String ackHost, int ackPort, int ackTimeout)
address
- The multicast address.port
- The port.lengthCheck
- Enable the lengthCheck option.acknowledge
- Whether or not acknowledgments are required.ackHost
- The host to which acknowledgments should be sent; required if acknowledge is true.ackPort
- The port to which acknowledgments should be sent; required if acknowledge is true.ackTimeout
- How long to wait (milliseconds) for an acknowledgment.protected DatagramSocket getSocket() throws IOException
getSocket
in class UnicastSendingMessageHandler
IOException
public void setMinAcksForSuccess(int minAcksForSuccess)
minAcksForSuccess
- The minimum number of acks that will represent success.public void setTimeToLive(int timeToLive)
MulticastSocket
time to live property.timeToLive
- MulticastSocket.setTimeToLive(int)
public void setLocalAddress(String localAddress)
CommonSocketOptions
setLocalAddress
in interface CommonSocketOptions
setLocalAddress
in class UnicastSendingMessageHandler
localAddress
- The local address.