DotPulsar.Extensions.DependencyInjection adds support for using DotPulsar with the Microsoft.Extensions.DependencyInjection APIs.
License
—
Deps
4
Install Size
—
Vulns
✓ 0
Published
Nov 12, 2025
$ dotnet add package DotPulsar.Extensions.DependencyInjectionEnables easy integration of DotPulsar with the new .NET Generic Host project types.
dotnet add package DotPulsar.Extensions.DependencyInjection
services.AddPulsarOptions().AddPulsarClient();
This will register the IPulsarClient as a singleton in the service collection with the default settings. The settings can be configured using the standard appSettings.json file with the following configuration keys supported.
Pulsar:ServiceUrl - The service URL for the Pulsar cluster.Pulsar:AuthenticateUsingClientCertificate - Authenticate using a client certificate.
Pulsar:AuthenticateUsingClientCertificate:Path - The path to the client certificate.Pulsar:AuthenticateUsingClientCertificate:KeyPath - The path to the client certificate key.Pulsar:AuthenticateUsingClientCertificate:Password - The client certificate password.Pulsar:AuthenticationToken - Authenticate using a token.Pulsar:CheckCertificateRevocation - Specifies whether the certificate revocation list is checked during authentication.Pulsar:ConnectionSecurity - Set connection encryption policy.Pulsar:KeepAliveInterval - The time to wait before sending a 'ping' if there has been no activity on the connection.Pulsar:ListenerName - Set the listener name.Pulsar:RetryInterval - The time to wait before retrying an operation or a reconnect.Pulsar:TrustedCertificateAuthority - Add a trusted certificate authority.Pulsar:VerifyCertificateAuthority - Verify the certificate authority.Pulsar:VerifyCertificateName - Verify the certificate name with the hostname.Pulsar:CloseInactiveConnectionsInterval - The time to wait before closing inactive connections.There are also several overloads to AddPulsarClient that allow for more fine-grained control over the client settings.
This project is licensed under Apache License, Version 2.0.