我正在尝试使用新的 Camel Rest component 来休息我的路线从版本 2.14 开始可用:
@Produce(uri = "rest:test.get/company/{name}")
protected ProducerTemplate testProducer;
而与这种rest端点相对应的ProducerTemplate
在该版本中基本上还没有实现。
测试此类端点的最佳方法是什么?
最佳答案
当前的 Camel Rest 组件仅适用于消费者(服务器)端。建议您可以使用 camel-restlet或HttpClient发送纯 HTTP 请求进行测试。
@Produce(uri = "restlet:http://localhost:808/test.get/company/{name}")
protected ProducerTemplate testProducer;
testProducer.requestBodyAndHeader(null, "name", 123, String.class);
关于rest - 测试 Camel REST 组件端点生产者模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26059226/