Class MulticastSendingMessageHandler
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.ip.AbstractInternetProtocolSendingMessageHandler
org.springframework.integration.ip.udp.UnicastSendingMessageHandler
org.springframework.integration.ip.udp.MulticastSendingMessageHandler
- All Implemented Interfaces:
- Runnable,- org.reactivestreams.Subscriber<Message<?>>,- Aware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- ApplicationContextAware,- Lifecycle,- Ordered,- ComponentSourceAware,- ExpressionCapable,- Orderable,- IntegrationPattern,- CommonSocketOptions,- NamedComponent,- IntegrationManagement,- ManageableLifecycle,- TrackableComponent,- MessageHandler,- reactor.core.CoreSubscriber<Message<?>>
A 
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.- Since:
- 2.0
- Author:
- Gary Russell, Artem Bilan, Christian Tzolov
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagementIntegrationManagement.ManagementOverrides
- 
Field SummaryFields inherited from class org.springframework.integration.ip.udp.UnicastSendingMessageHandlerlockFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagementMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructorsConstructorDescriptionMulticastSendingMessageHandler(String destinationExpression) Construct MulticastSendingMessageHandler based on the destination SpEL expression to determine the target destination at runtime against requestMessage.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.MulticastSendingMessageHandler(Expression destinationExpression) Construct MulticastSendingMessageHandler based on the destination SpEL expression to determine the target destination at runtime against requestMessage.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidconvertAndSend(Message<?> message) protected DatagramSocketvoidsetLocalAddress(String localAddress) On a multi-homed system, specifies the ip address of the network interface used to communicate.voidsetMinAcksForSuccess(int minAcksForSuccess) If acknowledge = true; how many acks needed for success.voidsetTimeToLive(int timeToLive) Set the underlyingMulticastSockettime to live property.Methods inherited from class org.springframework.integration.ip.udp.UnicastSendingMessageHandlerdoStart, doStop, getAckPort, getComponentType, getSoReceiveBufferSize, getTheSocket, handleMessageInternal, isAcknowledge, onInit, restartAckThread, run, setAckCounter, setLengthCheck, setReliabilityAttributes, setSocket, setSocketAttributes, setSocketCustomizer, setSocketExpression, setSocketExpressionString, setSoReceiveBufferSize, setTaskExecutor, startAckThread, updateAckAddressMethods inherited from class org.springframework.integration.ip.AbstractInternetProtocolSendingMessageHandlergetDestinationAddress, getHost, getPort, getSoSendBufferSize, getSoTimeout, isRunning, setSoSendBufferSize, setSoTimeout, start, stopMethods inherited from class org.springframework.integration.handler.AbstractMessageHandlerhandleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionMethods inherited from class org.springframework.integration.handler.MessageHandlerSupportbuildSendTimer, destroy, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface reactor.core.CoreSubscribercurrentContextMethods inherited from interface org.springframework.integration.support.management.IntegrationManagementgetThisAsMethods inherited from interface org.springframework.integration.support.context.NamedComponentgetBeanName, getComponentName
- 
Constructor Details- 
MulticastSendingMessageHandlerConstructs a MulticastSendingMessageHandler to send data to the multicast address/port.- Parameters:
- address- The multicast address.
- port- The port.
 
- 
MulticastSendingMessageHandlerConstructs 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).- Parameters:
- address- The multicast address.
- port- The port.
- lengthCheck- Enable the lengthCheck option.
 
- 
MulticastSendingMessageHandlerpublic 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.- Parameters:
- 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.
 
- 
MulticastSendingMessageHandlerpublic 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.- Parameters:
- 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.
 
- 
MulticastSendingMessageHandlerConstruct MulticastSendingMessageHandler based on the destination SpEL expression to determine the target destination at runtime against requestMessage.- Parameters:
- destinationExpression- the SpEL expression to evaluate the target destination at runtime. Must evaluate to- String,- URIor- SocketAddress.
- Since:
- 5.0
 
- 
MulticastSendingMessageHandlerConstruct MulticastSendingMessageHandler based on the destination SpEL expression to determine the target destination at runtime against requestMessage.- Parameters:
- destinationExpression- the SpEL expression to evaluate the target destination at runtime. Must evaluate to- String,- URIor- SocketAddress.
- Since:
- 5.0
 
 
- 
- 
Method Details- 
getSocket- Overrides:
- getSocketin class- UnicastSendingMessageHandler
- Throws:
- IOException
 
- 
setMinAcksForSuccesspublic void setMinAcksForSuccess(int minAcksForSuccess) If acknowledge = true; how many acks needed for success.- Parameters:
- minAcksForSuccess- The minimum number of acks that will represent success.
 
- 
setTimeToLivepublic void setTimeToLive(int timeToLive) Set the underlyingMulticastSockettime to live property.- Parameters:
- timeToLive-- MulticastSocket.setTimeToLive(int)
 
- 
setLocalAddressDescription copied from interface:CommonSocketOptionsOn a multi-homed system, specifies the ip address of the network interface used to communicate. For inbound adapters and gateways, specifies the interface used to listed for incoming connections. If omitted, the endpoint will listen on all available adapters. For the UDP multicast outbound adapter specifies the interface to which multicast packets will be sent. For UDP unicast and multicast adapters, specifies which interface to which the acknowledgment socket will be bound. Does not apply to TCP outbound adapters and gateways.- Specified by:
- setLocalAddressin interface- CommonSocketOptions
- Overrides:
- setLocalAddressin class- UnicastSendingMessageHandler
- Parameters:
- localAddress- The local address.
 
- 
convertAndSend- Overrides:
- convertAndSendin class- UnicastSendingMessageHandler
- Throws:
- IOException
- URISyntaxException
 
 
-