[英]Akka Camel: No consumers available on endpoint
I am new to Akka
and am attempting to use the Camel
component. 我是
Akka
新手,正在尝试使用Camel
组件。
I've simplified the code here, but basically I have a Consumer
actor that consumes from a JMS
endpoint. 我在这里简化了代码,但是基本上我有一个从
JMS
端点使用的Consumer
角色。
In my integration tests, I do not wish to consume from JMS
. 在集成测试中,我不希望从
JMS
。 Instead, I wish to send messages to an endpoint that my consumer reads from. 相反,我希望将消息发送到我的使用者读取的端点。
Therefore, I am attempting this "direct" approach but I get a No consumers available on endpoint: Endpoint[direct://myCamelEndpoint]. Exchange[Message: My test message]
因此,我正在尝试这种“直接”方法,但是
No consumers available on endpoint: Endpoint[direct://myCamelEndpoint]. Exchange[Message: My test message]
No consumers available on endpoint: Endpoint[direct://myCamelEndpoint]. Exchange[Message: My test message]
exception. No consumers available on endpoint: Endpoint[direct://myCamelEndpoint]. Exchange[Message: My test message]
异常。
What configuration am I missing here? 我在这里缺少什么配置?
object TestApp extends App {
implicit val system = ActorSystem()
val camel = CamelExtension(system)
val producer = system.actorOf(Props[MyProducer])
val consumer = system.actorOf(Props[MyConsumer])
producer ! "My test message"
}
class MyProducer extends Producer {
override def endpointUri: String = "direct:myCamelEndpoint"
}
class MyConsumer extends Consumer with ActorLogging{
override def endpointUri: String = "direct:myCamelEndpoint"
override def receive: Receive = {
case event: Any => log.info("Received event {}", event)
}
}
使用seda而不是direct,因为seda的行为更像JMS。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.