Giter Site home page Giter Site logo

springboot-rocketmq's Introduction

使用 以下以hello 服务来作为例子讲解
  1. 在启动类HelloApplication上加上注解 @EnableRocketMq
  2. 在配置文件上填写相关配置

mq 配置

            rocketmq:
              # NameServer地址 若是集群,用;作为地址的分隔符
              namesrvAddr: 127.0.0.1:9876
              # 生产者的组名
              producerId: hello
  1. 发布消息,请查看ProducerTest 类,增加了自定义的类RocketProducerService 进一步封装DefaultMQProducer ,包含日志打印,也为了以后进一步扩展,比如以后直接使用阿里云的rocketmq
  2. 监听消息请查看MqResultListener 类,监听消息只需要实现接口类MessageListener就可以,注意有顺序消息和无顺序消息不同,请查看注意事项说明

注意事项:
1、消费有顺序消息时,请使用@RocketMqOrderListener 注解,并且实现接口类MessageOrderListener
2、消费普通消息时,请使用@RocketMqListener 注解,并且实现接口类MessageListener

springboot-rocketmq's People

Contributors

lizhuonb avatar wizhuo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.