Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/jsbxyyx/rmq-transaction
- Owner: jsbxyyx
- License: apache-2.0
- Created: 2023-09-21T04:11:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-17T09:40:52.000Z (6 months ago)
- Last Synced: 2024-10-04T13:03:05.400Z (about 1 month ago)
- Topics: rocketmq, spring, spring-boot, transaction
- Language: Java
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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-SNAPSHOTCREATE 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();
}
```