Issue with @EnableCircuitBreaker annotation when running springboot service in local environment

1.6k views Asked by At

when using @EnableCircuitBreaker annotation with spring-cloud-services-dependencies 1.3.0 we are getting

"Caused by: java.lang.NoSuchMethodError: org.springframework.integration.amqp.support.DefaultAmqpHeaderMapper.outboundMapper()Lorg/springframework/integration/amqp/support/DefaultAmqpHeaderMapper;" exception. We are not using any Messaging functionality in our service.

We are using jetty embedded environment.

Can anyone suggest me how can I solve my issue?

1

There are 1 answers

1
Stefan Isele - prefabware.com On

The exception is thrown, cause your application tries to use some classes of spring integration for message queue, which cannot be found.

If you go further up the stacktrace you may find some classes with 'AutoConfiguration' that may show, which spring auto configuration has triggered the search for these missing classes.

You can also add the command line parameter --debug to see what auto config is actually doing.

Once you identified the culprit you can exclude it from the auto configuration like this :

@EnableAutoConfiguration(exclude = {...})