JMS, using EL/session to set replyDestination

Hi

I have an application that listens on messages on one queue and sends a message to a topic, I’m using Apache MQ. I would like to load test this application using Gatling. I’m new to both Scala and Gatling. My application will create the topic name based on the incoming message. When I in my test hard code values for the topic name in replyDestination all works fine:

`
val scn = scenario(“JMS DSL test”)

`
.exec(

jms(“req reply testing”).reqreply
.queue(“CARETRACK.GOT.DEV.ACTOR.ACTORMESSAGES.IN”)
.replyDestination(topic(“CARETRACK/GLOBAL/Integration/Actor/1_0/market/country”))
.objectMessage(createMessage(“market”, “country”))
.check(simpleCheck(checkBodyTextCorrect))
)

setUp(scn.inject(atOnceUsers(1)))
.protocols(jmsConfig)

def checkBodyTextCorrect(m: Message) = {
m match {
case tm: TextMessage => tm.getText.size > 0
case _ => false
}
}

But what I really want to do is to supply the market and country values through a feeder something like:

val scn = scenario("JMS DSL test")
.feed(feeder)
.exec(session => {
val market = session(“market”).as[String]
val country = session(“country”).as[String]
session
.set(“objectMessage”, createMessage(market, country))
.set(“topic”, topic(s"CARETRACK/GLOBAL/Integration/Actor/1_0/${market}/${country}"))
})
.exec(
jms(“req reply testing”).reqreply
.queue(“CARETRACK.GOT.DEV.ACTOR.ACTORMESSAGES.IN”)
.replyDestination("${topic}")
.objectMessage("${objectMessage}")
.check(simpleCheck(checkBodyTextCorrect))
)

setUp(scn.inject(atOnceUsers(1)))
.protocols(jmsConfig)

def checkBodyTextCorrect(m: Message) = {
m match {
case tm: TextMessage => tm.getText.size > 0
case _ => false
}
}

But since replyDestination() cant handle EL expressions (and not topic() either) it doesn’t work. Is there some other way that I can get the replyDestination() call to use the topic set in the session?

Cheers
Niklas

No, that’s the possible atm, the topics are loaded once and for all on start up.