DefaultMQProducer defaultMQProducer = new DefaultMQProducer();
defaultMQProducer.setProducerGroup(Constant.operationLogGroup);
defaultMQProducer.setInstanceName(Constant.operationLogInstance);
defaultMQProducer.setNamesrvAddr(Constant.rocketQueneAddr);
try {
defaultMQProducer.start();
defaultMQProducer.send(message);
} catch (Exception e) {
logger.error("produce operation log message error", e);
} finally {
defaultMQProducer.shutdown();
}
时间: 2024-10-12 19:02:59