Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jsbxyyx/rmq-transaction

Sending message consistency based on RocketMQ
https://github.com/jsbxyyx/rmq-transaction

rocketmq spring spring-boot transaction

Last synced: about 1 month ago
JSON representation

Sending message consistency based on RocketMQ

Awesome Lists containing this project

README

        

# rmq transaction
Sending message consistency based on RocketMQ

# how to use
```


jitpack.io
https://jitpack.io

com.github.jsbxyyx
rmq-transaction
main-SNAPSHOT

CREATE TABLE `tb_mq_msg` (
`id` BIGINT NOT NULL,
`status` VARCHAR(20) NOT NULL COMMENT '事件状态(待发布NEW)',
`mq_template_name` VARCHAR(1000) NOT NULL,
`mq_destination` VARCHAR(1000) NOT NULL,
`mq_timeout` BIGINT NOT NULL,
`mq_delay` VARCHAR(255) NOT NULL,
`payload` TEXT NOT NULL,
`retry_times` INT NOT NULL,
`gmt_create` DATETIME NOT NULL,
`gmt_modified` DATETIME NOT NULL,
PRIMARY KEY (`id`),
KEY `idx_status` (`status`)
) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
```

# samples
```
@Transactional(rollbackFor = Exception.class)
public int addOrder(Order order) {
// ...
RMQHelper.syncSend(rocketMQTemplate, "order:add", new GenericMessage<>(payload, headers));
return order.getId();
}
```