Commit 1f525e95 authored by Steven Pisarski's avatar Steven Pisarski

Fixed issue that was originally supposed to not leverage an external AMQ...

Fixed issue that was originally supposed to not leverage an external AMQ broker for unit tests but now it is working.
parent ca778471
......@@ -127,6 +127,7 @@ object GeneratorActors {
if (camelSystem.context.getComponent("activemq") == null)
camelSystem.context.addComponent("activemq", ActiveMQComponent.activeMQComponent(baseUrl))
else camelSystem.context.getComponent("activemq").asInstanceOf[ActiveMQComponent].setBrokerURL(baseUrl)
actorSystem.actorOf(Props(classOf[CamelProducer], amqUrl))
}
......
......@@ -23,9 +23,13 @@ object TestActors {
*/
def activeMqConsumer(protocol: String = "tcp", host: String, port: Int = 61616, name: String,
routeType: JMSRouteType = JMSRouteType.TOPIC, notifier: Notifier) = {
val baseUrl = s"$protocol://$host:$port"
if (GeneratorActors.camelSystem.context.getComponent(baseUrl) == null)
GeneratorActors.camelSystem.context.addComponent(baseUrl, ActiveMQComponent.activeMQComponent(baseUrl))
val baseUrl = protocol match {
case "vm" =>
"vm://localhost?broker.persistent=false" // For testing
case _ => s"$protocol://$host:$port"
}
if (GeneratorActors.camelSystem.context.getComponent("activemq") == null)
GeneratorActors.camelSystem.context.addComponent("activemq", ActiveMQComponent.activeMQComponent(baseUrl))
val amqUrl = s"activemq:$routeType:$name"
GeneratorActors.actorSystem.actorOf(Props(classOf[CamelConsumer], amqUrl, notifier))
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment