Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Remove filter from message printing #310

Merged
merged 2 commits into from
Jun 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,16 @@ public void Destroy()

public void Receive(Message received_message)
{
if(received_message.Properties["source"] == "sensor")
if (received_message != null)
{
Console.WriteLine("Printer Module received message from Sensor. Content: " + System.Text.Encoding.UTF8.GetString(received_message.Content, 0, received_message.Content.Length));
string messageData = System.Text.Encoding.UTF8.GetString(received_message.Content, 0, received_message.Content.Length);
Console.WriteLine("{0}> Printer module received message: {1}", DateTime.Now.ToLocalTime(), messageData);

int propCount = 0;
foreach (var prop in received_message.Properties)
{
Console.WriteLine("\tProperty[{0}]> Key={1} : Value={2}", propCount++, prop.Key, prop.Value);
}
}
}
}
Expand Down