Gatling: How to Write JDBC Feeder Value to a file

I am trying to write output of JDBC feeder in gatling in below fashion but its not working.

def Getdata() = {
  val jdbcFeeder1 = jdbcFeeder(dbConnectionString,dbUserName,dbUserPassword,targetQuery)
  val outputFilePath = System.getProperty("user.dir") + "/src/gatling/resources/data/createddata.dat"
  scenario("Write data To file")
    .feed(jdbcFeeder1)
    .exec { session =>
      val writer1 = new PrintWriter(new FileOutputStream(outputFilePath, true))
      writer1.write(session.getAttribute("firstname").as[String] + "\n")
      writer1.close();
      session
  }
}

Hi!

What is not working? What is the expected output, what do you see?

Why a method to generate a scenario? I don’t get what you want to achieve.

Please, provide a reproducer to help us to help you.

Cheers!

issue resolved.thanks

Hi!

Glad to know you solved your issue!

For future readers sake, can you tell us what was your solution?

Cheers!