Possible issue in Message.cs
mjwills opened this issue · comments
Matthew Wills commented
I am very new to this codebase, but this code seems odd to me in Message.cs:
/// <summary>
/// Try to show the payload as decoded to UTF-8.
/// </summary>
/// <returns>The decoded payload as string.</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("Magic: ");
sb.Append(this.Magic);
if (this.Magic == 1)
{
sb.Append(", Attributes: ");
sb.Append(this.Attributes);
}
sb.Append(", topic: ");
try
{
sb.Append(Encoding.UTF8.GetString(this.Payload));
}
catch (Exception)
{
sb.Append("n/a");
}
return sb.ToString();
}
Specifically the code that inserts topic: {payload} . (i.e. the label implies it is the topic, but in fact it shows the payload not the topic).