Skip to content

Instantly share code, notes, and snippets.

@sergeyshaykhullin
Created March 19, 2019 21:44
Show Gist options
  • Save sergeyshaykhullin/bca8964c0ebbd5a8737a559bcb0287e3 to your computer and use it in GitHub Desktop.
Save sergeyshaykhullin/bca8964c0ebbd5a8737a559bcb0287e3 to your computer and use it in GitHub Desktop.
Byte is not valid for arguments
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