Skip to content

Failed to build request: No attribute named inputPayload #139

Open
parimaljanagithub opened this issue Mar 3, 2023 · 0 comments
Open

Failed to build request: No attribute named inputPayload #139

parimaljanagithub opened this issue Mar 3, 2023 · 0 comments

Comments

@parimaljanagithub
Copy link

I am getting this error when i am running the test with more than 40 request per second for at leat 40second.

---- Errors --------------------------------------------------------------------

producedData-to-kafka: Failed to build request: No attribute n 1 (100.0%)
amed 'inputPayload' is defined

I can see messages are getting dropped .

sample code :

val random: Random = new Random(1)
def getProducer(lines: String, properties: Properties): ScenarioBuilder = {

val abcdMap = scala.collection.mutable.Map[String,String]();
val it = properties.stringPropertyNames().iterator();
while(it.hasNext()){
  val key:String = it.next();
  val value1:String = ""+ properties.get(key);
  abcdMap +=(key->value1)
}

val kafkaProducer: ScenarioBuilder = scenario("custom-producer")
  .exec(session=>{
    val currentTimeInMs = System.currentTimeMillis().toString;
    val newPayload:String = lines.replace("\"${currentTimestamp}\"", currentTimeInMs)
    val rValue:String = abcdMap(""+random.nextInt(5000))
    val newPayload2 = newPayload.replace("${custom_cid}",rValue)
    val newSession = session.set("inputPayload",newPayload2)
    newSession
  })
  .exec(
    kafka("producedData-to-kafka")
      .send[String](StringBody("${inputPayload}"))
  )
kafkaProducer

}

With high rps its not able to extract the value from session any reason why this is happening ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant