{"record":{"id":"889c91e7f547fe62","repo":"dotnetcore/CAP","slug":"pulsar-message-persisted-failed","errorCode":null,"errorMessage":"pulsar message persisted failed!","messagePattern":"pulsar message persisted failed!","errorType":"exception","errorClass":"PublisherSentFailedException","httpStatus":null,"severity":"error","filePath":"src/DotNetCore.CAP.Pulsar/ITransport.Pulsar.cs","lineNumber":45,"sourceCode":"    public async Task<OperateResult> SendAsync(TransportMessage message)\n    {\n        var producer = await _connectionFactory.CreateProducerAsync(message.GetName());\n\n        try\n        {\n            var headerDic = new Dictionary<string, string?>(message.Headers);\n            headerDic.TryGetValue(PulsarHeaders.PulsarKey, out var key);\n            var pulsarMessage = producer.NewMessage(message.Body.ToArray()!, key, headerDic);\n            var messageId = await producer.SendAsync(pulsarMessage);\n            \n            if (messageId != null)\n            {\n                _logger.LogDebug($\"pulsar topic message [{message.GetName()}] has been published.\");\n\n                return OperateResult.Success;\n            }\n\n            throw new PublisherSentFailedException(\"pulsar message persisted failed!\");\n        }\n        catch (Exception ex)\n        {\n            var wrapperEx = new PublisherSentFailedException(ex.Message, ex);\n\n            return OperateResult.Failed(wrapperEx);\n        }\n    }\n}","sourceCodeStart":27,"sourceCodeEnd":54,"githubUrl":"https://github.com/dotnetcore/CAP/blob/e52b8508e54cdb7a9ce7f9fec03d9ea8ad2710fb/src/DotNetCore.CAP.Pulsar/ITransport.Pulsar.cs#L27-L54","documentation":"A sentinel error thrown by the Pulsar transport's SendAsync when producer.SendAsync returns a null message id, i.e. the broker did not acknowledge the persisted message. The faulty input is the Pulsar message (topic/name, key, headers) being produced; common causes are an unreachable or misconfigured Pulsar broker, missing topic permissions, or producer creation against an invalid topic.","triggerScenarios":"Thrown at src/DotNetCore.CAP.Pulsar/ITransport.Pulsar.cs:45 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the Pulsar broker URL and connectivity (TLS/auth settings in PulsarOptions) from the application host.","Ensure the topic being published to exists and the producer's role has produce permissions on it.","Inspect broker-side logs/exceptions for the real send failure; a null message id is only a symptom of an unacknowledged produce."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e52b8508e54cdb7a9ce7f9fec03d9ea8ad2710fb","analyzedAt":"2026-09-14T14:46:34.677Z","contentChangedAt":"2026-09-14T14:46:34.677Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}