I used RabbitMq in my project .In my point of view I declare all the things required for this project. But I don't know where I miss the thing that create error here I provide all the details that I used in my project.
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'springCloudBus.anonymous.9XKB94ZlSFatq7c5KyTIxw' in vhost '/', class-id=50, method-id=10)
at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:517) ~[amqp-client-5.12.0.jar:5.12.0]
at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:341) ~[amqp-client-5.12.0.jar:5.12.0]
at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:182) ~[amqp-client-5.12.0.jar:5.12.0]
at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:114) ~[amqp-client-5.12.0.jar:5.12.0]
at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:739) ~[amqp-client-5.12.0.jar:5.12.0]
at com.rabbitmq.client.impl.AMQConnection.access$300(AMQConnection.java:47) ~[amqp-client-5.12.0.jar:5.12.0]
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:666) ~[amqp-client-5.12.0.jar:5.12.0]
... 1 common frames omitted
bootstrap.yml
spring:
cloud:
config:
uri: http://localhost:8888
vault:
host: localhost
port: 8288
scheme: http
authentication: TOKEN
token: s.atm1jyRmex8zm7HgGjyKRB7H
application-name: product-service
rabbitmq:
host: localhost
port: 5672
username: guest
password: guest
security:
oauth2:
resourceserver:
jwt:
issuer-uri: http://localhost:8280/auth/realms/microservice-realm
data:
mongodb:
uri: mongodb://localhost:27017/product-service
application:
name: PRODUCT-SERVICE
management:
endpoints:
web:
exposure:
include: '*'
application.yml
spring:
data:
mongodb:
uri: mongodb://localhost:27017/product-service
application:
name: PRODUCT-SERVICE
eureka:
instance:
instance-id: ${spring.application.name}:${random.uuid}
server:
port: 0
gradlke.kt
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot") version "2.5.2"
id("io.spring.dependency-management") version "1.0.11.RELEASE"
kotlin("jvm") version "1.5.20"
kotlin("plugin.spring") version "1.5.20"
}
group = "com.main"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_11
repositories {
mavenCentral()
}
extra["springCloudVersion"] = "2020.0.3"
dependencies {
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server")
implementation("org.springframework.cloud:spring-cloud-starter-vault-config:3.0.0")
implementation("org.springframework.security:spring-security-oauth2-jose:5.4.6")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.cloud:spring-cloud-starter-bus-amqp:3.0.1")
implementation("org.springframework.boot:spring-boot-starter-data-mongodb")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.springframework.cloud:spring-cloud-starter-netflix-eureka-client")
implementation("org.springframework.cloud:spring-cloud-config-client:3.0.1")
implementation("org.springframework.cloud:spring-cloud-starter-bootstrap:3.0.2")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}
dependencyManagement {
imports {
mavenBom("org.springframework.cloud:spring-cloud-dependencies:${property("springCloudVersion")}")
}
}
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "11"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
I get this type of error : Failed to declare queue: springCloudBus.anonymous.9XKB94ZlSFatq7c5KyTIxw