apache/beam · error · IOException
SolaceIO.Write: Could not create producer, producer object…
Error message
SolaceIO.Write: Could not create producer, producer object is null
What it means
JcsmpSessionService.createXMLMessageProducer retries the JCSMP session's getMessageProducer call (retrying on JCSMPException), but if the retry manager still returns null the service throws this IOException. A null producer means the session never produced a usable message producer, so writes cannot proceed.
Solutions
- Check broker connectivity: verify host, port (55455/55443), message VPN, and client credentials in JcsmpConnectionFactory/SolaceIO config.
- Inspect logs for the underlying JCSMPException retries before the null was returned.
- Increase the retry attempts/backoff in the retryCallableManager to tolerate broker reconnect windows.
- Ensure the session is explicitly connected (jcsmpSession.connect()) before producer creation in custom setups.
Example fix
// before JCSMPProperties props = JCSMPProperties.fromProperties(basicProps); // missing VPN // after props.setProperty(JCSMPProperties.VPN_NAME, "my_vpn"); props.setProperty(JCSMPProperties.HOST, "tcp://broker:55455");
Defensive patterns
Strategy: retry
Validate before calling
// Pre-flight session connectivity check // JCSMPSession s = JCSMPFactory.onlyInstance().createSession(props); s.connect(); s.close();
Try / catch
try { pipeline.run(); }
catch (IOException e) {
if (e.getMessage().contains("Could not create producer")) reconnectAndRetry();
else throw e;
} Prevention
- Validate JCSMPProperties (host, VPN, username/password) with a standalone connect test.
- Size the producer-creation retry budget/backoff for broker reconnect latency.
- Monitor Solace broker health/connections; network drops to port 55455 are the usual culprit.
When it happens
Trigger: Creating a SolaceIO.Write producer when the JCSMP session is not connected / reconnecting, the retryCallable exhausted its retries on repeated JCSMPException, or the callable swallowed the exception and returned null.
Common situations: Wrong broker host/message VPN/credentials causing connection failure; session disconnected between connect and producer creation; network partition to port 55455; retry budget too small for slow broker recovery.
Understand the failure class
Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.
Related errors
- Channel closed prematurely.
- : closing producer after unrecoverable error. The work…
- couldn't connect to docker
- Error connecting to JMS
- error connecting to job server at
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/d920a616fd3810b5.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/java/io/solace/src/main/java/org/apache/beam/sdk/io/solace/broker/JcsmpSessionService.java:136
}
private MessageProducer createXMLMessageProducer(SubmissionMode submissionMode)
throws JCSMPException, IOException {
if (jcsmpSession == null) {
connectWriteSession(submissionMode);
}
@SuppressWarnings("nullness")
Callable<XMLMessageProducer> initProducer =
() ->
Objects.requireNonNull(jcsmpSession)
.getMessageProducer(new PublishResultHandler(publishedResultsQueue));
XMLMessageProducer producer =
retryCallableManager.retryCallable(initProducer, ImmutableSet.of(JCSMPException.class));
if (producer == null) {
throw new IOException("SolaceIO.Write: Could not create producer, producer object is null");
}
return new SolaceMessageProducer(producer);
}
private MessageReceiver createFlowReceiver() throws JCSMPException, IOException {
Queue queue = checkStateNotNull(queue(), "SolaceIO.Read: Queue is not set.");
ConsumerFlowProperties flowProperties = new ConsumerFlowProperties();
flowProperties.setEndpoint(queue);
flowProperties.setAckMode(JCSMPProperties.SUPPORTED_MESSAGE_ACK_CLIENT);
EndpointProperties endpointProperties = new EndpointProperties();
endpointProperties.setAccessType(EndpointProperties.ACCESSTYPE_NONEXCLUSIVE);
if (jcsmpSession != null) {
return new SolaceMessageReceiver(
createFlowReceiver(jcsmpSession, flowProperties, endpointProperties));
}
throw new IOException(View on GitHub (pinned to 12126d8942)