quarkusio/quarkus · error · DeploymentException

Emitter configuration for channel `${channel}` is different

Error message

Emitter configuration for channel `${channel}` is different than previous configuration : %s

What it means

Quarkus collects all injected Emitters (and channels) at deployment time. If two injection points target the same channel name but declare different EmitterConfiguration (e.g. different buffer sizes or overflow strategies), the build fails because SmallRye Reactive Messaging cannot pick a single consistent configuration for that channel.

Source

Thrown at extensions/smallrye-reactive-messaging/deployment/src/main/java/io/quarkus/smallrye/reactivemessaging/deployment/SmallRyeReactiveMessagingProcessor.java:371

                 * We need to register the invoker's constructor for reflection since it will be called inside smallrye.
                 * We could potentially lift this restriction with some extra CDI bean generation, but it's probably not worth
                 * it
                 */
                reflectiveClass
                        .produce(ReflectiveClassBuildItem.builder(generatedInvokerName).build());
                mediatorConfiguration
                        .setInvokerClass((Class<? extends Invoker>) recorderContext.classProxy(generatedInvokerName));
            } catch (IllegalArgumentException e) {
                throw new DeploymentException(e); // needed to pass the TCK
            }
        }

        for (InjectedEmitterBuildItem it : emitterFields) {
            EmitterConfiguration configuration = it.getEmitterConfig();
            String channel = configuration.name();
            EmitterConfiguration previousConfig = emittersConfigurations.get(channel);
            if (previousConfig != null && !previousConfig.equals(configuration)) {
                throw new DeploymentException(
                        String.format("Emitter configuration for channel `%s` is different than previous configuration : %s",
                                channel, it.getEmitterConfig()));
            }
            emittersConfigurations.put(channel, configuration);
        }
        for (InjectedChannelBuildItem it : channelFields) {
            channelConfigurations.add(it.getChannelConfig());
        }

        // sort the recorder parameters for reproducible bytecode generation
        mediatorConfigurations.sort(Comparator.comparing(QuarkusMediatorConfiguration::getBeanId)
                .thenComparing(QuarkusMediatorConfiguration::getMethodName));
        workerConfigurations.sort(Comparator.comparing(WorkerConfiguration::getClassName)
                .thenComparing(WorkerConfiguration::getMethodName));
        List<EmitterConfiguration> sortedEmitterConfigurations = emittersConfigurations.values().stream()
                .sorted(Comparator.comparing(EmitterConfiguration::name))
                .toList();
        channelConfigurations.sort(Comparator.comparing(c -> c.channelName));

View on GitHub (pinned to e1c734241f)

Solutions

  1. Make all injections of the channel use identical EmitterConfiguration.
  2. Use distinct channel names for different configurations.
  3. Centralize the emitter in one bean and inject that bean elsewhere.
  4. Keep emitter settings aligned with the mp.messaging.outgoing.<channel> config.

Example fix

// before
@Channel("a") @BufferSize(10) Emitter<String> e1;
@Channel("a") @BufferSize(100) Emitter<String> e2;
// after
@Channel("a") @BufferSize(100) Emitter<String> e1;
@Channel("a") @BufferSize(100) Emitter<String> e2;
Defensive patterns

Strategy: validation

Validate before calling

// Search for all injections of a channel and diff their settings before building:
grep -rn '@Channel("my-channel")' src/ --include='*.java' | xargs grep -n '@BufferSize\|@OnOverflow'

Prevention

When it happens

Trigger: Injecting @Channel/@Emitter for the same channel name in multiple beans with conflicting emitter attributes (buffer size, overflow strategy).

Common situations: Two services in the same app injecting the same channel with different @BufferSize/@OverflowOn values; refactoring one injection point while another still holds old settings.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/fe3f58a5ac4f81e0. Report an issue: GitHub.