我无法使用注释设置默认端点。根据 Camel 文档,它建议注释如下所示。
// auto wiring a producer template using endpoint annotation
@Autowired
@EndpointInject(uri="direct:start")
private ProducerTemplate producerTemplate;
// send the body
producerTemplate.sendBody("hi");
不起作用。它仍然提示
"Exception: defaultEndpoint must be specified"
最佳答案
您可以在 ProducerTemplate 本身上指定 defaultEndpoint,例如:
// set the defautlEndPoint
producerTemplate.setDefaultEndpointUri("direct:start");
// send the body
producerTemplate.sendBody("hi");
关于java - 异常 : defaultEndpoint must be specified. 对于 Camel AWS SES for direct:start,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31331226/