Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New LastWillAndTestament Builder #117

Merged
merged 5 commits into from
Jan 15, 2024
Merged

New LastWillAndTestament Builder #117

merged 5 commits into from
Jan 15, 2024

Conversation

pglombardo
Copy link
Collaborator

@pglombardo pglombardo commented Jan 11, 2024

Description

This PR adds a new builder class for LastWillAndTestament:

var lwt = new LastWillAndTestamentBuilder()
            .WithTopic("last/will")
            .WithPayload("last will message")
            .WithQualityOfServiceLevel(QualityOfService.AtLeastOnceDelivery)
            .WithContentType("application/text")
            .WithResponseTopic("response/topic")
            .WithCorrelationData(new byte[] { 1, 2, 3, 4, 5 })
            .WithPayloadFormatIndicator(MQTT5PayloadFormatIndicator.UTF8Encoded)
            .WithMessageExpiryInterval(100)
            .WithUserProperty("userPropertyKey", "userPropertyValue")
            .WithWillDelayInterval(1)
            .Build();

        // Setup & Connect the client with LWT
        var options = new HiveMQClientOptions
        {
            LastWillAndTestament = lwt,
        };

        var client = new HiveMQClient(options);
        connectResult = await client.ConnectAsync().ConfigureAwait(false);

Related Issue

Type of Change

  • 📚 Examples / docs / tutorials / dependencies update
  • 🔧 Bug fix (non-breaking change which fixes an issue)
  • 🥂 Improvement (non-breaking change which improves an existing feature)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🔐 Security fix

Checklist

  • I've written tests (if applicable) for all new methods and classes that I created. (rake test)
  • I've added documentation as necessary so users can easily use and understand this feature/fix.

@pglombardo pglombardo added the enhancement New feature or request label Jan 11, 2024
@pglombardo pglombardo added the documentation Improvements or additions to documentation label Jan 15, 2024
@pglombardo pglombardo merged commit 9fc832f into main Jan 15, 2024
5 checks passed
@pglombardo pglombardo deleted the lwt-builder branch January 15, 2024 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant