Giter Site home page Giter Site logo

一个应用只允许一个gid,但是有好几个消费类(不同业务不同的topic),导致订阅关系不一致 about rocketmq-spring HOT 4 CLOSED

hachikozjq avatar hachikozjq commented on July 18, 2024
一个应用只允许一个gid,但是有好几个消费类(不同业务不同的topic),导致订阅关系不一致

from rocketmq-spring.

Comments (4)

drpmma avatar drpmma commented on July 18, 2024

最简单的解决方案,不要让gid和应用绑定,gid本身就是一个消费组集群的概念,和应用不应该绑定。

The simplest solution is not to bind the gid with the application, as the gid itself represents the concept of a consumer group cluster and should not be tied to the application.

from rocketmq-spring.

drpmma avatar drpmma commented on July 18, 2024

在rocketmq中,可以通过consumer多次调用subscribe,使得一个consumer能够同时订阅多个topic;阅读了一下rocketmq-spring的代码,org.apache.rocketmq.spring.support.DefaultRocketMQListenerContainer,看起来是不支持这种做法的。

In RocketMQ, a consumer can subscribe to multiple topics by calling the subscribe method multiple times, allowing a single consumer to simultaneously subscribe to multiple topics. After reviewing the code of rocketmq-spring, specifically org.apache.rocketmq.spring.support.DefaultRocketMQListenerContainer, it appears that this approach is not supported.

from rocketmq-spring.

hachikozjq avatar hachikozjq commented on July 18, 2024

在rocketmq中,可以通过consumer多次调用subscribe,使得一个consumer能够同时订阅多个topic;阅读了一下rocketmq-spring的代码,org.apache.rocketmq.spring.support.DefaultRocketMQListenerContainer,看起来是不支持这种做法的。

In RocketMQ, a consumer can subscribe to multiple topics by calling the subscribe method multiple times, allowing a single consumer to simultaneously subscribe to multiple topics. After reviewing the code of rocketmq-spring, specifically org.apache.rocketmq.spring.support.DefaultRocketMQListenerContainer, it appears that this approach is not supported.

最后使用RocketMQPushConsumerLifecycleListener实现,写在了一个消费类里,多次subscribe,gid一个应用一个是公司限制,不允许自己创建。

from rocketmq-spring.

drpmma avatar drpmma commented on July 18, 2024

可以将你的代码示例贴出来吗,这样别人碰到相同的问题看到你的issue也就可以解决了;
另外,group确实不应当和应用一对一绑定,可以是一个多对一的关系,从最佳实践来看,变更订阅关系的时候也是建议新建group来启用新的订阅关系

Can you post your code example? This way, others facing the same problem can find a solution when they see your issue. Additionally, it is indeed not advisable to bind a group one-to-one with an application; it can be a many-to-one relationship. From best practices, it is recommended to create a new group when changing subscription relationships to enable the new subscriptions.

from rocketmq-spring.

Related Issues (20)

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.