RabbitMQ REST HTTP JSON有效负载 [英] RabbitMQ REST HTTP JSON payload

查看:106
本文介绍了RabbitMQ REST HTTP JSON有效负载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用RabbitMQ HTTP REST客户端将消息发布到队列中.我正在使用以下网址和请求

I am trying to use RabbitMQ HTTP REST client to publish messages into the queue. I am using the following url and request

http://xxxx/api/exchanges/xxxx/exc.notif/publish

{
 "routing_key":"routing.key",
  "payload":{

  },
 "payload_encoding":"string",
 "properties":{
   "headers":{
     "notif_d":"TEST",
     "notif_k": ["example1", "example2"],
     "userModTime":"timestamp"
   }
 }
}

然后从兔子那里得到以下响应:

And getting back from the rabbit the following response:

{"error":"bad_request","reason":"payload_not_string"}

我只设置了一个标头:

Content-Type:application/json

我正在尝试设置

"payload_encoding":"base64",

但是没有帮助.我是兔子的新手,欢迎任何回应.

but it didn't help. I am new to rabbit any response is welcome.

推荐答案

尝试

{
"properties": {
"content-type": "application/json"
},
"routing_key": "testKey",
"payload": "1234",
"payload_encoding": "string"
}

这篇关于RabbitMQ REST HTTP JSON有效负载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆