apache/pulsar · error · IllegalArgumentException
BatchSourceConfig does not specify Discovery Trigger ClassNa
Error message
BatchSourceConfig does not specify Discovery Trigger ClassName
What it means
A BatchSourceConfig must name the class that triggers/discoveres batches (discoveryTriggererClassName). validateBatchSourceConfig logs and throws when that field is empty or null, since the batch source has no way to discover records without it.
Source
Thrown at pulsar-functions/utils/src/main/java/org/apache/pulsar/functions/utils/SourceConfigUtils.java:448
mergedConfig.setCustomRuntimeOptions(newConfig.getCustomRuntimeOptions());
}
if (isBatchSource(existingConfig) != isBatchSource(newConfig)) {
throw new IllegalArgumentException("Sources cannot be update between regular sources and batchsource");
}
if (newConfig.getBatchSourceConfig() != null) {
validateBatchSourceConfigUpdate(existingConfig.getBatchSourceConfig(), newConfig.getBatchSourceConfig());
mergedConfig.setBatchSourceConfig(newConfig.getBatchSourceConfig());
}
if (newConfig.getProducerConfig() != null) {
mergedConfig.setProducerConfig(newConfig.getProducerConfig());
}
return mergedConfig;
}
public static void validateBatchSourceConfig(BatchSourceConfig batchSourceConfig) throws IllegalArgumentException {
if (isEmpty(batchSourceConfig.getDiscoveryTriggererClassName())) {
log.error("BatchSourceConfig does not specify Discovery Trigger ClassName");
throw new IllegalArgumentException("BatchSourceConfig does not specify Discovery Trigger ClassName");
}
}
public static Map<String, Object> extractSourceConfig(SourceSpec sourceSpec, String fqfn) {
if (!StringUtils.isEmpty(sourceSpec.getConfigs())) {
TypeReference<HashMap<String, Object>> typeRef =
new TypeReference<HashMap<String, Object>>() {
};
try {
return ObjectMapperFactory.getMapper().reader().forType(typeRef).readValue(sourceSpec.getConfigs());
} catch (IOException e) {
log.error().attr("source", fqfn).exception(e)
.log("Failed to read configs for source");
throw new RuntimeException(e);
}
} else {
return null;
}View on GitHub (pinned to 820761864e)
Solutions
- Set discoveryTriggererClassName to the fully qualified class implementing DiscoveryTriggerer in the batchSourceConfig
- Confirm the triggerer class is packaged in the uploaded archive
- Fix JSON key spelling so the field deserializes correctly
Example fix
// before
"batchSourceConfig":{"batchSize":10}
// after
"batchSourceConfig":{"discoveryTriggererClassName":"org.apache.pulsar.functions.source.batch.builder.PulsarRecordGenerator","batchSize":10} Defensive patterns
Strategy: validation
Validate before calling
if (config.getBatchSourceConfig() != null
&& (config.getBatchSourceConfig().getDiscoveryTriggererClassName() == null
|| config.getBatchSourceConfig().getDiscoveryTriggererClassName().isEmpty())) {
throw new IllegalArgumentException("discoveryTriggererClassName is required in batchSourceConfig");
} Try / catch
try { validateAndExtractDetails(...); } catch (IllegalArgumentException e) { if (e.getMessage().contains("Discovery Trigger ClassName")) { /* set discoveryTriggererClassName and resubmit */ } else { throw e; } } Prevention
- Validate batchSourceConfig JSON against a schema with required discoveryTriggererClassName
- Keep the triggerer class packaged with the connector archive
- Copy known-good batchSourceConfig examples rather than hand-writing them
When it happens
Trigger: validateBatchSourceConfig (invoked from validateAndExtractDetails when batchSourceConfig is present) finds batchSourceConfig.getDiscoveryTriggererClassName() empty/null.
Common situations: batchSourceConfig JSON contains only batchSize or discoveryTriggererConfig but omits discoveryTriggererClassName; typo in the key name; the triggerer class field cleared during config editing.
Understand the failure class
Background: "X is required", "must be set", "cannot be empty": the missing-required-config error family, from Vertex AI project/location to WeChat keys — this error's family across 18 libraries.
Related errors
- Source class %s implements %s but batch source source config
- Batch Configs cannot be found
- BatchSource does not implement the correct interface
- BatchSourceTriggerer does not implement the correct interfac
- error writing discovered task to intermediate topic
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/dcec6feafabe77a8.
Report an issue: GitHub.