Field context in br.com.caelum.camel.Boot required a bean of type 'org.apache.camel.CamelContext' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'org.apache.camel.CamelContext' in your configuration.
Boot.java
@SpringBootApplication
public class Boot {
@Autowired
private CamelContext context;
@PostConstruct
public void init() throws Exception {
context.addComponent("activemq", ActiveMQComponent.activeMQComponent("tcp://localhost:61616"));
}
public static void main(String[] args) {
SpringApplication.run(Boot.class, args);
}
}
ProdutoService.java
@Service
public class ProdutoService extends RouteBuilder {
@Override
public void configure() throws Exception {
from("file:pedidos").
to("activemq:queue:pedidos");
}
}