Skip to content

Conversation

@radcortez
Copy link
Member

@radcortez radcortez commented Oct 29, 2025

The method io.quarkus.smallrye.reactivemessaging.kafka.deployment.SmallRyeReactiveMessagingKafkaProcessor#getChannelPropertyKey is adding quotes to the channel name if the name contains a ., but the channel parameter may already be quoted, causing double quotes.

The channel name coming from annotations is unquoted:

for (AnnotationInstance annotation : discovery.findRepeatableAnnotationsOnMethods(DotNames.OUTGOING)) {
String channelName = annotation.value().asString();
if (!discovery.isKafkaConnector(channelsManagedByConnectors, false, channelName)) {
continue;
}

And the channel name coming from ChannelBuildItem is quoted:

/**
* Normalize the name of a given channel.
*
* Concatenate the channel name with double quotes when it contains dots.
* <p>
* Otherwise, the SmallRye Reactive Messaging only considers the
* text up to the first occurrence of a dot as the channel name.
*
* @param name the channel name.
* @return normalized channel name.
*/
private static String normalizeChannelName(String name) {
return name != null && !name.startsWith("\"") && name.contains(".") ? "\"" + name + "\"" : name;
}

static void produceOutgoingChannel(BuildProducer<ChannelBuildItem> producer, String name) {
String channelName = normalizeChannelName(name);
Optional<String> managingConnector = getManagingConnector(ChannelDirection.OUTGOING, channelName);
if (managingConnector.isPresent()) {
if (isChannelEnabled(ChannelDirection.OUTGOING, channelName)) {
producer.produce(ChannelBuildItem.outgoing(channelName, managingConnector.get()));
}
} else {
producer.produce(ChannelBuildItem.outgoing(channelName, null));
}
}

As a quick fix, I've changed io.quarkus.smallrye.reactivemessaging.kafka.deployment.SmallRyeReactiveMessagingKafkaProcessor#getChannelPropertyKey to handle both styles, but I think we should consider making the name style consistent, which requires some extra work.

@quarkus-bot
Copy link

quarkus-bot bot commented Oct 29, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 5c9d5e8.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should have quoted channel names in the build item. The channel name should only be quoted when actually required.

I'm fine with this change but it would be nice to have a proper fix in the future.

@radcortez
Copy link
Member Author

Yes, I agree. It is used in many places, so to be on the safe side, I did it this way.

I'm happy to provide a proper fix next.

@gsmet gsmet merged commit 23c625b into quarkusio:main Oct 29, 2025
30 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.30 - main milestone Oct 29, 2025
@gsmet gsmet modified the milestones: 3.30 - main, 3.29.1 Nov 5, 2025
@jmartisk jmartisk modified the milestones: 3.29.1, 3.27.1 Nov 5, 2025
@jmartisk jmartisk moved this to 3.27.1 in Backports for 3.27 Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 3.27.1

Development

Successfully merging this pull request may close these issues.

SRMSG00071: Invalid channel configuration

4 participants