SpringBoot整合Rabbitmq设置消息请求头

        String str = "{\"origin\":\"BBC\",\"origin_coupon_id\":51,\"name\":\"123\",\"start_time\":1537763820,\"end_time\":1540874220,\"duration\":\"\",\"validity_type\":0,\"type\":1,\"total_cnt\":\"10000\",\"area\":\"\"}";
Message message = MessageBuilder.withBody(str.getBytes())
.setContentType(MessageProperties.CONTENT_TYPE_TEXT_PLAIN)
.setContentEncoding("utf-8")
.setMessageId(UUID.randomUUID()+"")
.build();
rabbitmqTemplate.convertAndSend("COUPON_EXCHANGE","COUPON_QUEUE",message);
上一篇:Java对List进行分页


下一篇:linux查看CPU和内存信息