【问题标题】:No endpoint could be found for: test, please check your classpath contains the needed Camel component jar找不到端点:测试,请检查您的类路径是否包含所需的 Camel 组件 jar
【发布时间】:2018-05-21 07:30:35
【问题描述】:

我正在尝试使用akka-camel 发送和接收消息,并为生产者和消费者创建了一个示例示例,如下所示:

制作人:

import akka.actor.{Actor, ActorSystem, Props}
import akka.camel.Producer

class CamelJmsProducer extends Actor with Producer {
  override def endpointUri = "test"
}

object CamelJmsProducerApp extends App {
  val system = ActorSystem("some-system")
  val ref = system.actorOf(Props[CamelJmsProducer])
  ref ! "HEY"
}

消费者:

import akka.actor.{Actor, ActorSystem, Props}
import akka.camel.{CamelMessage, Consumer}

class CamelJmsConsumer extends Actor with Consumer {
  override def receive = {
    case msg: CamelMessage ⇒ println("RECEIVED >>> " + msg)
    case _ ⇒ println("RECEIVED NOTHING>>> ")
  }

  override def endpointUri = "test"
}

object CamelJmsConsumerApp extends App {
  val system = ActorSystem("some-system1")
  system.actorOf(Props[CamelJmsConsumer])
}

但是我在生产者和消费者中都面临如下问题。我错过了什么?

制作人:

java.lang.IllegalArgumentException:必须指定目的地

消费者:

原因:org.apache.camel.NoSuchEndpointException:没有端点可以 可用于:测试,请检查您的类路径是否包含所需的 骆驼组件罐子。

【问题讨论】:

    标签: scala akka activemq producer-consumer akka-camel


    【解决方案1】:

    我相信您需要为测试模拟端点提供一个名称,只是 test 可能不起作用。你可以尝试做test:myMockEndpoint吗?

    你可以看这里:http://camel.apache.org/components.html

    【讨论】:

    • 不走运,同样的问题仍然存在。
    • 您的项目中是否有所需的camel-spring 依赖项?
    • 是的,我添加了 camel-spring 依赖,还是一样。
    猜你喜欢
    • 1970-01-01
    • 2013-03-05
    • 1970-01-01
    • 2013-07-08
    • 1970-01-01
    • 2023-03-11
    • 2010-09-16
    • 1970-01-01
    相关资源
    最近更新 更多