Skip to content

Failed to build request: No attribute named inputPayload #139

@parimaljanagithub

Description

@parimaljanagithub

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions