Package io.bytestreams.exchange.core
package io.bytestreams.exchange.core
Core interfaces and channels for application protocol messaging.
Provides the building blocks for request-response application protocols over any Transport. Three correlation models are supported:
- Lockstep — one in-flight request, positional correlation (pipelined with capacity 1)
- Pipelined — N in-flight requests, strict ordering, positional correlation
- Multiplexed — N in-flight requests, relaxed ordering, explicit ID correlation
Interfaces
Channel— logical messaging channelClientChannel— client-side channel for sending requestsTransport— pluggable I/O transportErrorHandler— handles channel errors
Types
ChannelStatus— channel lifecycle statesErrorContext— structured error informationDuplicateCorrelationIdException— duplicate correlation key
Extension Points
AbstractChannel— base class for building custom channel implementations with managed I/O loops, OTel instrumentation, and lifecycle
Implementations
PipelinedChannel— Transport-backed pipelined client channelMultiplexedChannel— Transport-backed multiplexed client channelSymmetricChannel— bidirectional symmetric channelServerChannel— server-side channel for receiving requestsSocketTransport— TCP socket transport-
— server-side TCP connection acceptor
invalid reference
io.bytestreams.exchange.core.SocketAcceptor
-
ClassDescriptionAbstractChannel<OUT,
IN> Base class forTransport-backed channels with managed I/O loops.Accepts transports from aTransportFactoryand creates channels for each.Strategy for computing the delay between retry attempts.A logical messaging channel between two endpoints.The lifecycle status of aChannel.ClientChannel<REQ,RESP> AChannelthat sends requests and receives correlated responses.ATransportFactorythat creates client-side TCP connections.Thrown when a message's correlation id is already pending.ErrorContext<REQ,RESP> Structured context for a channel error, carrying the cause and any associated request/response.ErrorHandler<REQ,RESP> Handles channel errors.Reads a message from an input stream.Writes a message to an output stream.MultiplexedChannel<REQ,RESP> AClientChannelbacked by aTransportusing ID-based (multiplexed) correlation.MultiplexedChannel.Builder<REQ,RESP> OpenTelemetry constants and helpers.Identifies the traffic direction for a channel, used as an OTel metric attribute.PipelinedChannel<REQ,RESP> AClientChannelbacked by aTransportusing positional (pipelined) correlation.PipelinedChannel.Builder<REQ,RESP> RequestHandler<REQ,RESP> Handles an incoming request by completing the given future with a response.ATransportdecorator that automatically reconnects using aTransportFactorywhen the underlying transport fails.ServerChannel<REQ,RESP> ServerChannel.Builder<REQ,RESP> Builder forServerChannel.ATransportFactorythat accepts incoming TCP connections on aServerSocket.Configures aSocket.AMultiplexedChannelwhere request and response types are the same (T=T), enabling bidirectional symmetric messaging on a single connection.Builder forSymmetricChannel.Pluggable I/O transport that provides input/output streams and connection metadata.Factory for creating newTransportinstances.Callback for inbound messages that could not be correlated to a pending request in aMultiplexedChannel.