我正在尝试使用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:找不到端点:测试,请检查您的类路径是否包含所需的 Camel 组件 jar。