Issue with identifying messages that have been sent
- Dominant language
- C#
- Stars
- 5.1k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
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; }
}
Contributor guide
No contributing guide indexed for this repository
Research direction
Trace ApplicationMessageEnqueuedOrDroppedAsync, ClientAcknowledgedPublishPacketAsync, InterceptingPublish, and InterceptingOutboundPacketAsync to understand where the message and packet identifier are available. Determine whether the existing API provides a supported association between them, and document or expose a clear way to identify the acknowledged journal entry if it does not.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100