T
- the type of object that is expected by the SinkHandler.update(java.lang.String, T, com.diffusiondata.gateway.framework.TopicProperties)
method.
This should match the type that is output by the
payload converter
in use for the
service.public interface HybridHandler<T> extends SinkHandler<T>, StreamingSourceHandler
A hybrid handler is a combination of a sink handler
(in
that it can receive updates from Diffusion topics) and a
streaming source handler
(in that it can also
publish updates back to Diffusion topics). It extends both of these
interfaces.
This type of service is especially useful for transforming data received from Diffusion topics and feeding the transformed data back to other Diffusion topics and may have many uses. It does not necessarily have to interact with any back end system.
A hybrid handler receives updates from the framework via its update
method. A hybrid handler will only receive updates when the service
is in an ACTIVE
state.
A hybrid handler will not receive updates until the
start
method has been called. It will also not
receive updates if the pause
method has been
called and updates will not resume until the resume
method is called. The handler should also not publish updates to
Diffusion via the Publisher
until the start method has been called or
when it has been paused or stopped.
An object that implements this interface must be returned when the
GatewayApplication.addHybrid
method is
called. A different object must be returned for each different service. The
object must implement the update
method to receive updates
from Diffusion.
The handler may also optionally return both sink
service specific properties
via its
SinkHandler.getSinkServiceProperties()
method, and
source service specific properties
via its
SourceHandler.getSourceServiceProperties()
method. If it does not then
defaults will be assumed.
SinkHandler.SinkServiceProperties, SinkHandler.UnsubscriptionReason
SourceHandler.SourceServiceProperties
ServiceHandler.PauseReason, ServiceHandler.ResumeReason
getSinkServiceProperties, onSubscription, onUnsubscription, update, valueType
getSourceServiceProperties
pause, resume, start, stop
Copyright © 2024 DiffusionData Limited. All rights reserved.