Skip to content

Instantly share code, notes, and snippets.

@zhuqling
Created March 11, 2013 03:54
Show Gist options
  • Save zhuqling/5131791 to your computer and use it in GitHub Desktop.
Save zhuqling/5131791 to your computer and use it in GitHub Desktop.
申请Queue、Exchange,并进行绑定
// 声明Exchange
_chan.ExchangeDeclare(
exchange: ExchangeName,
type: ExchangeType.Direct,
durable: true,
autoDelete: false,
arguments: null
);
// 声明Queue
_chan.QueueDeclare(
queue: QueueName,
durable: true,
exclusive: false,
autoDelete: false,
arguments: null
);
// 绑定Queue和Exchange
_chan.QueueBind(
queue: QueueName,
exchange: ExchangeName,
routingKey: RoutingKeyName
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment