Skip to content

Message loss with message delivery not guaranteed #277

Description

@satishviswanathan

Description

I have a pulsar client created with a one producer created for a topic and ran a load tests and I could see that few of the messages are lost. In the current implementation is message delivery guaranteed with a publisher confirmation ?

Pulsar broker :

Current version of pulsar is: 4.1.0

Broker Config

broker.conf.txt

Library Version: 4.3.2

Client and Producer code

builder = PulsarClient.Builder()
.Authentication(AuthenticationFactory.Token(TOKEN))
.CheckCertificateRevocation(true)
.ExceptionHandler(new CustomExceptionHandler())
.KeepAliveInterval(new TimeSpan(0, 0, 30))
.RetryInterval(new TimeSpan(0, 0, 2))
.CloseInactiveConnectionsInterval(new TimeSpan(0, 0, 30));
builder.ConnectionSecurity(EncryptionPolicy.EnforceEncrypted)
.ServiceUrl(new Uri($"pulsar+ssl://{pulsarHostName}:6651"))
.TrustedCertificateAuthority(Certificate.GenerateCertificate(certificateOption.Value.Pulsar.Ca))
.VerifyCertificateAuthority(true)
.VerifyCertificateName(false);

_client = builder.Build();
_producer = _client.NewProducer(Schema.ByteArray)
.ProducerName($"{@event}-{Environment.MachineName}")

 .StateChangedHandler(producerStateChanged =>
 {
     var topicName = producerStateChanged.Producer.Topic;
     var state = producerStateChanged.ProducerState;

     _logger.LogDebug(new ApplicationLogMessage
     {
         Message = $"The producer for topic '{topicName}' changed state to '{state}'"
     });
 })
 .Topic($"persistent://global/seed/Test)
 .Create();

Publisher code

var messageId = await producer.Send(new MessageMetadata(), byteArray, CancellationToken.None).ConfigureAwait(false);

Reproduction Steps

The publisher code is exposed via an http end point.

Run a load test

Number of users : 10
Number of iterations : 20

Expected behavior

Expected: 200 Messages to be published.

Actual behavior

There are few messages loss with EntryId and LedgerId returned as negative values

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions