例外:必须指定defaultEndpoint。对于骆驼AWS SES直接:启动

41m*_*ser 4 java apache-camel amazon-web-services

我无法使用注释设置默认端点。根据骆驼文档,它建议使用注释,如下所示。

// auto wiring a producer template using endpoint annotation
@Autowired
@EndpointInject(uri="direct:start")
private ProducerTemplate producerTemplate;

// send the body
producerTemplate.sendBody("hi");
Run Code Online (Sandbox Code Playgroud)

不起作用 它仍然抱怨

“异常:必须指定defaultEndpoint”

enk*_*kor 5

您可以在ProducerTemplate本身上指定defaultEndpoint,如下所示:

// set the defautlEndPoint
producerTemplate.setDefaultEndpointUri("direct:start");
// send the body
producerTemplate.sendBody("hi");
Run Code Online (Sandbox Code Playgroud)