gpt4 book ai didi

java - 异常 : defaultEndpoint must be specified. 对于 Camel AWS SES for direct:start

转载 作者:搜寻专家 更新时间:2023-11-01 02:23:45 25 4
gpt4 key购买 nike

我无法使用注释设置默认端点。根据 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com