BrighterCommand / BrighterCommand/Brighter

NoExternalBus() silently discards InboxConfiguration, so a consumer-only process gets no Inbox

Open
#4,335 1 comment 0 reactions 0 assignees View on GitHub
0 - Backlog Bug
Dominant language
C#
Stars
2.5k
Forks
296
Avg merge
1d 11h
Merged PRs (30d)
21

Description

## What happens

`AddConsumers(options => options.InboxConfiguration = new InboxConfiguration(new MsSqlInbox(config)))` does **nothing at all** in a process that registers no producers.

`AddEventBus` passes the inbox only on its two `ExternalBus` arms:

```csharp
// src/Paramore.Brighter.Extensions.DependencyInjection/ServiceCollectionExtensions.cs
:655 if (!hasEventBus) instrumentationBuilder = messagingBuilder.NoExternalBus();
:665 serviceActivatorOptions?.InboxConfiguration); // ExternalBus, FireAndForget
:676 serviceActivatorOptions?.InboxConfiguration); // ExternalBus, RPC
```

`INeedInstrumentation NoExternalBus()` (`CommandProcessorBuilder.cs:226`) **takes no inbox parameter**, so the configuration is dropped. There is no warning.

## Why it matters

**A consumer-only process is the normal shape for a receiver** — it consumes from a broker and registers no producers of its own. That is precisely the case where you want an Inbox, and precisely the case where you silently do not get one.

Measured on a receiver with the Inbox table present and provisioned, with a control:

```text
InboxMessages rows, NO producer registered : 0
InboxMessages rows, WITH a producer registered : 1
```

The table is created, the configuration is accepted, and nothing is ever written. The symptom is "every message is handled twice" with an empty Inbox and no diagnostic.

## Suggested

Either honour the inbox on the `NoExternalBus` path, or emit a warning when `InboxConfiguration.Inbox` is a non-default instance and that path is taken. Even the warning would have saved the investigation this came out of.

## Related

`InboxScope` is inert — see the companion issue. Between them, two of the four arguments to `InboxConfiguration` do nothing in the common case.

Raised from documentation work; a published guide asserted this behaviour and had to be corrected within hours of shipping. The maintainer asked for it to be filed.

Contributor guide

Open the contributing guide

Research direction

Start in src/Paramore.Brighter.Extensions.DependencyInjection/ServiceCollectionExtensions.cs at the NoExternalBus path and compare it with the two ExternalBus arms that pass InboxConfiguration. Then read INeedInstrumentation NoExternalBus() in CommandProcessorBuilder.cs. Done means a consumer-only process either honors a configured Inbox or emits the proposed warning, with behavior covered by an appropriate regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.