Interface MessagingGraph
- All Superinterfaces:
AutoCloseable, RuntimeType.Api<MessagingConfig>
A graph owns all channels, sources, routes, connectors, and their lifecycle. The topology is mutable only
through its builder and is frozen by MessagingConfig.Builder.build().
Use each builder and its configuration for one graph only; do not reuse them after a build attempt, including
a failed build. This ownership requirement is not enforced by the builder.
-
Method Summary
Modifier and TypeMethodDescriptionstatic MessagingConfig.Builderbuilder()Create a builder for one graph.voidclose()Stop admission, drain admitted work, and close all graph-owned resources.static MessagingGraphCreate a graph from the messaging configuration node.static MessagingGraphcreate(MessagingConfig config) Create a graph from its immutable configuration.static MessagingGraphcreate(Consumer<MessagingConfig.Builder> consumer) Create a graph with customized configuration.<T> Emitter<T> emitter(MessagingChannel<T> channel) Obtain an imperative emitter for a channel owned by this graph.start()Validate and start the complete graph, waiting for outgoing connector startup and incoming connector readiness.Methods inherited from interface RuntimeType.Api
prototypeModifier and TypeMethodDescriptionThe prototype as it was received when creating this runtime object instance.
-
Method Details
-
builder
Create a builder for one graph. The builder must not be reused after a build attempt.- Returns:
- graph builder
-
create
Create a graph with customized configuration.- Parameters:
consumer- messaging configuration builder consumer- Returns:
- messaging graph
-
create
Create a graph from its immutable configuration.- Parameters:
config- messaging configuration- Returns:
- messaging graph
-
create
Create a graph from the messaging configuration node.- Parameters:
config- messaging configuration node- Returns:
- messaging graph
-
start
MessagingGraph start()Validate and start the complete graph, waiting for outgoing connector startup and incoming connector readiness.The core runtime does not impose a startup deadline. ChannelConnection transport configuration may define its own connection or readiness limits. Waiting in this method is interruptible; concurrent
close()cancels startup.- Returns:
- this graph
-
emitter
Obtain an imperative emitter for a channel owned by this graph.- Type Parameters:
T- payload type- Parameters:
channel- channel handle- Returns:
- channel emitter
- Throws:
IllegalArgumentException- if the channel belongs to another graphIllegalStateException- when an emission is attempted while the graph is not running
-
close
void close()Stop admission, drain admitted work, and close all graph-owned resources.When called from a delivery, source task, or connector lifecycle callback owned by this graph, shutdown is handed off so the current task can complete. Such a call returns after initiating shutdown; any eventual failure is recorded and reported to a later waiting caller. A call from any other thread waits for shutdown to complete.
- Specified by:
closein interfaceAutoCloseable- Throws:
MessagingException- if shutdown cannot be initiated, or if a waiting caller observes a managed source failure or shutdown that cannot complete cleanly
-