Skip to content

Inbound Commands

Inbound commands are messages sent from the CritterWatch server to monitored services. All commands implement IServiceMessage and are routed directly to the target service's Wolverine queue.

All commands are automatically handled when AddCritterWatchMonitoring() is called — no additional handler registration is needed.

Command Reference

Dead Letter Queue Commands

ReplayMessages

Replay dead-lettered messages back through the processing pipeline.

csharp
public record ReplayMessages(
    string ServiceName,
    string? MessageType,   // null = all message types
    string? TenantId,      // null = default tenant
    int? MaxCount          // null = all matching messages
);

cs
// Replay all dead-lettered messages of a specific type
await bus.SendAsync(new ReplayMessages(
    ServiceName: "trip-service",
    MessageType: "TripService.Messages.BookTrip"
));

snippet source | anchor

DiscardMessages

Permanently remove dead-lettered messages from the queue.

csharp
public record DiscardMessages(
    string ServiceName,
    string? MessageType,
    string? TenantId,
    int? MaxCount
);

cs
// Permanently discard dead-lettered messages
await bus.SendAsync(new DiscardMessages(
    ServiceName: "trip-service",
    MessageType: null  // null = all message types
));

snippet source | anchor

EditScheduledMessage

Modify a scheduled message before it fires.

csharp
public record EditScheduledMessage(
    string ServiceName,
    Guid EnvelopeId,
    string? UpdatedBody,
    DateTimeOffset? NewExecutionTime,
    string? TenantId
);

Endpoint Commands

PauseListener

Stop processing messages on a specific endpoint.

csharp
public record PauseListener(string ServiceName, string EndpointName);

RestartListener

Resume a paused listener.

csharp
public record RestartListener(string ServiceName, string EndpointName);

PauseAllListeners

Pause all listeners for a service (useful before maintenance).

csharp
public record PauseAllListeners(string ServiceName);

RestartAllListeners

Resume all listeners for a service.

csharp
public record RestartAllListeners(string ServiceName);

UpdateEndpointBufferingLimits

Change the in-memory buffering configuration of an endpoint at runtime.

csharp
public record UpdateEndpointBufferingLimits(
    string ServiceName,
    string EndpointName,
    int? MaximumMessagesToReceive,
    int? MaximumMessageWaitInQueue,
    int? BatchSize
);

UpdateEndpointCircuitBreaker

Change the circuit breaker configuration of an endpoint at runtime.

csharp
public record UpdateEndpointCircuitBreaker(
    string ServiceName,
    string EndpointName,
    double? FailurePercentageThreshold,
    TimeSpan? SamplingPeriod,
    TimeSpan? PauseTime,
    int? SuccessCountBeforeReopening
);

Projection Commands

PauseProjection

Stop an async projection shard.

csharp
public record PauseProjection(string ServiceName, string ShardName);

RestartProjection

Resume a paused projection shard.

csharp
public record RestartProjection(string ServiceName, string ShardName);

RebuildProjection

Reset a projection and rebuild from the beginning of the event stream.

csharp
public record RebuildProjection(string ServiceName, string ShardName);

RewindSubscription

Move a projection's position marker back to a previous point.

csharp
public record RewindSubscription(
    string ServiceName,
    string ShardName,
    long? SequenceFloor,       // specific sequence, or 0 for beginning
    DateTimeOffset? TimestampFloor,  // rewind to nearest sequence for timestamp
    string? TenantId
);

Node Commands

EjectNode

Remove a stale node from the cluster.

csharp
public record EjectNode(string ServiceName, Guid NodeId);

TriggerElection

Force a new leader election.

csharp
public record TriggerElection(string ServiceName);

ClearNodeHistory

Remove historical node records.

csharp
public record ClearNodeHistory(string ServiceName);

Chaos Monkey Commands

EnableChaosMonkey / DisableChaosMonkey

Arm or disarm the chaos monkey on a service.

SetChaosFailureRate

Set the handler failure rate (0.0–1.0).

SetChaosSlowHandlerRate

Set the slow handler rate and delay duration.

SetChaosProjectionFailureRate

Set the projection processing failure rate.

See Chaos Monkey for full documentation.


Tenant Commands

AddTenant / RemoveTenant / EnableTenant / DisableTenant

Manage tenant databases at runtime.

RequestTenantList

Ask the service to publish its current tenant list.

See Multi-Tenancy for full documentation.


Data Request Commands

RequestAgentHealthReport

Ask the service to immediately report agent health (bypassing the 60-second timer).

csharp
public record RequestAgentHealthReport(string ServiceName);

RequestHandlerSourceCode

Ask the service to send the generated source code for a specific handler.

csharp
public record RequestHandlerSourceCode(
    string ServiceName,
    string MessageTypeName
);

PushAgentThresholds

Send updated alert thresholds to the service for client-side validation.

csharp
public record PushAgentThresholds(
    string ServiceName,
    AgentThresholds Thresholds
);

Released under the MIT License.