我想使用Quarkus将AMQP消息中的Java(以及Kotlin)POJO作为JSON发送给RabbitMQ。
@Path("/amqp")
class TestSource {
@Inject
@Channel("amqpwrite")
lateinit var emitter: Emitter<MonitoringStatusDto>
@POST
@Path("/send")
fun sendMsg() {
val status = MonitoringStatusDto(status = "OK", message = "test amqp write")
emitter.send(status)
}
}
在兔子队列上,消息以base64编码的字节流形式接收。
如何在此处设置标题以将内容类型放入其中? 像TTL这样的标头设置也可能很有趣。