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

Mqtt subtitute library + fix retain topics + fix lose message #4039

Merged
merged 7 commits into from
May 21, 2023

Conversation

mircotamburini
Copy link

  • substitute mqtt library System.Net.Mqtt because stills in beta 0.6.16-beta with a more used MQTTnet Version="4.2.0.706"
    this library is industry used
  • i connect e disconnect broker, not work for retain topic (every time resend all topics)
  • fix sometimes connect and disconnect from broker lose some mqtt message

mircotamburini and others added 6 commits March 8, 2023 21:56
…16-beta with a more used MQTTnet Version="4.2.0.706"

this library is industry used
- i connect e disconnect broker, not work for retain topic (every time resend all topics)
- fix sometimes connect and disconnect from broker lose some mqtt message
Copy link
Member

@sfmskywalker sfmskywalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great work! I think that after a little bit of cleanup we can merge it.

Comment on lines 9 to 10
//using Elsa.Activities.Mqtt.Testing;
//using Elsa.Activities.Mqtt.Testing.Handlers;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove these commented lines?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I deleted in the last p.r.
Not necessary

using Elsa.Activities.Mqtt.Services;
using Elsa.ActivityResults;
using Elsa.Attributes;
using Elsa.Services.Models;


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a couple of blank lines added and two namespaces imported, but I don't see any types from them being used here. Perhaps the changes in this file aren't necessary? I could be wrong, I haven't opened it in an IDE, just asking if you can check to make sure 😄

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I deleted in the last p.r.
Not necessary

var newMessageReceiver = ActivatorUtilities.CreateInstance<MqttClientWrapper>(_serviceProvider, newClient, options);

_receivers.Add(options.GetHashCode(), newMessageReceiver);
_receivers.Add(options.GetHashCode(), new ( DateTime.Now, newMessageReceiver ));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of accessing DateTie.Now directly, it would be better to inject IClock and get the current date from there.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I deleted because not used (take a look new p.r.)

return messageReceiver;
if (_receivers.TryGetValue(options.GetHashCode(), out var messageReceiverDateTime))
{
messageReceiverDateTime.Item1 = DateTime.Now; //Timeout.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of accessing DateTie.Now directly, it would be better to inject IClock and get the current date from there.

@sfmskywalker sfmskywalker merged commit 2748ee6 into elsa-workflows:master May 21, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants