Spring boot giving me multiple beans and autowire fails

So I have a Spring-Boot app that is using Camunda. I was able to get the example up and running and I am trying to Autowire the ProcessEngineServices into one of my classes. I followed the instructions https://github.com/camunda/camunda-bpm-examples/tree/master/deployment/spring-boot

when I do this in my class:

@Autowired
private ProcessEngineServices processEngineServices;

It compiles fine, but when running I get the classic:

required a single bean, but 2 were found:
- org.camunda.bpm.engine.spring.SpringProcessEngineServicesConfiguration: defined in null
- processEngine: defined by method 'processEngine' in class path resource [com/me/bpm/CamundaProcessEngineConfiguration.class]

Now I can remove the processEngine() in the EngineConfiguration, but won’t that bypass my configuration settings? AND I thought by importing the SpringProcessEngineServicesConfiguration.class that my bean would “override” the default Spring one. Why are there 2?

How do I keep my configuration settings and still be able to autowire my processEngine?

UPDATE

So I removed the processEngine() just to try and get things working, and now I get:

Field processEngine in org.camunda.bpm.engine.spring.SpringProcessEngineServicesConfiguration 
required a bean of type 'org.camunda.bpm.engine.ProcessEngine' that could not be found.

So how do I have none, yet when I have that method, I have 2?

Hi @mmaceachran,

ProcessEngineServices is an interface that has several implementations, that’s why IMO you get this “2 beans” error. If you need the access to Camunda services, try to inject ProcessEngine instead.