Skip to content

Issue with identifying messages that have been sent #2260

Description

@dgxhubbard

I am implementing a journal to keep track of messages that have been sent and received.
Each journal entry has a Guid, Id, to uniquely identify the message, and a change type is
RECEIVED or SENT. We compact the journal by matching a RECEIVED with a SENT that has the same
GUID Id, and then removing them from the journal. I am using QOS of 1.

When ApplicationMessageEnqueuedOrDroppedAsync is called we create a user property in the message
that stores the Guid Id. We were hoping to use ClientAcknowledgedPublishPacketAsync to get the user property,
Id, and then write to the journal the RECEIVED entry. However, ClientAcknowledgedPublishPacketAsync provides ClientAcknowledgedPublishPacketEventArgs, which does not have the application message, but provides a packet identifier. From the code it looks like we don't have access to the package identifier until ClientAcknowledgedPublishPacketAsync is called. So I have no way of connecting the journal entry Id, when the message is acknowledged.

We also use InterceptingPublish, which gets the mqtt message, but does not have the package identifier. I looked at InterceptingOutboundPacketAsync but it seems to have the same issue.

Is there something that connects the mqtt message with the packet identifier, or some way to connect the two, because right now I am stuck.

public class JournalEntry
{
public BrokerChangeType ChangeType { get; set; } = default;

 public DateTimeOffset TimeStamp { get; set; } = DateTimeOffset.UtcNow;

 public Guid Id { get; set; } = Guid.NewGuid ();

 public string ClientId { get; set; }

 public string Topic {  get; set; }

 public byte[] Payload { get; set; }

 public int QualityOfServiceLevel { get; set; }

 public bool Retain { get; set; }

}

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions