【发布时间】:2018-06-27 19:58:17
【问题描述】:
我想使用 Apache Camel 在 IBM MQ 上发送消息,所以我编写了一个简单的程序,但出现错误:
Exception in thread "main" org.apache.camel.NoSuchEndpointException: No endpoint could be found for: queuename, please check your classpath contains the needed Camel component jar.
at org.apache.camel.impl.DefaultProducerTemplate.resolveMandatoryEndpoint(DefaultProducerTemplate.java:499)
at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:167)
我的代码:
CamelContext context = new DefaultCamelContext();
//added that line after some checks but didnt help
context.addComponent("http", new HttpComponent());
context.addComponent("test-jms",connFactory);
ProducerTemplate template = context.createProducerTemplate();
context.start();
template.sendBody("testQueueName", "Test Message ");
testQueueName 持有queuename。
我的pom.xml 中有所有必要的依赖项。
【问题讨论】:
标签: java apache-camel jms ibm-mq