assigning custom jndi properties

In the JMS protocol, I have tried to add the custom jndiProperties in the jmsJndiConnectionFactory, but couldn’t the find the exact format of how to add it.
In intelliJ it mentioned as the type: Map[String,String], so I gave like below

.jndiProperties(Map("port" -> "1420"))

and I got the compilation error as below

04:51:42.787 [main][ERROR][ZincCompiler.scala:153] i.g.c.ZincCompiler$ - H:\GatlingScripts\sampleJms\src\test\scala\jmsSimulation.scala:12:24: type mismatch;
found : scala.collection.immutable.Map[String,String]
required: String
.jndiProperties(Map(“port” → “1420”))

I have tried in different format as well, couldn’t get it to work. I couldnt find an example about this in the Gatling Doc as well
Pls help with this

Sujin Sam

That’s property (one by one):

Excerpt from the requirements for posting on this mailing list
*Make sure you're using an up-to-date Gatling version*

My best guess is that you're not running the latest version (3.3.1 as of
now) and that this feature is missing from this version.

[image: Logo] <>
*Stéphane Landelle**Chief Technical Officer*
twitter: @slandelle <>

Hello Stephane

I have a doubt here, I need to add some custom jndi properties

  • do we need to add the custom jndi property in jmsJndiConnectionFactory object or adding it in the exec builder(like the example in the doc) is enough?

  • if we need to add in the jmsJndiConnectionFactory object, then I tried the below two steps:

  1. adding property value in the jmsJndiConnectionFactory as per the doc

val jndiBasedConnectionFactory = jmsJndiConnectionFactory

It threw this error:

11:24:35.782 [main][ERROR][ZincCompiler.scala:153] i.g.c.ZincCompiler$ - H:\GatlingScripts\sampleJms\src\test\scala\jmsSimulation.scala:13:6: value property is not a member of io.gatling
possible cause: maybe a semicolon is missing before `value property’?

  1. IntelliJ suggests that jndiProperties value is available for the jmsJndiConnectionFactory object ( what is this? is this same as property?)
    So, I tried as below

val jndiBasedConnectionFactory = jmsJndiConnectionFactory

it failed as below:

11:26:23.536 [main][ERROR][ZincCompiler.scala:153] i.g.c.ZincCompiler$ - H:\GatlingScripts\sampleJms\src\test\scala\jmsSimulation.scala:13:31: too many arguments (2) for method apply: (k
ey: String)String in trait MapLike

I found this while googling about it :
I’m not an expert in JMS side
can you pls help with it?

was thinking to add the version but forgot
checked the pom.xml, its the latest version 3.3.1






Please, try with property method before the call to contextFactory.

Based on your example:

val jndiBasedConnectionFactory = jmsJndiConnectionFactory
.property(“channel”, “MQ_IS”)

Thanks Sebastien, that worked