Hi Pierre,
Thanks for the example, after changing to connectionFactoryName(“ConnectionFactory”) it’s not failing on that exception anymore.
However I’m still not able to run the test to completion:
Caused by: java.lang.UnsupportedOperationException: There were no requests sent during the simulation, reports won’t be generated
My ActiveMQ server have nothing special, I’ve just installed and thats it. Should I configure anything in order to have this testnig running ?
Should I do anything with the MQ server ?
code:
package computerdatabase
import net.timewalker.ffmq3.FFMQConstants
import io.gatling.core.Predef._
import io.gatling.jms.Predef._
import scala.concurrent.duration._
import io.gatling.core.Predef._
import javax.jms._
import org.apache.activemq.ActiveMQConnectionFactory
class JMS10k extends Simulation {
val duration = Integer.getInteger(“duration”, 60).toInt
def jmsConfig = jms
.connectionFactoryName(“ConnectionFactory”)
.url(“tcp://localhost:61616”)
.contextFactory(classOf[org.apache.activemq.jndi.ActiveMQInitialContextFactory].getName)
.listenerCount(1)
.usePersistentDeliveryMode
val scn = scenario(“JMS DSL test”).repeat(0) {
exec(
jms(“req reply testing”).reqreply
.queue(“queueName”)
.replyQueue(“responseQueue”)
.textMessage(“hello from gatling jms dsl”)
.property(“test_header”, “test_value”)
.check(simpleCheck(checkBodyTextCorrect)))
}
setUp(scn.inject(rampUsersPerSec(10) to 1000 during (10 seconds)))
.protocols(jmsConfig)
def checkBodyTextCorrect(m: Message) = {
m match {
case tm: TextMessage => tm.getText == “HELLO FROM GATLING JMS DSL”
case _ => false
}
}
}
logs:
[INFO] Scanning for projects…
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building gatling-maven-plugin-demo 2.1.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — gatling-maven-plugin:2.1.1:execute (default-cli) @ gatling-maven-plugin-demo —
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/x/.m2/repository/ch/qos/logback/logback-classic/1.1.2/logback-classic-1.1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/x/.m2/repository/org/apache/activemq/activemq-all/5.8.0/activemq-all-5.8.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
12:15:52,000 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
12:15:52,000 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback-test.xml] at [file:/C:/opt/scala_workspace/gatling-maven-plugin-demo/target/test-classes/logback-test.xml]
12:15:52,001 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback-test.xml] occurs multiple times on the classpath.
12:15:52,001 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback-test.xml] occurs at [file:/C:/opt/scala_workspace/gatling-maven-plugin-demo/target/test-classes/logback-test.xml]
12:15:52,001 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback-test.xml] occurs at [file:/C:/opt/scala_workspace/gatling-maven-plugin-demo/src/test/resources/logback-test.xml]
12:15:52,090 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
12:15:52,102 |-INFO in ch.qos.logback.classic.joran.action.LoggerContextListenerAction - Adding LoggerContextListener of type [ch.qos.logback.classic.jul.LevelChangePropagator] to the object stack
12:15:52,128 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator@37fcdbc5 - Propagating DEBUG level on Logger[ROOT] onto the JUL framework
12:15:52,128 |-INFO in ch.qos.logback.classic.joran.action.LoggerContextListenerAction - Starting LoggerContextListener
12:15:52,128 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
12:15:52,131 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [CONSOLE]
12:15:52,140 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
12:15:52,197 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to WARN
12:15:52,197 |-INFO in ch.qos.logback.classic.jul.LevelChangePropagator@37fcdbc5 - Propagating WARN level on Logger[ROOT] onto the JUL framework
12:15:52,197 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [CONSOLE] to Logger[ROOT]
12:15:52,198 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
12:15:52,200 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@39c07f3a - Registering current configuration as safe fallback point
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
Simulation computerdatabase.JMS10k started…