All Projects → ThierrySquirrel → Rocketmq Spring Boot Starter

ThierrySquirrel / Rocketmq Spring Boot Starter

Licence: apache-2.0
rocketmq-spring-boot-starter

Programming Languages

java
68154 projects - #9 most used programming language

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

Wicket Spring Boot
Spring Boot starter for Apache Wicket
Stars: ✭ 117 (-34.27%)
Mutual labels:  spring-boot, spring-boot-starter
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 (-26.4%)
Mutual labels:  spring-boot, rocketmq
Logback Access Spring Boot Starter
Spring Boot Starter for Logback-access
Stars: ✭ 118 (-33.71%)
Mutual labels:  spring-boot, spring-boot-starter
Handlebars Spring Boot Starter
Spring Boot auto-configuration for Handlebars
Stars: ✭ 102 (-42.7%)
Mutual labels:  spring-boot, spring-boot-starter
Grpc Spring Boot Starter
Spring Boot starter module for gRPC framework.
Stars: ✭ 2,190 (+1130.34%)
Mutual labels:  spring-boot, spring-boot-starter
Whatsmars
Java生态研究(Spring Boot + Redis + Dubbo + RocketMQ + Elasticsearch)🔥🔥🔥🔥🔥
Stars: ✭ 1,389 (+680.34%)
Mutual labels:  spring-boot, rocketmq
Spring Boot Quick
🌿 基于springboot的快速学习示例,整合自己遇到的开源框架,如:rabbitmq(延迟队列)、Kafka、jpa、redies、oauth2、swagger、jsp、docker、spring-batch、异常处理、日志输出、多模块开发、多环境打包、缓存cache、爬虫、jwt、GraphQL、dubbo、zookeeper和Async等等📌
Stars: ✭ 1,819 (+921.91%)
Mutual labels:  aliyun, spring-boot
Eshop Soa
EShop基于Dubbo实现SOA服务化拆分,并基于RocketMQ解决了分布式事务(新版SpringBootSOASkeleton)
Stars: ✭ 65 (-63.48%)
Mutual labels:  spring-boot, rocketmq
Grpc Spring Boot Starter
Spring Boot starter module for gRPC framework.
Stars: ✭ 1,829 (+927.53%)
Mutual labels:  spring-boot, spring-boot-starter
Spring Backend Boilerplate
The modularized backend boilerplate based on Spring Boot Framework, easy to get started and add your business part.
Stars: ✭ 134 (-24.72%)
Mutual labels:  spring-boot, spring-boot-starter
Springboot Templates
springboot和dubbo、netty的集成,redis mongodb的nosql模板, kafka rocketmq rabbit的MQ模板, solr solrcloud elasticsearch查询引擎
Stars: ✭ 100 (-43.82%)
Mutual labels:  spring-boot, rocketmq
Cas Client Autoconfig Support
Annotation-based configuration support for Apereo CAS Java clients
Stars: ✭ 153 (-14.04%)
Mutual labels:  spring-boot, spring-boot-starter
Disruptor Spring Boot Starter
starter for disruptor
Stars: ✭ 83 (-53.37%)
Mutual labels:  spring-boot, spring-boot-starter
Springboot Labs
一个涵盖六个专栏:Spring Boot 2.X、Spring Cloud、Spring Cloud Alibaba、Dubbo、分布式消息队列、分布式事务的仓库。希望胖友小手一抖,右上角来个 Star,感恩 1024
Stars: ✭ 12,804 (+7093.26%)
Mutual labels:  spring-boot, rocketmq
Telegram Spring Boot Starter
Telegram Bot API Spring Boot Starter
Stars: ✭ 79 (-55.62%)
Mutual labels:  spring-boot, spring-boot-starter
Bucket4j Spring Boot Starter
Spring Boot Starter for Bucket4j
Stars: ✭ 127 (-28.65%)
Mutual labels:  spring-boot, spring-boot-starter
Spring Boot Extend
在springboot基础上的扩展项目,快速集成Zookeeper、Dubbo、Apollo、Mybatis多数据源
Stars: ✭ 63 (-64.61%)
Mutual labels:  spring-boot, rocketmq
Spring Higher Order Components
⚡️ Preconfigured components to speedup Spring Boot development
Stars: ✭ 65 (-63.48%)
Mutual labels:  spring-boot, spring-boot-starter
Jasypt Spring Boot
Jasypt integration for Spring boot
Stars: ✭ 1,948 (+994.38%)
Mutual labels:  spring-boot, spring-boot-starter
Aliyun Ons
☁️ SDK of Node.js for Aliyun ONS. 🚀
Stars: ✭ 151 (-15.17%)
Mutual labels:  aliyun, rocketmq

rocketmq-spring-boot-starter

AliYun RocketMQ Spring Book Edition

中文

Support function:

  • [x] Three modes of sending ordinary messages: synchronous, asynchronous and one-way
  • [x] Subscribe to Message Cluster, Broadcast
  • [x] Send and receive sequential messages
  • [x] Transaction messages
  • [x] Delay message
  • [x] receive and receive timing messages

Timing message and delay message:

Delay message and timing message: In the official case, delayed news is much the same as regular news, essentially ordinary news.

If delay message and timing message are needed, it is recommended to use timing task (timing task scheduling platform)

To achieve the purpose of delay or timing.

Transaction message:

In the framework, the operations on transaction messages are simpler and simpler. You can complete the transaction messages by annotations only.

Whether transactional messages, distributed transactional solutions or cross-platform language solutions, the core problem of transactional solutions is to ensure that messages can be sent and consumers can consume them.

Reliability Guarantee

1.Add @TransactionMessage annotation, kernel guarantee, local transaction error, do not send message, correct execution, send message, that is, default submission.

2.Reliability assurance is adopted by default, and default submission is checked back. The reason comes from the previous factor, which guarantees that local transactions do not go wrong.

Quick Start

<!--Adding dependencies to pom. XML-->
        <dependency>
            <artifactId>rocketmq-spring-boot-starter</artifactId>
            <groupId>com.github.thierrysquirrel</groupId>
            <version>2.2.4-RELEASE</version>
        </dependency>

configuration file

## application.properties
thierrysquirrel.access-key= #The Access Key you created in the AliYun Account Management Console for authentication
thierrysquirrel.secret-key= #The SecretKey you created in the AliYun Account Management Console for authentication
thierrysquirrel.name-srv-addr= #Set up TCP protocol access point and get it from console

Start RocketMQ

@SpringBootApplication
@EnableRocketMQ
public class DemoApplication{
    public static void main(String[] args){
        SpringApplication.run(DemoApplication.class, args);
    }
   
}

Three Ways to Send Common Messages

@RestController
@RocketMessage(groupID = "GID_common")
public class Common {

    @GetMapping("/commonA")
    @CommonMessage(topic = "commonA", tag = "commonA",messageSendType = MessageSendType.SEND)
    public String sendCommonMsg() {
        return "commonA";
    }
    @GetMapping("/commonB")
    @CommonMessage(topic = "commonB", tag = "commonB",messageSendType = MessageSendType.SEND_ASYNC)
    public String sendAsyncMsg() {
        return "commonB";
    }
    @GetMapping("/commonC")
    @CommonMessage(topic = "commonC", tag = "commonC",messageSendType = MessageSendType.SEND_ONE_WAY)
    public String sendOneWayMessage() {
        return "commonC";
    }
}

Send sequential messages

@RestController
@RocketMessage(groupID = "GID_order")
public class Order {
    @GetMapping("/order")
    @OrderMessage(topic = "order",tag = "order")
    public String order() {
        return "order";
    }
}

Send Transaction Messages

@RestController
@RocketMessage(groupID = "GID_transaction")
public class Transaction {
    @GetMapping("/transaction")
    @TransactionMessage(topic = "transaction",tag = "transaction")
    public String transaction() {
        return "transaction";
    }
}

Delay message or timing message

@RestController
@RocketMessage(groupID = "GID_delayed")
public class Delayed {
    //startDeliverTime is the time stamp, which cannot be less than the current time
    @GetMapping("/delayed")
    @CommonMessage(topic = "delayed", tag = "delayed")
    public String delayed(@StartDeliverTime @RequestParam("startDeliverTime") long startDeliverTime) {
        return "delayed";
    }
}

Subscribe to regular, transactional, delayed, timed messages

Monitor messages using messageModel to control cluster or broadcast consumption patterns

@RocketListener(groupID = "GID_message",messageModel = PropertyValueConst.CLUSTERING)
public class Delayed {
    @MessageListener(topic = "message",tag = "message")    
    public void delayed(String message) {
        System.out.println("message");
    }
}

Subscription order message

@RocketListener(groupID = "GID_message",messageModel = PropertyValueConst.BROADCASTING)
public class Delayed {
    @MessageListener(topic = "message",tag = "message", orderConsumer = true)
    public void delayed(String message) {
            System.out.println("message");
    }
}

Batch Mode

@RocketListener(groupID = "GID_message",batchConsumer = true)
public class Delayed {
	@MessageListener(topic = "message",tag = "message", orderConsumer = true)
	public void delayed(String message) {
		System.out.println("message");
	}
}

Developer-defined global module

Custom Implementation of Message Sending Results

    @Component
    public class MySendCallback implements SendCallback {
        @Override
        public void onSuccess(SendResult sendResult) {
            System.out.println("Successful sending of message");
        }
        @Override
        public void onException(OnExceptionContext context) {
            System.out.println("Failed to send message");
        }
    }

Customize whether local transactions are executed

@Component
public class MyTransactionExecuter implements LocalTransactionExecuter {
    @Override
    public TransactionStatus execute(Message msg, Object arg) {
        System.out.println("Executing local affairs");
        return TransactionStatus.CommitTransaction;
    }
}

Custom review of local transactions

@Component
public class MyTransactionChecker implements LocalTransactionChecker {
    @Override
    public TransactionStatus check(Message msg) {
        System.out.println("Review of local transactions");
        return TransactionStatus.CommitTransaction;
    }
}

Custom RocketSerializer

@Component
public class JacksonSerializer implements RocketSerializer {
	private static ObjectMapper objectMapper = new ObjectMapper();
    @Override
    public byte[] serialize(Object obj) {
        //omit
    }
    @Override
    public Object deserialize(byte[] bytes, Class<?> clazz) {
        //omit
    }
}

Developer-defined Local Modules

@CommonMessage callback Specify the class

@TransactionMessage checker And executer Specify the class

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].