I am working to build a router in ActiveMQ. From what I have read I should
be able to package my class in a jar file, copy the jar file into
$ACTIVEMQ_HOME/lib and then restart. Here is my simple router code:
public class MyRouter extends RouteBuilder {
public MyRouter() throws Exception {
CamelContext context = new DefaultCamelContext();
ConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("tcp://localhost:61616");
context.addComponent("connectionFactory",
JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
}
@Override
public void configure() throws Exception {
from("jms:whatever").to("jms:junk");
}
}
I am getting an exception in ActiveMQ upon startup:
ERROR: java.lang.RuntimeException: Failed to execute start task. Reason:
org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException:
connectionFactory must be specified
java.lang.RuntimeException: Failed to execute start task. Reason:
org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException:
connectionFactory must be specified
at
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:98)
at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at
org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:136)
at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)
at
org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:82)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.activemq.console.Main.runTaskClass(Main.java:251)
at org.apache.activemq.console.Main.main(Main.java:107)
Could someone help me out as to what I can do to fix this.
Thanks