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”
您可以在ProducerTemplate本身上指定defaultEndpoint,如下所示:
// set the defautlEndPoint
producerTemplate.setDefaultEndpointUri("direct:start");
// send the body
producerTemplate.sendBody("hi");
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2388 次 |
| 最近记录: |