I have a message that gets put on an Azure queue:
public class ImportCubeFileMessage : DatasetMessage
{
public ImportCubeFileMessage() : base()
{
}
public ImportCubeFileMessage(string? identPseudonym, string sourceId, int datasetId, int fileImportId)
: base (identPseudonym, sourceId, datasetId, fileImportId)
{
}
}
This message inherits from DatasetMessage
:
public abstract class DatasetMessage : SourceMessage
{
protected DatasetMessage()
{
}
protected DatasetMessage(string? identPseudonym, string sourceId, int datasetId, int fileImportId) : base(identPseudonym, sourceId)
{
DatasetId = datasetId;
FileImportId = fileImportId;
}
public int DatasetId { get; init; } = default!;
public int FileImportId { get; init; } = default!;
}
When the message gets serialized right before it’s put on the queue, all properties have their correct values (IdentPseudonym
, SourceId
and Triggered
are set in SourceMessage
):
However when the message is picked up by a trigger, the FileImportId
property has been set to 0:
I have also confirmed that FileImportId = 0
when the message is on the queue itself, so something happens when the message is passed from the code to the queue. As far as I can tell, DatasetId
and FileImportId
are handled identically in the code, but DatasetId
retains its original value, while FileImportId
does not. Does anyone have any idea what’s happening here? It’s driving me mad.