之前都是使用python给mq的队列中发送消息,其实Rabbit MQ管理界面可以直接添加消息的。
1.在Exchanges 下边有Publish message
2. Publish message下属性的解释
2.1 Routing key
就是交换机和队列的路由规则。
2.2 Delivery mode
是否持久化,1 - Non-persistent,2 - Persistent
2.3 Headers
Headers can have any name. Only long string headers can be set here.
TypeId: 消息体实体类类型 当需要在消费端对应实体类接受时 需要设置该属性 值为对应实体类在项目下的全路径 ${包名.类名}
ContentTypeId: 当__TypeId__为java.util.List时 设置该字段为列表中的实体类类型
2.4 Properties
点击问号:
有效参数解释:
Valid properties are:
content_type : 消息内容的类型 application/json
content_encoding: 消息内容的编码格式 utf-8
priority: 消息的优先级
correlation_id:关联id
reply_to:用于指定回复的队列的名称
expiration: 消息的失效时间
message_id: 消息id
timestamp:消息的时间戳
type:类型
user_id:用户id
app_id:应用程序id
cluster_id: 集群id
2.5 Payload
消息内容(必须是以字符串形式传入)。
3.接收方法入参是对象
4.接收方法入参是List
TypeId 表示是列表。
__ContentTypeId__是实体类类型。
content_type是json对象。
content_encoding是编码类型。