Code Monkey home page Code Monkey logo

Comments (3)

unixliang avatar unixliang commented on July 28, 2024

你好,
为了确保顺序性,一个队列只会被一个consumer进程处理;而sample为了尽量简单,只配置了一个队列;根据一致性hash的结果,是由consumer2来负责处理的,所以只有consumer2有处理日志。

from phxqueue.

tinyshu avatar tinyshu commented on July 28, 2024

谢谢解答,还有个问题 producer.Enqueue的uin参数来做hash的吗? test_producer_echo_main我修改过,每次我传入的uin都不一样,都是被consumer2消费了 ,如果不是用uin那队列和consumer是如何对应的了

from phxqueue.

unixliang avatar unixliang commented on July 28, 2024

producer.Enqueue的uin参数来做hash的吗?

是的,uin决定了请求会入队到哪个队列。

test_producer_echo_main我修改过,每次我传入的uin都不一样,都是被consumer2消费了 ,如果不是用uin那队列和consumer是如何对应的了

因为sample只配置了一个队列,所以无论怎么hash,都是那条队列。
可以尝试改topicconfig.confranges配置项,多配一些队列,例如"ranges": ["0-1"]

from phxqueue.

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.