queue attributes:类似exchange的属性
name:队列的名字
durable:为true时,broker重新还在
exclusive:为某一个connection所独有的,当此connection 关闭的时候,queue也会被删掉
auto-delete:当没有consumer 订阅到此queue时,此queue会被删掉
arguments:为plugin和broker specific feature使用,用于扩展
queue使用前需先定义,如果定义的queue不存在,则直接创建,如果存在,并且所有的attributes相同,则用原有的,如果有参数不同,则报错406 precondition-failed.
queue name: 255 bytes, UTF-8格式,可以用户指定,也可以让broker帮忙自动生成,只需要定义queue的那么为空字符,通过return 对象能取到生成的queue name
注意,以amq.开头的queue name是broker内部保留的,如果违反会导致channel-level exception with reply code 403 accessed-refused。
queue durability:为true是,保存到disk,否则是transient的,重启broker就消失
Durability of a queue does not make messages thatare routed to that queue durable. If broker is taken downand then brought back up, durable queue will be re-declaredduring broker startup, however, only persistentmessages will be recovered.