StellaOps.Router.Transport.Messaging.Server
Router Messaging transport, server side: the gateway request and response queues over a Messaging backend. Install Installing Stella Ops packagesRouter downloads and signaturesnet10.01.0.1-20261117T070237Zdotnet add package StellaOps.
Namespaces
| Namespace | Types |
|---|---|
StellaOps. | 3 |
namespace StellaOps.Router.Transport.Messaging.Server
| Type | Kind | Description |
|---|---|---|
MessagingTransportServer | class | Transport server that receives requests from microservices via StellaOps.Messaging. |
MessagingTransportServerPlugin | class | Plugin for the server side of the Messaging transport, which a gateway serves the request and response queues with. |
MessagingTransportServerServiceCollectionExtensions | class | Extension methods for registering the server side of the messaging transport. |
class MessagingTransportServer
public sealed class MessagingTransportServer : IGatewayMessagingTransportServer, IDisposable
Transport server that receives requests from microservices via StellaOps.Messaging. Used by the Gateway to handle incoming RPC calls.
Members
| Member | Kind | Summary |
|---|---|---|
MessagingTransportServer( | constructor | Initializes a new instance of the MessagingTransportServerclass. |
OnConnectionClosed | event | Event raised when a connection is closed. |
OnEndpointsUpdated | event | Event raised when a microservice replays endpoint metadata after a router resync request. |
OnHeartbeatReceived | event | Event raised when a HEARTBEAT frame is received. |
OnHelloReceived | event | Event raised when a HELLO frame is received. |
OnResponseReceived | event | Event raised when a RESPONSE frame is received. |
Dispose( | method | See IDisposable.. |
GetConnection( | method | Gets a connection by ID. |
SendToMicroserviceAsync( | method | Sends a request frame to a microservice via messaging. |
StartAsync( | method | Starts listening for incoming connections. |
StopAsync( | method | Stops accepting new connections. |
constructor MessagingTransportServer(IMessageQueueFactory, IOptions<MessagingTransportOptions>, ILogger<MessagingTransportServer>, IFrameEnvelopeVerifier, IFrameEnvelopeSigner) #
MessagingTransportServer(IMessageQueueFactory, IOptions<MessagingTransportOptions>, ILogger<MessagingTransportServer>, IFrameEnvelopeVerifier, IFrameEnvelopeSigner) #public MessagingTransportServer(IMessageQueueFactory queueFactory, IOptions<MessagingTransportOptions> options, ILogger<MessagingTransportServer> logger, IFrameEnvelopeVerifier? envelopeVerifier = null, IFrameEnvelopeSigner? envelopeSigner = null)
Initializes a new instance of the MessagingTransportServerclass.
event OnConnectionClosed #
OnConnectionClosed #public event Func<string, Task>? OnConnectionClosed
Event raised when a connection is closed.
event OnEndpointsUpdated #
OnEndpointsUpdated #public event Func<ConnectionState, EndpointsUpdatePayload, Task>? OnEndpointsUpdated
Event raised when a microservice replays endpoint metadata after a router resync request.
event OnHeartbeatReceived #
OnHeartbeatReceived #public event Func<ConnectionState, HeartbeatPayload, Task>? OnHeartbeatReceived
Event raised when a HEARTBEAT frame is received.
event OnHelloReceived #
OnHelloReceived #public event Func<ConnectionState, HelloPayload, Task>? OnHelloReceived
Event raised when a HELLO frame is received.
event OnResponseReceived #
OnResponseReceived #public event Func<ConnectionState, Frame, Task>? OnResponseReceived
Event raised when a RESPONSE frame is received.
method Dispose() #
Dispose() #public void Dispose()
See IDisposable..
method GetConnection(string) #
GetConnection(string) #public ConnectionState? GetConnection(string connectionId)
Gets a connection by ID.
method SendToMicroserviceAsync(string, Frame, CancellationToken) #
SendToMicroserviceAsync(string, Frame, CancellationToken) #public ValueTask SendToMicroserviceAsync(string connectionId, Frame frame, CancellationToken cancellationToken)
Sends a request frame to a microservice via messaging.
method StartAsync(CancellationToken) #
StartAsync(CancellationToken) #public Task StartAsync(CancellationToken cancellationToken)
Starts listening for incoming connections.
Parameters
cancellationToken: Cancellation token.
method StopAsync(CancellationToken) #
StopAsync(CancellationToken) #public Task StopAsync(CancellationToken cancellationToken)
Stops accepting new connections.
Parameters
cancellationToken: Cancellation token.
Remarks
A host can stop the server twice at once, for example its own shutdown and the caller’s StopAsync of a test host. Every caller waits for the one stop, so no caller goes on to dispose the Messaging backend while the processing loops still acknowledge leases.
class MessagingTransportServerPlugin
public sealed class MessagingTransportServerPlugin : IRouterTransportPlugin
Plugin for the server side of the Messaging transport, which a gateway serves the request and response queues with. The client side is MessagingTransportPluginin Stella; both carry the transport name messaging.
Members
| Member | Kind | Summary |
|---|---|---|
MessagingTransportServerPlugin( | constructor | Creates an instance of Messaging. |
DisplayName | property | Gets the human-readable display name for this transport. |
Mode | property | Gets the side of the transport this plugin registers: RouterTransportMode., RouterTransportMode., or RouterTransportMode.. |
TransportName | property | Gets the transport name (e.g., “tcp”, “tls”, “udp”, “rabbitmq”, “inmemory”, “messaging”), shared by the client and the server plugin of one transport. |
Register( | method | Registers transport services into the DI container for the side the context asks for. |
constructor MessagingTransportServerPlugin() #
MessagingTransportServerPlugin() #public MessagingTransportServerPlugin()
Creates an instance of Messaging.
property DisplayName #
DisplayName #public string DisplayName { get; }
Gets the human-readable display name for this transport.
property Mode #
Mode #public RouterTransportMode Mode { get; }
Gets the side of the transport this plugin registers: RouterTransportMode., RouterTransportMode., or RouterTransportMode.. IRouterTransportPlugin.refuses a context that asks for a side outside this value (RouterTransportRegistrationContext.).
property TransportName #
TransportName #public string TransportName { get; }
Gets the transport name (e.g., “tcp”, “tls”, “udp”, “rabbitmq”, “inmemory”, “messaging”), shared by the client and the server plugin of one transport.
method Register(RouterTransportRegistrationContext) #
Register(RouterTransportRegistrationContext) #public void Register(RouterTransportRegistrationContext context)
Registers transport services into the DI container for the side the context asks for.
Parameters
context: The registration context containing services, configuration, and transport mode.
Exceptions
Invalid: The context asks for a side this plugin does not provide.Operation Exception
class MessagingTransportServerServiceCollectionExtensions
public static class MessagingTransportServerServiceCollectionExtensions
Extension methods for registering the server side of the messaging transport.
Members
| Member | Kind | Summary |
|---|---|---|
AddMessagingTransportServer( | extension method | Adds the messaging transport server only (for Gateway). |
extension method AddMessagingTransportServer(IServiceCollection, Action<MessagingTransportOptions>) #
AddMessagingTransportServer(IServiceCollection, Action<MessagingTransportOptions>) #public static IServiceCollection AddMessagingTransportServer(this IServiceCollection services, Action<MessagingTransportOptions>? configure = null)
Adds the messaging transport server only (for Gateway). Requires StellaOps.Messaging services to be registered.
Parameters
services: The service collection.configure: Optional configuration action.
Returns
The service collection for chaining.