public interface ChannelJoinProvider
ChannelJoinProvider can be used to specify the whether or not a channel should be joined.
Normally a TopicOrientedApplication will automatically join a channel if it
finds an EventHandler for a message type that is mapped to the channel in a
service definition. An application may provide a ChannelJoinProvider to override
this behavior.
| Modifier and Type | Method and Description |
|---|---|
TopicOrientedApplication.ChannelJoin |
getChannelJoin(ToaService service,
ToaServiceChannel channel)
Indicates whether or not a channel should be joined.
|
TopicOrientedApplication.ChannelJoin getChannelJoin(ToaService service, ToaServiceChannel channel)
ChannelJoinProvider may return a TopicOrientedApplication.ChannelJoin value
to indicate whether or not a channel should be joined:
Default or null indicates
that the provider has no opinion and will defer to the default behavior of Hornet
or other ChannelJoinProviders
Join indicates that the the channel should
be joined even if there is no EventHandler handler registered for any of the
channel's types. Overriding the default behavior to join a channel should be rare,
since applications should not be attracting messages without handlers or sending
messages on channels other than those that they are mapped to in a service definition.
NoJoin indicates that even if there is a message handler
defined for a type mapped to the channel, that the channel should not be joined.
Otherwise, if there isn't a handler for the message and no ChannelJoinProvider returns a
value, but the channel is preconfigured for the application via DDL configuration then the preconfigured
value for join will be used. In summary, the precendence for determining channel join is as follows:
Default join value.
ChannelJoinProvider returns Join
and another to return NoJoin. The application will fail to
start in such a case.service - The service that defined the channel.channel - The channel.TopicOrientedApplication messaging configurationCopyright © 2016 Neeve Research, LLC. All Rights Reserved.