Class MessagingConfig.BuilderBase<BUILDER extends MessagingConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends MessagingConfig>
- Type Parameters:
BUILDER- type of the builder extending this abstract builderPROTOTYPE- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER, PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER, PROTOTYPE>
- Direct Known Subclasses:
MessagingConfig.Builder
- Enclosing interface:
MessagingConfig
MessagingConfig.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddConnector(MessagingConnector connector) Configured messaging connectors.addConnector(List<? extends MessagingConnector> connector) Configured messaging connectors.addConsumerRegistration(ConsumerRegistration consumerRegistration) Consumer and processor registrations contributing channel outputs.addConsumerRegistrations(List<? extends ConsumerRegistration> consumerRegistrations) Consumer and processor registrations contributing channel outputs.addEmitterRegistration(EmitterRegistration emitterRegistration) Emitter registrations contributing typed producer metadata.addEmitterRegistrations(List<? extends EmitterRegistration> emitterRegistrations) Emitter registrations contributing typed producer metadata.addIncoming(Map<String, ? extends MessagingIncomingConfig> incoming) Incoming channel configurations, keyed by channel name, whose execution settings take precedence over outgoing configurations of the same logical channel.addOutgoing(Map<String, ? extends MessagingOutgoingConfig> outgoing) Outgoing channel configurations, keyed by channel name; their execution settings apply only when the logical channel has no incoming configuration.Positive maximum capacity-wait time, representable in nanoseconds.admissionTimeout(Duration admissionTimeout) Positive maximum capacity-wait time, representable in nanoseconds.<T> BUILDERbatchSink(MessagingChannel<T> source, Consumer<MessageBatch<T>> sink) Add a message batch sink.protected final MessagingConfigbuildPrototype(MessagingConfig.BuilderBase<?, ?> builder) Create a new prototype instance from a builder.channel(MessagingChannel<?> channel) Register a typed channel handle.Clear existing value of admissionTimeout.Clear all connector.Clear all consumerRegistrations.Clear all emitterRegistrations.config()Configuration used to configure this instance.Update builder from configuration (node of this type).Configured messaging connectors.connector(List<? extends MessagingConnector> connector) Configured messaging connectors.booleanService discovery flag forconnector().connectorDiscoverServices(boolean connectorDiscoverServices) Service discovery flag forconnector().Consumer and processor registrations contributing channel outputs.consumerRegistrations(List<? extends ConsumerRegistration> consumerRegistrations) Consumer and processor registrations contributing channel outputs.Emitter registrations contributing typed producer metadata.emitterRegistrations(List<? extends EmitterRegistration> emitterRegistrations) Emitter registrations contributing typed producer metadata.from(MessagingConfig prototype) Update this builder from an existing prototype instance.from(MessagingConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.incoming()Incoming channel configurations, keyed by channel name, whose execution settings take precedence over outgoing configurations of the same logical channel.incoming(Map<String, ? extends MessagingIncomingConfig> incoming) Incoming channel configurations, keyed by channel name, whose execution settings take precedence over outgoing configurations of the same logical channel.<T> BUILDERincomingChannel(MessagingChannel<T> target, IncomingChannel connection) Add an incoming channel connection as a source.intPositive maximum number of admitted messages, including queued and executing deliveries.maxInFlightMessages(int maxInFlightMessages) Positive maximum number of admitted messages, including queued and executing deliveries.intPositive maximum number of waiting callers and open connector reservations.maxPendingAdmissions(int maxPendingAdmissions) Positive maximum number of waiting callers and open connector reservations.intPositive maximum number of messages retained by waiting callers and open connector reservations.maxPendingMessages(int maxPendingMessages) Positive maximum number of messages retained by waiting callers and open connector reservations.<I,O> BUILDER messageProcessor(MessagingChannel<I> source, MessagingChannel<O> target, Function<? super Message<I>, ? extends Message<? extends O>> processor) Add a message processor.<T> BUILDERmessageSink(MessagingChannel<T> source, Consumer<? super Message<T>> sink) Add a message sink.<T> BUILDERmessageSource(MessagingChannel<T> channel, Stream<? extends Message<? extends T>> source) Add a message stream source.outgoing()Outgoing channel configurations, keyed by channel name; their execution settings apply only when the logical channel has no incoming configuration.outgoing(Map<String, ? extends MessagingOutgoingConfig> outgoing) Outgoing channel configurations, keyed by channel name; their execution settings apply only when the logical channel has no incoming configuration.<T> BUILDERoutgoingChannel(MessagingChannel<T> source, OutgoingChannel connection) Add an outgoing channel connection as a required channel output.<I,O> BUILDER payloadProcessor(MessagingChannel<I> source, MessagingChannel<O> target, Function<? super I, ? extends O> processor) Add a payload processor.<T> BUILDERpayloadSink(MessagingChannel<T> source, Consumer<? super T> sink) Add a payload sink.<T> BUILDERpayloadSource(MessagingChannel<T> channel, Stream<? extends T> source) Add a payload stream source.protected voidHandles providers and decorators.intMaximum number of admitted deliveries waiting for execution.queueCapacity(int queueCapacity) Maximum number of admitted deliveries waiting for execution.<T> BUILDERroute(MessagingChannel<T> source, MessagingChannel<T> target) Route each delivery batch unchanged from one channel to another channel of the same type.Service registry used to discover providers and services.serviceRegistry(ServiceRegistry serviceRegistry) Service registry used to discover providers and services.Positive global maximum shutdown and failed-startup rollback time, representable in nanoseconds.shutdownTimeout(Duration shutdownTimeout) Positive global maximum shutdown and failed-startup rollback time, representable in nanoseconds.toString()protected voidValidates required properties.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
channel
Register a typed channel handle.- Parameters:
channel- channel handle- Returns:
- updated builder instance
- Throws:
IllegalArgumentException- if a channel with this name is already registered
-
payloadSource
Add a payload stream source.The built graph owns the stream and closes it on shutdown. A failed build also closes registered streams. A channel can have at most one stream source; explicit multi-source fan-in is not part of this API version. Downstream paths of distinct stream sources must not converge on the same channel.
- Type Parameters:
T- payload type- Parameters:
channel- target channelsource- source stream- Returns:
- updated builder instance
- Throws:
IllegalArgumentException- if the channel already has a stream source
-
messageSource
public <T> BUILDER messageSource(MessagingChannel<T> channel, Stream<? extends Message<? extends T>> source) Add a message stream source.The built graph owns the stream and closes it on shutdown. A failed build also closes registered streams. A channel can have at most one stream source; explicit multi-source fan-in is not part of this API version. Downstream paths of distinct stream sources must not converge on the same channel.
- Type Parameters:
T- payload type- Parameters:
channel- target channelsource- source stream- Returns:
- updated builder instance
- Throws:
IllegalArgumentException- if the channel already has a stream source
-
route
Route each delivery batch unchanged from one channel to another channel of the same type.- Type Parameters:
T- payload type- Parameters:
source- source channeltarget- target channel- Returns:
- updated builder instance
-
payloadProcessor
public <I,O> BUILDER payloadProcessor(MessagingChannel<I> source, MessagingChannel<O> target, Function<? super I, ? extends O> processor) Add a payload processor. The processor is invoked once per batch item in order and its results form one lineage-preserving derived batch. Message metadata is not propagated by a payload processor.- Type Parameters:
I- input payload typeO- output payload type- Parameters:
source- source channeltarget- target channelprocessor- payload processor- Returns:
- updated builder instance
-
messageProcessor
public <I,O> BUILDER messageProcessor(MessagingChannel<I> source, MessagingChannel<O> target, Function<? super Message<I>, ? extends Message<? extends O>> processor) Add a message processor. The processor is invoked once per batch item in order and its results form one lineage-preserving derived batch.- Type Parameters:
I- input payload typeO- output payload type- Parameters:
source- source channeltarget- target channelprocessor- message processor- Returns:
- updated builder instance
-
payloadSink
Add a payload sink.- Type Parameters:
T- payload type- Parameters:
source- source channelsink- payload sink- Returns:
- updated builder instance
-
messageSink
Add a message sink.- Type Parameters:
T- payload type- Parameters:
source- source channelsink- message sink- Returns:
- updated builder instance
-
batchSink
Add a message batch sink.- Type Parameters:
T- payload type- Parameters:
source- source channelsink- message batch sink- Returns:
- updated builder instance
-
incomingChannel
Add an incoming channel connection as a source.The built graph owns the connection and manages its startup, delivery admission, draining, and shutdown. A failed build also closes registered connections.
- Type Parameters:
T- payload type- Parameters:
target- target channelconnection- incoming channel connection- Returns:
- updated builder instance
-
outgoingChannel
Add an outgoing channel connection as a required channel output.The built graph owns the connection and closes it on shutdown. A failed build also closes it.
- Type Parameters:
T- payload type- Parameters:
source- source channelconnection- outgoing channel connection- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends MessagingConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends MessagingConfig>- Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
queueCapacity
Maximum number of admitted deliveries waiting for execution. Zero disables buffering.- Parameters:
queueCapacity- queue capacity- Returns:
- updated builder instance
- See Also:
-
maxPendingAdmissions
Positive maximum number of waiting callers and open connector reservations.- Parameters:
maxPendingAdmissions- maximum pending admissions- Returns:
- updated builder instance
- See Also:
-
maxPendingMessages
Positive maximum number of messages retained by waiting callers and open connector reservations.- Parameters:
maxPendingMessages- maximum pending messages- Returns:
- updated builder instance
- See Also:
-
maxInFlightMessages
Positive maximum number of admitted messages, including queued and executing deliveries.- Parameters:
maxInFlightMessages- maximum in-flight messages- Returns:
- updated builder instance
- See Also:
-
clearAdmissionTimeout
Clear existing value of admissionTimeout.- Returns:
- updated builder instance
- See Also:
-
admissionTimeout
-
shutdownTimeout
Positive global maximum shutdown and failed-startup rollback time, representable in nanoseconds. This does not bound startup or readiness and cannot be overridden by a channel.- Parameters:
shutdownTimeout- shutdown timeout- Returns:
- updated builder instance
- See Also:
-
clearConsumerRegistrations
Clear all consumerRegistrations.- Returns:
- updated builder instance
- See Also:
-
consumerRegistrations
Consumer and processor registrations contributing channel outputs.- Parameters:
consumerRegistrations- registrations- Returns:
- updated builder instance
- See Also:
-
addConsumerRegistrations
Consumer and processor registrations contributing channel outputs.- Parameters:
consumerRegistrations- registrations- Returns:
- updated builder instance
- See Also:
-
addConsumerRegistration
Consumer and processor registrations contributing channel outputs.- Parameters:
consumerRegistration- add single registrations- Returns:
- updated builder instance
- See Also:
-
clearEmitterRegistrations
Clear all emitterRegistrations.- Returns:
- updated builder instance
- See Also:
-
emitterRegistrations
Emitter registrations contributing typed producer metadata.- Parameters:
emitterRegistrations- registrations- Returns:
- updated builder instance
- See Also:
-
addEmitterRegistrations
Emitter registrations contributing typed producer metadata.- Parameters:
emitterRegistrations- registrations- Returns:
- updated builder instance
- See Also:
-
addEmitterRegistration
Emitter registrations contributing typed producer metadata.- Parameters:
emitterRegistration- add single registrations- Returns:
- updated builder instance
- See Also:
-
clearConnector
-
connector
Configured messaging connectors.- Parameters:
connector- configured connectors- Returns:
- updated builder instance
- See Also:
-
addConnector
Configured messaging connectors.- Parameters:
connector- configured connectors- Returns:
- updated builder instance
- See Also:
-
addConnector
Configured messaging connectors.- Parameters:
connector- add single configured connectors- Returns:
- updated builder instance
- See Also:
-
incoming
Incoming channel configurations, keyed by channel name, whose execution settings take precedence over outgoing configurations of the same logical channel. This method replaces all values with the new ones.- Parameters:
incoming- incoming channel configurations- Returns:
- updated builder instance
- See Also:
-
addIncoming
Incoming channel configurations, keyed by channel name, whose execution settings take precedence over outgoing configurations of the same logical channel. This method keeps existing values, then puts all new values into the map.- Parameters:
incoming- incoming channel configurations- Returns:
- updated builder instance
- See Also:
-
outgoing
Outgoing channel configurations, keyed by channel name; their execution settings apply only when the logical channel has no incoming configuration. This method replaces all values with the new ones.- Parameters:
outgoing- outgoing channel configurations- Returns:
- updated builder instance
- See Also:
-
addOutgoing
Outgoing channel configurations, keyed by channel name; their execution settings apply only when the logical channel has no incoming configuration. This method keeps existing values, then puts all new values into the map.- Parameters:
outgoing- outgoing channel configurations- Returns:
- updated builder instance
- See Also:
-
connectorDiscoverServices
Service discovery flag forconnector(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Parameters:
connectorDiscoverServices- whether to enable automatic service discovery- Returns:
- updated builder instance
- See Also:
-
serviceRegistry
Service registry used to discover providers and services. Provide an explicit registry instance to use.If not configured, the
GlobalServiceRegistrywould be used to discover services.- Parameters:
serviceRegistry- service registry to use- Returns:
- updated builder instance
- See Also:
-
queueCapacity
public int queueCapacity()Maximum number of admitted deliveries waiting for execution. Zero disables buffering.- Returns:
- queue capacity
-
maxPendingAdmissions
public int maxPendingAdmissions()Positive maximum number of waiting callers and open connector reservations.- Returns:
- maximum pending admissions
-
maxPendingMessages
public int maxPendingMessages()Positive maximum number of messages retained by waiting callers and open connector reservations.- Returns:
- maximum pending messages
-
maxInFlightMessages
public int maxInFlightMessages()Positive maximum number of admitted messages, including queued and executing deliveries.- Returns:
- maximum in-flight messages
-
admissionTimeout
-
shutdownTimeout
Positive global maximum shutdown and failed-startup rollback time, representable in nanoseconds. This does not bound startup or readiness and cannot be overridden by a channel.- Returns:
- shutdown timeout
-
consumerRegistrations
Consumer and processor registrations contributing channel outputs.- Returns:
- registrations
-
emitterRegistrations
Emitter registrations contributing typed producer metadata.- Returns:
- registrations
-
connector
Configured messaging connectors.- Returns:
- configured connectors
-
incoming
Incoming channel configurations, keyed by channel name, whose execution settings take precedence over outgoing configurations of the same logical channel.- Returns:
- incoming channel configurations
-
outgoing
Outgoing channel configurations, keyed by channel name; their execution settings apply only when the logical channel has no incoming configuration.- Returns:
- outgoing channel configurations
-
connectorDiscoverServices
public boolean connectorDiscoverServices()Service discovery flag forconnector(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Returns:
- whether to enable automatic service discovery
-
serviceRegistry
Service registry used to discover providers and services. Provide an explicit registry instance to use.If not configured, the
GlobalServiceRegistrywould be used to discover services.- Returns:
- service registry to use
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties. -
buildPrototype
Create a new prototype instance from a builder.- Parameters:
builder- builder used to create the prototype- Returns:
- new prototype instance
-
config
-