All Projects → maihaoche → Rocketmq Spring Boot Starter

maihaoche / Rocketmq Spring Boot Starter

Licence: apache-2.0
Spring Boot starter for RocketMQ

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Rocketmq Spring Boot Starter

Springboot Templates
springboot和dubbo、netty的集成,redis mongodb的nosql模板, kafka rocketmq rabbit的MQ模板, solr solrcloud elasticsearch查询引擎
Stars: ✭ 100 (-58.85%)
Mutual labels:  spring-boot, starter, rocketmq
Matecloud
🔥MateCloud是一款基于Spring Cloud Alibaba的微服务架构。目前已经整合Spring Cloud Alibaba、Spring Security Oauth2、Feign、Dubbo、JetCache、RocketMQ等服务套件,为您的开发保驾护航
Stars: ✭ 412 (+69.55%)
Mutual labels:  spring-boot, rocketmq
Cookbook
🎉🎉🎉JAVA高级架构师技术栈==任何技能通过 “刻意练习” 都可以达到融会贯通的境界,就像烹饪一样,这里有一份JAVA开发技术手册,只需要增加自己练习的次数。🏃🏃🏃
Stars: ✭ 428 (+76.13%)
Mutual labels:  spring-boot, rocketmq
Gwt Boot Modules
GWT Boot: BOMs and POMs, Starters, Dependencies and Parent
Stars: ✭ 38 (-84.36%)
Mutual labels:  spring-boot, starter
Spring Boot Extend
在springboot基础上的扩展项目,快速集成Zookeeper、Dubbo、Apollo、Mybatis多数据源
Stars: ✭ 63 (-74.07%)
Mutual labels:  spring-boot, rocketmq
Xc Spring Cloud Alibaba
spring cloud alibaba(2.2.1最新版)+nacos+dubbo+gateWay+sentinel+rocketmq+(pgsql/mysql8.0的json支持)+ignite集成可用于docker分布式框架+分布式自动化任务+mybatis多数据源+seate+ shardingSphere分布式分库事务解决方案
Stars: ✭ 131 (-46.09%)
Mutual labels:  spring-boot, rocketmq
Springbootexamples
Spring Boot 学习教程
Stars: ✭ 794 (+226.75%)
Mutual labels:  spring-boot, rocketmq
Eshop Soa
EShop基于Dubbo实现SOA服务化拆分,并基于RocketMQ解决了分布式事务(新版SpringBootSOASkeleton)
Stars: ✭ 65 (-73.25%)
Mutual labels:  spring-boot, rocketmq
Whatsmars
Java生态研究(Spring Boot + Redis + Dubbo + RocketMQ + Elasticsearch)🔥🔥🔥🔥🔥
Stars: ✭ 1,389 (+471.6%)
Mutual labels:  spring-boot, rocketmq
Springboot Labs
一个涵盖六个专栏:Spring Boot 2.X、Spring Cloud、Spring Cloud Alibaba、Dubbo、分布式消息队列、分布式事务的仓库。希望胖友小手一抖,右上角来个 Star,感恩 1024
Stars: ✭ 12,804 (+5169.14%)
Mutual labels:  spring-boot, rocketmq
Rocketmq Spring Boot Starter
rocketmq-spring-boot-starter
Stars: ✭ 178 (-26.75%)
Mutual labels:  spring-boot, rocketmq
Microservices Platform
基于SpringBoot2.x、SpringCloud和SpringCloudAlibaba并采用前后端分离的企业级微服务多租户系统架构。并引入组件化的思想实现高内聚低耦合,项目代码简洁注释丰富上手容易,适合学习和企业中使用。真正实现了基于RBAC、jwt和oauth2的无状态统一权限认证的解决方案,面向互联网设计同时适合B端和C端用户,支持CI/CD多环境部署,并提供应用管理方便第三方系统接入;同时还集合各种微服务治理功能和监控功能。模块包括:企业级的认证系统、开发平台、应用监控、慢sql监控、统一日志、单点登录、Redis分布式高速缓存、配置中心、分布式任务调度、接口文档、代码生成等等。
Stars: ✭ 3,274 (+1247.33%)
Mutual labels:  spring-boot
Spring Cloud Rest Tcc
以Spring Cloud Netflix作为服务治理基础, 展示基于tcc思想所实现的分布式事务解决方案
Stars: ✭ 2,562 (+954.32%)
Mutual labels:  spring-boot
Quickperf
QuickPerf is a testing library for Java to quickly evaluate and improve some performance-related properties
Stars: ✭ 231 (-4.94%)
Mutual labels:  spring-boot
Moreco
moreco 是一个能够为小、中、大型项目提供最合适架构的一条龙生态系统。满足项目从小型到中型至大型的衍变过程。从编码到监控至运维都满足、且各种功能都插件化,支持插件间的切换。支持Spring Boot、Spring Cloud、Axon 无缝升级
Stars: ✭ 231 (-4.94%)
Mutual labels:  spring-boot
Schedule Job
基于Spring Boot + Quartz 的分布式任务调度系统
Stars: ✭ 239 (-1.65%)
Mutual labels:  spring-boot
Loc Framework
本项目是完全基于Spring Boot2和Springcloud Finchley所进行了开发的,目的是简化和统一公司内部使用微服务框架的使用方法
Stars: ✭ 238 (-2.06%)
Mutual labels:  spring-boot
Gulp Pug Starter
Frontend development with pleasure. Pug + SCSS version
Stars: ✭ 228 (-6.17%)
Mutual labels:  starter
Spring Petclinic Kotlin
Kotlin version of Spring Petclinic
Stars: ✭ 227 (-6.58%)
Mutual labels:  spring-boot
Mastering Junit5
A comprehensive collection of test examples created with JUnit 5
Stars: ✭ 223 (-8.23%)
Mutual labels:  spring-boot

spring boot starter for RocketMQ Build Status Coverage Status

Maven CentralGitHub release

项目介绍

Rocketmq 是由阿里巴巴团队开发并捐赠给apache团队的优秀消息中间件,承受过历年双十一大促的考验。

你可以通过本项目轻松的集成Rocketmq到你的SpringBoot项目中。 本项目主要包含以下特性

  • [x] 同步发送消息
  • [x] 异步发送消息
  • [x] 广播发送消息
  • [x] 有序发送和消费消息
  • [x] 发送延时消息
  • [x] 消息tag和key支持
  • [x] 自动序列化和反序列化消息体
  • [x] 消息的实际消费方IP追溯
  • [x] 发送事务消息(NEW)
  • [ ] ...
  • [x] 发送即忘消息(可能由于直接抛弃所有异常导致消息静默丢失,弃用)
  • [x] 拉取方式消费(配置方式复杂,位点可能发生偏移,弃用)

简单入门实例

1. 添加maven依赖:
<dependency>
    <groupId>com.maihaoche</groupId>
    <artifactId>spring-boot-starter-rocketmq</artifactId>
    <version>0.1.0</version>
</dependency>
2. 添加配置:
spring:
    rocketmq:
      name-server-address: 172.21.10.111:9876
      # 可选, 如果无需发送消息则忽略该配置
      producer-group: local_pufang_producer
      # 发送超时配置毫秒数, 可选, 默认3000
      send-msg-timeout: 5000
      # 追溯消息具体消费情况的开关,默认打开
      #trace-enabled: false
      # 是否启用VIP通道,默认打开
      #vip-channel-enabled: false
3. 程序入口添加注解开启自动装配

在springboot应用主入口添加@EnableMQConfiguration注解开启自动装配:

@SpringBootApplication
@EnableMQConfiguration
class DemoApplication {
}
4. 构建消息体

通过我们提供的Builder类创建消息对象,详见wiki

MessageBuilder.of(new MSG_POJO()).topic("some-msg-topic").build();
5. 创建发送方

详见wiki

@MQProducer
public class DemoProducer extends AbstractMQProducer{
}
6. 创建消费方

详见wiki支持springEL风格配置项解析,如存在suclogger-test-cluster配置项,会优先将topic解析为配置项对应的值。

@MQConsumer(topic = "${suclogger-test-cluster}", consumerGroup = "local_sucloger_dev")
public class DemoConsumer extends AbstractMQPushConsumer {

    @Override
    public boolean process(Object message, Map extMap) {
        // extMap 中包含messageExt中的属性和message.properties中的属性
        System.out.println(message);
        return true;
    }
}
7. 发送消息:
// 注入发送者
@Autowired
private DemoProducer demoProducer;
    
...
    
// 发送
demoProducer.syncSend(msg)
    

发送事务消息###

Since 0.1.0

5.1 事务消息发送方#####
@MQTransactionProducer(producerGroup = "${camaro.mq.transactionProducerGroup}")
public class DemoTransactionProducer extends AbstractMQTransactionProducer {

    @Override
    public LocalTransactionState executeLocalTransaction(Message msg, Object arg) {
        // executeLocalTransaction
        return LocalTransactionState.UNKNOW;
    }

    @Override
    public LocalTransactionState checkLocalTransaction(MessageExt msg) {
        // LocalTransactionState.ROLLBACK_MESSAGE
        return LocalTransactionState.COMMIT_MESSAGE;
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].