Created
March 19, 2019 21:44
-
-
Save sergeyshaykhullin/bca8964c0ebbd5a8737a559bcb0287e3 to your computer and use it in GitHub Desktop.
Byte is not valid for arguments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var f = new ConnectionFactory(); | |
var c = f.CreateConnection("test"); | |
var m = c.CreateModel(); | |
m.QueueDeclare("test_queue"); | |
m.ExchangeDeclare("test_exchange", "direct"); | |
m.QueueBind("test_queue", "test_exchange", "test_queue", new Dictionary<string, object> | |
{ | |
["x-priority"] = (byte)3 // Problem | |
}); | |
m.BasicPublish("test_exchange", "test_queue", m.CreateBasicProperties(), Encoding.UTF8.GetBytes("test message")); | |
var s = new EventingBasicConsumer(m); | |
s.Received += (sender, eventArgs) => Console.WriteLine(Encoding.UTF8.GetString(eventArgs.Body)); | |
m.BasicConsume("test_queue", true, "test_queue_consumer", s); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment