Spring Sleuth LazyConnectionFactory

Error:

Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'mqConnectionFactory' is expected to be of type 'com.ibm.mq.jms.MQConnectionFactory' but was actually of type 'org.springframework.cloud.sleuth.instrument.messaging.LazyConnectionFactory'

 

You have spring-cloud-starter-sleuth in your class path.

 

Solution:

 

Make sure you have the latest  spring-cloud-starter-sleuth

 

Reconfigure your bean definitions to use Interfaces instead of the concrete class implementation

 

From:

public MQConnectionFactory defaultConnectionFactory() {
		return new MQConnectionFactory();
}

To:

public ConnectionFactory defaultConnectionFactory() {
		return new MQConnectionFactory();
}

 

or 

 

Disable tracing for JMS.

spring.slueth.messaging.jms.enabled=false

 

Source