Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 648 Bytes

quickstart.md

File metadata and controls

30 lines (23 loc) · 648 Bytes

回目录 下一页

快速入门

发送消息

MessageProducerProvider producer = new MessageProducerProvider();
producer.init();

Message message = producer.generateMessage("your subject");
message.setProperty("key", "value");
//发送延迟消息
//message.setDelayTime(15, TimeUnit.MINUTES);
producer.sendMessage(message);

消费消息

@QmqConsumer(subject = "your subject", consumerGroup = "group")
public void onMessage(Message message){
    //process your message
    String value = message.getStringProperty("key");
}

回目录 下一页