Closed RhugwedaShedge closed 3 months ago
It doesn't appear your application is being properly autowired due to some missconfiguration on your end. Can you please share your application in a zip or push to github so we can take a look
Thank you for responding but unfortunately I can't share the entire code
@EnableResourceServerSecurity
@SpringBootApplication
@EnableScheduling
@EnableFeignClients
@EnableCaching
@EnableResourceAccessManagement
@EnableAutoConfiguration(exclude = {ErrorMvcAutoConfiguration.class})
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
These are the dependencies
dependencies {
implementation org.springframework.cloud.spring.cloud.stream.binder.rabbit
implementation org.springframework.amqp.spring.rabbit
implementation org.springframework.security.oauth.spring.security.oauth2
implementation org.springframework.cloud.spring.cloud.stream
implementation org.springframework.amqp.spring.amqp
implementation org.springframework.cloud.spring.cloud.function.context
implementation org.springframework.integration.spring.integration.amqp
implementation org.springframework.integration.spring.integration.core
implementation group: 'org.springframework', name: 'spring-beans', version: '6.1.6'
implementation group: 'org.springframework', name: 'spring-core', version: '6.1.6'
}
The properties file
spring.rabbitmq.host=${URL}
spring.rabbitmq.port=${PORT}
spring.rabbitmq.username=${USERNAME}
spring.rabbitmq.password=${PASSWORD}
spring.mvc.pathmatch.matching-strategy=ANT_PATH_MATCHER
spring.cloud.stream.bindings.output.destination=${..}
spring.cloud.stream.bindings.output.content-type=application/json
spring.cloud.stream.bindings.output.binder=rabbit
spring.cloud.stream.bindings.input-in-0.destination=${...}
spring.cloud.stream.bindings.input-in-0.content-type=application/json
spring.cloud.stream.bindings.input-in-0.binder=rabbit
spring.cloud.stream.bindings.input-in-0.group=${...}
spring.cloud.stream.bindings.input-in-0.consumer.queueNameGroupOnly=true
What about the class that autowires StreamBridge
? Can you post that?
Closing due to lack of follow up from the reporter
I am using Spring Cloud Stream and RabbitMQ to send message to a channel. I have Autowired StreamBridge -
Still I am getting the error required a bean of type 'org.springframework.cloud.stream.function.StreamBridge' that could not be found. Action:Consider defining a bean of type 'org.springframework.cloud.stream.function.StreamBridge' in your configuration.
Spring-boot version - 3.2.1 spring-cloud-stream - 4.1.1
Spring-cloud-stream
RabbitMQ