itwanger / itwanger/paicoding

rabbitmq消费者初始化没有声明exchange

Open
#75 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
3.2k
Forks
622
PR merge metrics
No merged PRs in 30d

Description

bug描述

在com.github.paicoding.forum.service.notify.service.impl.RabbitmqServiceImpl类的consumerMsg方法中没有声明exchange的代码

在初始化的时候如果本地的rabbitmq中没有自己创建"direct.exchange"会出现找不到exchange错误。

复现
image

image

报错描述
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no exchange 'direct.exchange' in vhost '/', class-id=50, method-id=20)

bug复现步骤:

bug产生原因(若您已发现具体的bug产生原因,请直接贴上,也可以提merge进行修复)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with com.github.paicoding.forum.service.notify.service.impl.RabbitmqServiceImpl and inspect the consumerMsg method's RabbitMQ initialization. Reproduce the startup with a local RabbitMQ instance that does not already contain direct.exchange, then verify that initialization no longer fails with the reported missing-exchange error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, rabbitmq
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.