Gatling JMS api available for testing

1,807 views
Skip to first unread message

Jason Koch

unread,
Jul 16, 2013, 8:09:23 AM7/16/13
to gat...@googlegroups.com
Hi all

If you want to test JMS through the Gatling API - you can now try this out - https://github.com/jasonk000/gatling-jms

There's still a bit to do to round it out (more in the checks API, and create some unit test coverage), and please raise any issues if you see any. It's not extensively tested at this point. It's built against 2.0.0-M3a.

Thanks @slandelle and the Gatling team for putting such a great tool together and for your help getting going. Much appreciated.

Thanks
Jason

Nicolas Rémond

unread,
Jul 18, 2013, 4:01:04 PM7/18/13
to gat...@googlegroups.com
Thank you very much for contributing to the project. That's a very cool add-on.

Cheers
Nicolas


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Stéphane Landelle

unread,
Jul 21, 2013, 9:32:25 AM7/21/13
to gat...@googlegroups.com
Very nice!

I'll try to do some review in the next weeks. Do you have a sample that can be easily set up?

Stéphane


2013/7/16 Jason Koch <jas...@bluedevel.com>

Jason Koch

unread,
Jul 21, 2013, 7:16:04 PM7/21/13
to gat...@googlegroups.com
Hi Stephane -


Or were you looking for an end to end demo of how to set up (eg: setting up a jms broker etc).

Thanks
Jason

Stéphane Landelle

unread,
Jul 22, 2013, 12:33:18 AM7/22/13
to gat...@googlegroups.com
The second one (lazy mode) :)

Other questions: why did you choose FFMQ over other brokers? Is it particularly fast? Is it because you're familiar with it? Is the project active? Will it support JMS2?


2013/7/22 Jason Koch <jas...@bluedevel.com>

Jason Koch

unread,
Jul 24, 2013, 7:56:53 AM7/24/13
to gat...@googlegroups.com
Hi Stephane

In my case, I chose FFMQ because it is simple and lightweight to set up (unzip and run). No need to configure queues manually. It claims to be fast, project does not seem active, and does not currently support Jms2 (though Jms2 should be backwards compatible).

By way of analogy, you can use Gatling to test HTTP whether you run on Apache or Microsoft IIS, Nginx, Websphere, etc. The same applies here to the JMS provider. The JMS provider is (almost) a part of hosting the service, so you have to take the JMS provider platform into account - but really you're aiming to test the performance of your application components connected to it. So - asking why I chose FFMQ as my example is akin to asking why you choose a specific server for your tests, it doesn't matter so much :).

JMS is an API spec and there are a number of brokers which implement the spec [1]. Whichever JMS provider you use is up to you, just change the protocol and it will work.

I'll write a proper blog article at some point but till then feel free to ask more questions.

Thanks
Jason


Stéphane Landelle

unread,
Jul 24, 2013, 8:22:01 AM7/24/13
to gat...@googlegroups.com
Sorry, I didn't properly read your code at the time I wrote this email and thought you had a compile-time dep to FFMQ.


2013/7/24 Jason Koch <jas...@bluedevel.com>

Nat M

unread,
Dec 3, 2014, 4:29:17 AM12/3/14
to gat...@googlegroups.com, jas...@bluedevel.com
Hi All,

I am investigating the possibility of using Gatling to test JMS application which uses ActiveMQ.

I have a couple of questions: 
      1. Is ActiveMQ supported by the gatling - jms plugin - here  the implementation seems to be specific to FFMQ. 
      2. In case ActiveMQ is supported is there an example.
      3. Would this be available in Gatling 2 only or also in 1.5?

Many thanks,
Natalie

Pierre DAL-PRA

unread,
Dec 3, 2014, 4:35:20 AM12/3/14
to gat...@googlegroups.com
Hi,

On 3 December 2014 at 10:29, Nat M <nme...@gmail.com> wrote:
Hi All,

I am investigating the possibility of using Gatling to test JMS application which uses ActiveMQ.

I have a couple of questions: 
      1. Is ActiveMQ supported by the gatling - jms plugin - here  the implementation seems to be specific to FFMQ. 

 The issue you're referring to specifically mentions a problem with ActiveMQ in our tests, I don't know what led you to think we were tied to FFMQ 0_o Since we support JMS, and not a specific implementation, yes it would work with ActiveMQ.

      2. In case ActiveMQ is supported is there an example. 
      3. Would this be available in Gatling 2 only or also in 1.5?

The offficial JMS support is only available for Gatling 2.
Please note that Gatling 1.5 has been deprecated since Gatling 2 release and will no longer be maintained.

Many thanks,
Natalie




On Tuesday, 16 July 2013 13:09:23 UTC+1, Jason Koch wrote:
Hi all

If you want to test JMS through the Gatling API - you can now try this out - https://github.com/jasonk000/gatling-jms

There's still a bit to do to round it out (more in the checks API, and create some unit test coverage), and please raise any issues if you see any. It's not extensively tested at this point. It's built against 2.0.0-M3a.

Thanks @slandelle and the Gatling team for putting such a great tool together and for your help getting going. Much appreciated.

Thanks
Jason

--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom M

unread,
Dec 29, 2014, 4:49:44 AM12/29/14
to gat...@googlegroups.com
Hi Pierre DAL-PRA,

When I'm testing with ActiveMQ it throws me the following error:

I think that the contextFactory name is wrong, but I can't find any that workds...Do you have any working example with ActiveMQ that you can share?

Thanks


 val jmsConfig = jms
    .connectionFactoryName(ActiveMQConnectionFactory.DEFAULT_BROKER_URL)
    .url("tcp://localhost:61616")
    .contextFactory("org.apache.activemq.jndi.ActiveMQInitialContextFactory")
    .listenerCount(1)

[ERROR] [12/29/2014 10:38:11.668] [GatlingSystem-akka.actor.default-dispatcher-3] [akka://GatlingSystem/user/jmsReqReply-3] scheme failover not recognized
akka.actor.ActorInitializationException: exception during creation
    at akka.actor.ActorInitializationException$.apply(Actor.scala:164)
    at akka.actor.ActorCell.create(ActorCell.scala:596)
    at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:456)
    at akka.actor.ActorCell.systemInvoke(ActorCell.scala:478)
    at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:279)
    at akka.dispatch.Mailbox.run(Mailbox.scala:220)
    at akka.dispatch.Mailbox.exec(Mailbox.scala:231)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1253)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1346)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: javax.naming.NamingException: scheme failover not recognized
    at org.apache.activemq.jndi.ReadOnlyContext.lookup(ReadOnlyContext.java:221)
    at javax.naming.InitialContext.lookup(InitialContext.java:411)
    at io.gatling.jms.client.SimpleJmsClient.<init>(SimpleJmsClient.scala:58)
    at io.gatling.jms.JmsReqReplyAction.<init>(JmsReqReplyAction.scala:49)
    at io.gatling.jms.JmsReqReplyActionBuilder$$anonfun$build$1.apply(JmsReqReplyActionBuilder.scala:31)
    at io.gatling.jms.JmsReqReplyActionBuilder$$anonfun$build$1.apply(JmsReqReplyActionBuilder.scala:31)
    at akka.actor.TypedCreatorFunctionConsumer.produce(Props.scala:343)
    at akka.actor.Props.newActor(Props.scala:252)
    at akka.actor.ActorCell.newActor(ActorCell.scala:552)
    at akka.actor.ActorCell.create(ActorCell.scala:578)
    ... 10 more

Pierre DAL-PRA

unread,
Dec 29, 2014, 4:59:35 AM12/29/14
to gat...@googlegroups.com
Hi,

In your example, you’re mixing the ConnectionFactory name with the URL.
And ActiveMQ’s DEFAULT_BROKER_URL is a valid URL, but not a valid JNDI path.

This is a working example of ActiveMQ usage with Gatling’s JMS support, which we use in your tests: https://github.com/gatling/gatling/blob/master/gatling-jms/src/test/scala/io/gatling/jms/integration/JmsMockingSpec.scala#L40

Cheers,

Pierre

Tom M

unread,
Dec 29, 2014, 6:23:25 AM12/29/14
to gat...@googlegroups.com
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...

================================================================================
2014-12-29 12:15:54                                           0s elapsed
---- JMS DSL test --------------------------------------------------------------
[                                                                          ]  0%
          waiting: 5050   / active: 0      / done:0    
---- Requests ------------------------------------------------------------------
> Global                                                   (OK=0      KO=0     )

================================================================================


================================================================================
2014-12-29 12:15:59                                           5s elapsed
---- JMS DSL test --------------------------------------------------------------
[#################                                                         ] 23%
          waiting: 3860   / active: 0      / done:1190 
---- Requests ------------------------------------------------------------------
> Global                                                   (OK=0      KO=0     )

================================================================================


================================================================================
2014-12-29 12:16:04                                          10s elapsed
---- JMS DSL test --------------------------------------------------------------
[######################################################################    ] 95%
          waiting: 243    / active: 0      / done:4807 
---- Requests ------------------------------------------------------------------
> Global                                                   (OK=0      KO=0     )

================================================================================


================================================================================
2014-12-29 12:16:04                                          10s elapsed
---- JMS DSL test --------------------------------------------------------------
[##########################################################################]100%
          waiting: 0      / active: 0      / done:5050 
---- Requests ------------------------------------------------------------------
> Global                                                   (OK=0      KO=0     )

================================================================================

Simulation finished
12:16:04.294 [ERROR] i.g.j.JmsReqReplyAction - java.lang.InterruptedException
Parsing log file(s)...
Parsing log file(s) done
Generating reports...
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at io.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:50)
    at io.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33)
Caused by: java.lang.UnsupportedOperationException: There were no requests sent during the simulation, reports won't be generated
    at io.gatling.charts.report.ReportsGenerator$.generateFor(ReportsGenerator.scala:45)
    at io.gatling.app.Gatling.generateReports(Gatling.scala:192)
    at io.gatling.app.Gatling.start(Gatling.scala:82)
    at io.gatling.app.Gatling$.fromArgs(Gatling.scala:59)
    at io.gatling.app.Gatling$.main(Gatling.scala:44)
    at io.gatling.app.Gatling.main(Gatling.scala)
    ... 6 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.154 s
[INFO] Finished at: 2014-12-29T12:16:05+01:00
[INFO] Final Memory: 7M/240M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.gatling:gatling-maven-plugin:2.1.1:execute (default-cli) on project gatling-maven-plugin-demo: Gatling failed. Process exited with an error: -1 (Exit value: -1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

on the simulation.log:
computerdatabase.JMS10k    jms10k    RUN    1419852022093         2.0
JMS DSL test    2483206286430220603-0    USER    START    1419852022188    0
JMS DSL test    2483206286430220603-0    USER    END    1419852022188    1419852022210
(...)
JMS DSL test    2483206286430220603-5048    USER    START    1419852032401    0
JMS DSL test    2483206286430220603-5048    USER    END    1419852032401    1419852032401
JMS DSL test    2483206286430220603-5049    USER    START    1419852032401    0
JMS DSL test    2483206286430220603-5049    USER    END    1419852032401    1419852032401


Thank you.

Pierre DAL-PRA

unread,
Dec 29, 2014, 6:28:39 AM12/29/14
to gat...@googlegroups.com
val scn = scenario("JMS DSL test").repeat(0) : That is your problem.
Your thousands of users are executing a scenario which does absolutely nothing. since the loop never get executed. repeat(0) is a nonsense.
And so Gatling complains during the reports generation that there was no requests executed in your scenario.

Tadimarriakhilabegum Tadimarriakhilabegum

unread,
Feb 7, 2018, 4:55:12 AM2/7/18
to Gatling User Group
Hello,

M trying to test JMS application which uses TIBCO queues, could you please elaborate about integration of Gatling with TIBCO jars.

Regards,
Akhila begum

venkatesh` nayak

unread,
May 29, 2019, 1:26:26 AM5/29/19
to Gatling User Group
Hi All,

is there any way in Gatling to use JMS Protocol to test the IBM Websphere MQ, if so can you please let me know how we can do it

Thanks in Advance....!!!!

Regards,
Venkatesh Nayak
Reply all
Reply to author
Forward
0 new messages