'No endpoint could be found for: test, please check your classpath contains the needed Camel component jar

I am trying to send and receive messages using akka-camel and created a sample example for producer and consumer like below :

Producer:

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"
}

Consumer:

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])
}

But I am facing issue in both producer and consumer like below. What I am missing?

Producer:

java.lang.IllegalArgumentException: destination must be specified

Consumer :

Caused by: org.apache.camel.NoSuchEndpointException: No endpoint could be found for: test, please check your classpath contains the needed Camel component jar.



Solution 1:[1]

I believe you need to provide a name to the test mock endpoint, just test might not work. Can you try doing doing test:myMockEndpoint?

You can take a look here: http://camel.apache.org/components.html

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 hveiga