Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consumer group 和provider group设计在一起了,是有问题的 #24

Open
taotao365s opened this issue Dec 23, 2020 · 0 comments
Open

Comments

@taotao365s
Copy link

  1. provider端发送消息时,需要知道consumer的group,否则消息查询不到,group设计耦合了
  2. 测试用例中可以用,是因为都是DEFAULT
        List<XxlMqMessage> list = xxlMqMessageDao.pullNewMessage(XxlMqMessageStatus.NEW.name(), topic, group, consumerRank, consumerTotal, pagesize);

对应sql

SELECT <include refid="Base_Column_List" />
		FROM xxl_mq_message AS t
		WHERE 	t.topic = #{topic}
			AND t.group = #{group}
			AND t.status = #{newStatus}
			AND t.effectTime <![CDATA[ < ]]> NOW()
			<if test="consumerTotal > 1">
				AND (
					(
						t.shardingId <![CDATA[ = ]]> 0
						AND
						MOD(t.id, #{consumerTotal}) = #{consumerRank}
					)
					OR
					(
						t.shardingId <![CDATA[ > ]]> 0
						AND
						MOD(t.shardingId, #{consumerTotal}) = #{consumerRank}
					)
				)
			</if>
		ORDER BY t.id ASC
		LIMIT #{pagesize}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant