java.lang.Object
io.helidon.messaging.Messaging.Builder
- All Implemented Interfaces:
Builder<Messaging.Builder,,Messaging> Supplier<Messaging>
- Enclosing interface:
Messaging
public static final class Messaging.Builder
extends Object
implements Builder<Messaging.Builder,Messaging>
Fluent API builder for
Messaging.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build newMessaginginstance.Configuration needed for configuring connector and their routing.connector(ConnectorFactory connector) Add connector implementingIncomingConnectorFactory,OutgoingConnectorFactoryor both.<PAYLOAD> Messaging.BuilderRegister new emitter and all its channels.<PAYLOAD> Messaging.BuilderRegisterConsumerfor listening every payload coming from upstream.<PAYLOAD,RESULT>
Messaging.Builderprocessor(Channel<PAYLOAD> in, Channel<RESULT> out, Function<? super PAYLOAD, ? extends RESULT> messageFunction) Register a mapping function between two channels.<PAYLOAD,RESULT>
Messaging.Builderprocessor(Channel<PAYLOAD> in, Channel<RESULT> out, ProcessorBuilder<? extends Message<? extends PAYLOAD>, ? extends Message<? extends RESULT>> processorBuilder) RegisterProcessorBuilderfor buildingProcessorto be used isinChannel's subscriber andoutChannel's publisher.<PAYLOAD,RESULT>
Messaging.Builderprocessor(Channel<PAYLOAD> in, Channel<RESULT> out, Processor<? extends Message<? extends PAYLOAD>, ? extends Message<? extends RESULT>> processor) <PAYLOAD> Messaging.Builderpublisher(Channel<PAYLOAD> channel, Flow.Publisher<? extends Message<? extends PAYLOAD>> publisher) RegisterFlow.Publisherto be used for suppliedChannel.<PAYLOAD> Messaging.Builderpublisher(Channel<PAYLOAD> channel, Flow.Publisher<? extends PAYLOAD> publisher, Function<? super PAYLOAD, ? extends Message<? extends PAYLOAD>> wrapper) RegisterFlow.Publisherto be used for suppliedChannel.<PAYLOAD> Messaging.Builderpublisher(Channel<PAYLOAD> channel, PublisherBuilder<? extends Message<? extends PAYLOAD>> publisherBuilder) RegisterPublisherBuilderto be used for construction of the publisher for suppliedChannel.<PAYLOAD> Messaging.Builder<PAYLOAD> Messaging.Builderpublisher(Channel<PAYLOAD> channel, Publisher<? extends PAYLOAD> publisher, Function<? super PAYLOAD, ? extends Message<? extends PAYLOAD>> wrapper) <PAYLOAD> Messaging.Buildersubscriber(Channel<PAYLOAD> channel, Flow.Subscriber<? extends Message<? extends PAYLOAD>> subscriber) RegisterFlow.Subscriberto be used for suppliedChannel.<PAYLOAD> Messaging.Buildersubscriber(Channel<PAYLOAD> channel, Consumer<Multi<? extends Message<? extends PAYLOAD>>> consumer) <PAYLOAD,RESULT>
Messaging.Buildersubscriber(Channel<PAYLOAD> channel, SubscriberBuilder<? extends Message<? extends PAYLOAD>, RESULT> subscriberBuilder) <PAYLOAD> Messaging.Buildersubscriber(Channel<PAYLOAD> channel, Subscriber<? extends Message<? extends PAYLOAD>> subscriber) RegisterSubscriberto be used for suppliedChannel.
-
Method Details
-
config
Configuration needed for configuring connector and their routing.- Parameters:
config- config for connectors and their routes.- Returns:
- this builder
-
connector
Add connector implementingIncomingConnectorFactory,OutgoingConnectorFactoryor both.- Parameters:
connector- connector to add.- Returns:
- this builder
-
emitter
Register new emitter and all its channels.- Type Parameters:
PAYLOAD- message payload type- Parameters:
emitter- to be registered- Returns:
- this builder
-
publisher
public <PAYLOAD> Messaging.Builder publisher(Channel<PAYLOAD> channel, PublisherBuilder<? extends Message<? extends PAYLOAD>> publisherBuilder) RegisterPublisherBuilderto be used for construction of the publisher for suppliedChannel.- Type Parameters:
PAYLOAD- message payload type- Parameters:
channel- to be publisher constructed forpublisherBuilder- to be used for construction of the publisher- Returns:
- this builder
-
publisher
public <PAYLOAD> Messaging.Builder publisher(Channel<PAYLOAD> channel, Publisher<? extends PAYLOAD> publisher, Function<? super PAYLOAD, ? extends Message<? extends PAYLOAD>> wrapper) - Type Parameters:
PAYLOAD- message payload type- Parameters:
channel- to use publisher inpublisher- to publish in supplied channelwrapper- function to be used for raw payload wrapping, if null simpleMessage.of(Object)is used.- Returns:
- this builder
-
publisher
public <PAYLOAD> Messaging.Builder publisher(Channel<PAYLOAD> channel, Flow.Publisher<? extends PAYLOAD> publisher, Function<? super PAYLOAD, ? extends Message<? extends PAYLOAD>> wrapper) RegisterFlow.Publisherto be used for suppliedChannel.- Type Parameters:
PAYLOAD- message payload type- Parameters:
channel- to use publisher inpublisher- to publish in supplied channelwrapper- function to be used for raw payload wrapping, if null simpleMessage.of(Object)is used.- Returns:
- this builder
-
publisher
public <PAYLOAD> Messaging.Builder publisher(Channel<PAYLOAD> channel, Flow.Publisher<? extends Message<? extends PAYLOAD>> publisher) RegisterFlow.Publisherto be used for suppliedChannel.- Type Parameters:
PAYLOAD- message payload type- Parameters:
channel- to use publisher inpublisher- to publish in supplied channel- Returns:
- this builder
-
publisher
public <PAYLOAD> Messaging.Builder publisher(Channel<PAYLOAD> channel, Publisher<? extends Message<? extends PAYLOAD>> publisher) - Type Parameters:
PAYLOAD- message payload type- Parameters:
channel- to use publisher inpublisher- to publish in supplied channel- Returns:
- this builder
-
listener
public <PAYLOAD> Messaging.Builder listener(Channel<PAYLOAD> channel, Consumer<? super PAYLOAD> consumer) RegisterConsumerfor listening every payload coming from upstream. This listener creates unbounded(Long.MAX_VALUE) demand.Messages are automatically acked and unwrapped. Equivalent ofProcessorBuilder.forEach(java.util.function.Consumer).- Type Parameters:
PAYLOAD- message payload type- Parameters:
channel- to use subscriber inconsumer- to consume payloads- Returns:
- this builder
-
subscriber
public <PAYLOAD> Messaging.Builder subscriber(Channel<PAYLOAD> channel, Flow.Subscriber<? extends Message<? extends PAYLOAD>> subscriber) RegisterFlow.Subscriberto be used for suppliedChannel.- Type Parameters:
PAYLOAD- message payload type- Parameters:
channel- to use subscriber insubscriber- to subscribe to supplied channel- Returns:
- this builder
-
subscriber
public <PAYLOAD> Messaging.Builder subscriber(Channel<PAYLOAD> channel, Consumer<Multi<? extends Message<? extends PAYLOAD>>> consumer) - Type Parameters:
PAYLOAD- message payload type- Parameters:
channel- to use subscriber inconsumer- to subscribe to supplied channel- Returns:
- this builder
-
subscriber
public <PAYLOAD,RESULT> Messaging.Builder subscriber(Channel<PAYLOAD> channel, SubscriberBuilder<? extends Message<? extends PAYLOAD>, RESULT> subscriberBuilder) - Type Parameters:
PAYLOAD- message payload typeRESULT- result type- Parameters:
channel- to use subscriber insubscriberBuilder- to subscribe to supplied channel- Returns:
- this builder
-
subscriber
public <PAYLOAD> Messaging.Builder subscriber(Channel<PAYLOAD> channel, Subscriber<? extends Message<? extends PAYLOAD>> subscriber) RegisterSubscriberto be used for suppliedChannel.- Type Parameters:
PAYLOAD- message payload type- Parameters:
channel- to use subscriber insubscriber- to subscribe to supplied channel- Returns:
- this builder
-
processor
public <PAYLOAD,RESULT> Messaging.Builder processor(Channel<PAYLOAD> in, Channel<RESULT> out, Processor<? extends Message<? extends PAYLOAD>, ? extends Message<? extends RESULT>> processor) - Type Parameters:
PAYLOAD- message payload type of in channelRESULT- message payload type of out channel- Parameters:
in-Channelto use suppliedProcessoras subscriber inout-Channelto use suppliedProcessoras publisher inprocessor- to be used between supplied channels- Returns:
- this builder
-
processor
public <PAYLOAD,RESULT> Messaging.Builder processor(Channel<PAYLOAD> in, Channel<RESULT> out, ProcessorBuilder<? extends Message<? extends PAYLOAD>, ? extends Message<? extends RESULT>> processorBuilder) RegisterProcessorBuilderfor buildingProcessorto be used isinChannel's subscriber andoutChannel's publisher.- Type Parameters:
PAYLOAD- message payload type of in channelRESULT- message payload type of out channel- Parameters:
in-Channelto use suppliedProcessoras subscriber inout-Channelto use suppliedProcessoras publisher inprocessorBuilder- to be used between supplied channels- Returns:
- this builder
-
processor
public <PAYLOAD,RESULT> Messaging.Builder processor(Channel<PAYLOAD> in, Channel<RESULT> out, Function<? super PAYLOAD, ? extends RESULT> messageFunction) Register a mapping function between two channels. -
build
Build newMessaginginstance.- Specified by:
buildin interfaceBuilder<Messaging.Builder,Messaging> - Returns:
- new instance of
Messaging
-