JMS-scenario against IBM-MQ: Issues with multiple QueueManagers

422 views
Skip to first unread message

Philipp Gniewosz

unread,
May 23, 2018, 11:48:49 AM5/23/18
to Gatling User Group
Dear all,

I'm running Gatling 2.3.0 and usinge a file based MQ JNDI in order to load test a IBM MQ. There are three MQ-Hosts and I've defined three QueueConnectionFactories mit JMSAdminTool.

Here's my senario:


import io.gatling.core.Predef._
import io.gatling.core.structure.ScenarioBuilder
import io.gatling.jms.Predef._
import io.gatling.jms.protocol.JmsProtocolBuilderBase.connectionFactoryName

import scala.concurrent.duration._

class GPRSForwarderTest extends Simulation {

  val JNDI_CONTEXT
= "com.sun.jndi.fscontext.RefFSContextFactory"

  val DEFAULT_QCF_NAME_MQ_HOST_1
= "GPRSF"

  val DEFAULT_QCF_NAME_MQ_HOST_2
= "GPRSF2"

  val DEFAULT_QCF_NAME_MQ_HOST_3
= "GPRSF3"

  val message254
= "00001404020611100E033102C20EBB51CC1C036EFFFF00010002323802000200FE05001400000000FFFFFFFF01FFFFFFFFFFFFFFFFFFFFFF040010038B0D6912EB10CE070206110F37298C"

  val message255
= "00001400020611101315310200006973D9BF002B002A00010002313902000200FF05001400FEE4E4000B874000004C77DE4B0007A5964A650A0001000C001704134420203438354C4951"

  val message102
= "0000140413060E0E2816310203BA0342CB0A01E7FFFF0002000200662300260100230E017F13060E0E2500000013060E0E2537FFFFFFFF04C7005B14000E451BD1FFFFFFFF"

  val message109
= "000014090A01120E02223102A73E1451DBCD0000000000020002006D2300260100230700010A01120E01330000000000000000000000000000000000000000000000000000"


 
// JMS configuration for MQ-HOST 1

  val jmsConfigMQ1
= connectionFactoryName(DEFAULT_QCF_NAME_MQ_HOST_1)
   
.url("file:///Users/gniewosz/Documents")
   
.credentials("mqm", "mqm")
   
.contextFactory(JNDI_CONTEXT)
   
.listenerCount(1)
   
.usePersistentDeliveryMode




  val scnMessageID254
= scenario("Load testing GPRS InboundQueue on MQ-HOST-1 with MessageID254").during(8 hour) {
   
exec(jms("F&F testing with MessageID 254").send
     
.queue("FLEETBOARD.GPRS_MESSAGES.QUEUE")
     
.textMessage(message254)
   
)
 
}

  val scnMessageID255
= scenario("Load testing GPRS InboundQueue on MQ-HOST-1 with MessageID255").during(8 hour) {
   
exec(jms("F&F testing with Message ID 255").send
     
.queue("FLEETBOARD.GPRS_MESSAGES.QUEUE")
     
.textMessage(message255)
   
)
 
}

  val scnMessageID102
= scenario("Load testing GPRS InboundQueue on MQ-HOST-1 with MessageID102").during(8 hour) {
   
exec(jms("F&F testing with Message ID 102").send
     
.queue("FLEETBOARD.GPRS_MESSAGES.QUEUE")
     
.textMessage(message102)
   
)
 
}

  val scnMessageID109
= scenario("Load testing GPRS InboundQueue on MQ-HOST-1 with MessageID109").during(8 hour) {
   
exec(jms("F&F testing with Message ID 109").send
     
.queue("FLEETBOARD.GPRS_MESSAGES.QUEUE")
     
.textMessage(message109)
   
)
 
}

 
// JMS configuration for MQ-HOST 2

  val jmsConfigMQ2
= connectionFactoryName(DEFAULT_QCF_NAME_MQ_HOST_2)
   
.url("file:///Users/gniewosz/Documents")
   
.credentials("mqm", "mqm")
   
.contextFactory(JNDI_CONTEXT)
   
.listenerCount(1)
   
.usePersistentDeliveryMode

  val scnMessageID254MQHost2
= scenario("Load testing GPRS InboundQueue on MQ-HOST-2 with MessageID254").during(8 hour) {
   
exec(jms("F&F testing with MessageID 254").send
     
.queue("FLEETBOARD.GPRS_MESSAGES.QUEUE")
     
.textMessage(message254)
   
)
 
}

  val scnMessageID255MQHost2
= scenario("Load testing GPRS InboundQueue on MQ-HOST-2 with MessageID255").during(8 hour) {
   
exec(jms("F&F testing with Message ID 255").send
     
.queue("FLEETBOARD.GPRS_MESSAGES.QUEUE")
     
.textMessage(message255)
   
)
 
}

  val scnMessageID102MQHost2
= scenario("Load testing GPRS InboundQueue on MQ-HOST-2 with MessageID102").during(8 hour) {
   
exec(jms("F&F testing with Message ID 102").send
     
.queue("FLEETBOARD.GPRS_MESSAGES.QUEUE")
     
.textMessage(message102)
   
)
 
}

  val scnMessageID109MQHost2
= scenario("Load testing GPRS InboundQueue on MQ-HOST-2 with MessageID109").during(8 hour) {
   
exec(jms("F&F testing with Message ID 109").send
     
.queue("FLEETBOARD.GPRS_MESSAGES.QUEUE")
     
.textMessage(message109)
   
)
 
}

 
// JMS configuration for MQ-HOST 3

  val jmsConfigMQ3
= connectionFactoryName(DEFAULT_QCF_NAME_MQ_HOST_3)
   
.url("file:///Users/gniewosz/Documents")
   
.credentials("mqm", "mqm")
   
.contextFactory(JNDI_CONTEXT)
   
.listenerCount(1)
   
.usePersistentDeliveryMode

  val scnMessageID254MQHost3
= scenario("Load testing GPRS InboundQueue on MQ-HOST-3 with MessageID254").during(8 hour) {
   
exec(jms("F&F testing with MessageID 254").send
     
.queue("FLEETBOARD.GPRS_MESSAGES.QUEUE")
     
.textMessage(message254)
   
)
 
}

  val scnMessageID255MQHost3
= scenario("Load testing GPRS InboundQueue on MQ-HOST-3 with MessageID255").during(8 hour) {
   
exec(jms("F&F testing with Message ID 255").send
     
.queue("FLEETBOARD.GPRS_MESSAGES.QUEUE")
     
.textMessage(message255)
   
)
 
}


  val scnMessageID102MQHost3
= scenario("Load testing GPRS InboundQueue on MQ-HOST-3 with MessageID102").during(8 hour) {
   
exec(jms("F&F testing with Message ID 102").send
     
.queue("FLEETBOARD.GPRS_MESSAGES.QUEUE")
     
.textMessage(message102)
   
)
 
}

  val scnMessageID109MQHost3
= scenario("Load testing GPRS InboundQueue on MQ-HOST-3 with MessageID109").during(8 hour) {
   
exec(jms("F&F testing with Message ID 109").send
     
.queue("FLEETBOARD.GPRS_MESSAGES.QUEUE")
     
.textMessage(message109)
   
)
 
}



 
/* define actual load test data sets (concurrent user/msgs and time frames) for given environment */


 
// configuration for MQ-HOST-1
  setUp
(scnMessageID254.inject(rampUsers(40) over(1 seconds))
   
.protocols(jmsConfigMQ1), scnMessageID255.inject(rampUsers(40) over(1 seconds))
   
.protocols(jmsConfigMQ1),scnMessageID102.inject(rampUsers(40) over(1 seconds))
   
.protocols(jmsConfigMQ1), scnMessageID109.inject(rampUsers(40) over(1 seconds)),
   
// configuration for MQ-HOST-2
    scnMessageID254MQHost2
.inject(rampUsers(40) over (1 seconds)).protocols(jmsConfigMQ2),
    scnMessageID255MQHost2
.inject(rampUsers(40) over(1 seconds)).protocols(jmsConfigMQ2),
    scnMessageID102MQHost2
.inject(rampUsers(40) over (1 seconds)).protocols(jmsConfigMQ2),
    scnMessageID109MQHost2
.inject(rampUsers(40) over (1 seconds)).protocols(jmsConfigMQ2),
   
// configuration for MQ-HOST-3
    scnMessageID254MQHost3
.inject(rampUsers(40) over (1 seconds)).protocols(jmsConfigMQ3),
    scnMessageID255MQHost3
.inject(rampUsers(40) over (1 seconds)).protocols(jmsConfigMQ3),
    scnMessageID102MQHost3
.inject(rampUsers(40) over (1 seconds)).protocols(jmsConfigMQ3),
    scnMessageID109MQHost3
.inject(rampUsers(40) over (1 seconds)).protocols(jmsConfigMQ3)

 
)



}

When running this simulation, I'm receiving a Cannot provide a default value for JmsProtocol Exception. Can anybody help? Thanks in advance.

7:30:06.530 [INFO ] i.g.j.c.JmsSendClient - Got Connection com.ibm.mq.jms.MQQueueConnection@25ddbbbb
Exception in thread "main" java.lang.IllegalStateException: Can't provide a default value for JmsProtocol
    at io.gatling.jms.protocol.JmsProtocol$$anon$1.defaultProtocolValue(JmsProtocol.scala:34)
    at io.gatling.jms.protocol.JmsProtocol$$anon$1.defaultProtocolValue(JmsProtocol.scala:27)
    at io.gatling.core.protocol.ProtocolComponentsRegistry.$anonfun$components$3(Protocol.scala:66)
    at scala.collection.MapLike.getOrElse(MapLike.scala:128)
    at scala.collection.MapLike.getOrElse$(MapLike.scala:126)
    at scala.collection.AbstractMap.getOrElse(Map.scala:59)
    at io.gatling.core.protocol.ProtocolComponentsRegistry.$anonfun$components$2(Protocol.scala:66)
    at scala.collection.MapLike.getOrElse(MapLike.scala:128)
    at scala.collection.MapLike.getOrElse$(MapLike.scala:126)
    at scala.collection.AbstractMap.getOrElse(Map.scala:59)
    at io.gatling.core.protocol.ProtocolComponentsRegistry.protocol$1(Protocol.scala:66)
    at io.gatling.core.protocol.ProtocolComponentsRegistry.comps$1(Protocol.scala:67)
    at io.gatling.core.protocol.ProtocolComponentsRegistry.$anonfun$components$4(Protocol.scala:69)
    at scala.collection.mutable.HashMap.getOrElseUpdate(HashMap.scala:82)
    at io.gatling.core.protocol.ProtocolComponentsRegistry.components(Protocol.scala:69)
    at io.gatling.jms.action.JmsRequestSendBuilder.components(JmsRequestSendBuilder.scala:30)
    at io.gatling.jms.action.JmsRequestSendBuilder.build(JmsRequestSendBuilder.scala:34)
    at io.gatling.core.structure.StructureBuilder.$anonfun$build$1(StructureBuilder.scala:34)
    at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:122)
    at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:118)
    at scala.collection.immutable.List.foldLeft(List.scala:86)
    at io.gatling.core.structure.StructureBuilder.build(StructureBuilder.scala:33)
    at io.gatling.core.structure.StructureBuilder.build$(StructureBuilder.scala:32)
    at io.gatling.core.structure.ChainBuilder.build(ChainBuilder.scala:30)

    at io.gatling.core.action.builder.LoopBuilder.build(LoopBuilder.scala:44)
    at io.gatling.core.structure.StructureBuilder.$anonfun$build$1(StructureBuilder.scala:34)
    at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:122)
    at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:118)
    at scala.collection.immutable.List.foldLeft(List.scala:86)
    at io.gatling.core.structure.StructureBuilder.build(StructureBuilder.scala:33)
    at io.gatling.core.structure.StructureBuilder.build$(StructureBuilder.scala:32)
    at io.gatling.core.structure.ScenarioBuilder.build(ScenarioBuilder.scala:38)
    at io.gatling.core.structure.PopulationBuilder.build(ScenarioBuilder.scala:98)
    at io.gatling.core.scenario.SimulationParams.$anonfun$scenarios$1(Simulation.scala:188)
    at scala.collection.immutable.List.map(List.scala:287)
    at io.gatling.core.scenario.SimulationParams.scenarios(Simulation.scala:188)
    at io.gatling.app.Runner.run0(Runner.scala:95)
    at io.gatling.app.Runner.run(Runner.scala:64)
    at io.gatling.app.Gatling$.start(Gatling.scala:59)
    at io.gatling.app.Gatling$.fromArgs(Gatling.scala:43)
    at io.gatling.app.Gatling$.main(Gatling.scala:35)
    at io.gatling.app.Gatling.main(Gatling.scala)








slan...@gatling.io

unread,
May 23, 2018, 12:06:27 PM5/23/18
to gat...@googlegroups.com
You forgot to specify JmsProtocol for scnMessageID109.

> Le 23 mai 2018 à 17:48, Philipp Gniewosz <knief...@gmail.com> a écrit :
>
> scnMessageID109

Philipp Gniewosz

unread,
May 23, 2018, 12:41:39 PM5/23/18
to Gatling User Group
You are amazing, Stéphane - thanks a lot for spotting this!!!
Reply all
Reply to author
Forward
0 new messages