Release Notes
Announcements
// Spring Boot does not support passing tags using headers. As required, tags must be concatenated after the topic in the format oftopicName:tags. No concatenation identifier indicates no tags. String destination = StringUtils.isBlank(tags) ? topic : topic + ":" + tags; // Object message type. SendResult sendResult = rocketMQTemplate.syncSend(destination, MessageBuilder.withPayload(message) .setHeader(MessageConst.PROPERTY_KEYS, "yourKey") // Specify the business key. .build()); System.out.printf("syncSend1 to topic %s sendResult=%s %n", topic, sendResult);
@Service@RocketMQMessageListener(consumerGroup = "${rocketmq.namespace}%${rocketmq.consumer1.group}", // Specify the consumer group in the format of full namespace name%group name.// The full topic name is required. Therefore, concatenate the topic name. You can also set the format yourself: full namespace name%topic name.topic = "${rocketmq.namespace}%${rocketmq.consumer1.topic}",selectorExpression = "${rocketmq.consumer1.subExpression}" // Subscription expression. If it is not configured, all messages are subscribed to.)public class Tag1Consumer implements RocketMQListener<String> {@Overridepublic void onMessage(String message) {System.out.println("Tag1Consumer receive message:" + message);}}
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan