Initialize C# client

This section introduces some hands-on examples to initialize the Pulsar C# client.

The following example shows how to create a Pulsar C# client connected to localhost.

  1. using DotPulsar;
  2. var client = PulsarClient.Builder().Build();

To create a Pulsar C# client by using the builder, you can specify the following options.

OptionDescriptionDefault
ServiceUrlSet the service URL for the Pulsar cluster.pulsar://localhost:6650
RetryIntervalSet the time to wait before retrying an operation or a reconnection.3s