No attribute named 'user_account_code1' is defined

Encountering error: No attribute named … , running this code when feeding the csv file (quite long):
Kindly help:
###CSV content:

"Type","MessageId","TopicArn","Message","Timestamp","SignatureVersion","Signature","SigningCertURL","UnsubscribeURL","MessageAttributes__|","MessageAttributes__|__Type","MessageAttributes__|__Value"
"Notification","b78f47a1-4858-4bcf-9756-fc17d783c4bf","arn:aws:sns:eu-west-1:220766614489:b2bmonolith-stage-ListingTopic","{""idAnnonce"":371190801,""idAgence"":240565,""siSupprimer"":false,""refAnnonce"":""Demo boutique"",""cp"":""10552"",""ville"":""Athens"",""adresse"":""69-51 Kodrigktonos"",""idPays"":250,""libelleFr"":""Chambre de service à vendre"",""descriptifFr"":""Description de l'annonce AvivImmo adapté pour apparaitre sur les fronts BD afin de faire du test endToend dans le cadre de la mise en place Caas Ingest au sein du groupe SeLoger"",""idTypeBien"":1,""idTypeTransaction"":2,""dtCrea"":""2023-03-06T08:05:00.000Z"",""dtMaj"":""2023-03-06T08:10:00.000Z"",""refExterne"":""60708-27180"",""siExclusif"":false,""source"":""Import CaaS"",""bQSiCensure"":false,""siCoupDeCoeur"":false,""dtArrivee"":""2023-03-06T08:05:00.000Z"",""transportStation"":""metro 1"",""idTypeTransport"":2,""languesXml"":""<en><descriptif>AvivImmo Description classified with description to do endToend test from CaasIngest to BD website for test group SeLoger integration and respect description critera</descriptif><libelle> APARTMENT SINGLEROOM</libelle><prox>Place note</prox></en>"",""siHandicape"":true,""idSousTypeBien"":49,""siPromo"":false,""genNbPhotos"":0,""genNb360"":0,""siCensureQualite"":false,""indiceQualite"":0,""indiceQualiteTri"":59,""genNbVideos"":0,""siEligibleBD"":false,""raisonNonEligibleBD"":""agence::belles_demeures\r\nType/Sous-type de bien non éligible au luxe.\r\n"",""genNbPhotosAll"":0,""genNb360All"":0,""genNbVideosAll"":0,""rankVisuel"":0,""siWebVisiumMagic"":false,""siIsmh"":false,""idUniversBO"":1,""latitude"":37.996147,""longitude"":23.727851,""siGeolocEchec"":false,""statutPCSLN"":64,""idTypeCensureWi"":0,""siBrouillon"":false,""siHonorairesAcquereur"":true,""siCopropriete"":true,""nbLotsCopropriete"":10,""siProcedureSyndicat"":false,""descriptionProcedureSyndicat"":""fin de la procédure prévue à la fin de l'année"",""siAnnonceLocataire"":false,""siParticulier"":false,""liveVisitState"":1,""idStatutGeoloc"":7,""agence"":{""idClientRcu"":""RC-369450""},""publications"":[1],""vente"":{""px"":800000.5,""siPrixHt"":false,""idTypeResponsableHonoraires"":1},""appartement"":{""anneeConstruct"":""1960"",""bilanConsoEnergie"":""A"",""bilanEmissionGES"":""A"",""consoEnergie"":1,""emissionGES"":1,""estimationMaxCoutDPE"":100.1,""estimationMinCoutDPE"":100.2,""idTypeChauffage"":128,""idTypeCuisine"":1,""nbBalcons"":2,""nbBoxes"":1,""nbChambres"":10,""nbEtages"":5,""nbParkings"":15,""nbPieces"":13,""nbSallesDeBain"":2,""nbTerrasses"":10,""nbToilettes"":2,""refVersionDpe"":2,""siAlarme"":false,""siAscenseur"":false,""siCableTv"":true,""siCalme"":false,""siCave"":false,""siCheminee"":false,""siDpeNonRenseigne"":false,""siDuplex"":false,""siEst"":false,""siJardin"":true,""siLotNeuf"":false,""siMeuble"":true,""siNeuf"":false,""siNord"":false,""siOuest"":true,""siParquet"":true,""siPiscine"":true,""siPlacards"":false,""siPrixParkingsInclus"":false,""siRefaitNeuf"":false,""siSejour"":true,""siSud"":false,""siTerrasse"":true,""siToilettesSeparees"":false,""siTravaux"":false,""siVisavis"":false,""siVue"":false,""surfBalcons"":8,""surfCave"":5.5,""surfJardin"":130.5,""surfSejour"":20.5,""surfTerrasses"":7.5,""surface"":40.5}}","2023-03-06T09:47:01.922Z","1","0/YhHsaUI0Lcrs0n6QAxy/htislxBOOLRyLxvDmZMfiCyvclqFp5RDuLBEvNEtmF4jZGQEnxxzmkvEza3jt+3fA553SHpKfgOoIdGVt45fCkJ/XYC199PC189LeTf696ObdgtKbEFrYZJOGha+qSH2gxGeRJ8NiiFZrppcxndAIUgG1aHBestgni18Jr+lPc/NSUQHsXGHBduxynZOdhQIc2mVkco+wfoLGSImaOMblWoBf7OBZGpP8LbxtGAc7f4q7ZHPr5MMVS6O8g7MdGkERd4sMfYFkwqmT5Yp7Ia0vj+Ef/P3RcctYNRDwe5XbJAQMCQrXrqvP+8fC6P1FDsQ==","https://sns.eu-west-1.amazonaws.com/SimpleNotificationService-56e67fcb41f6fec09b0196692625d385.pem","https://sns.eu-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-west-1:220766614489:b2bmonolith-stage-ListingTopic:2df0495e-ea6a-4903-9231-a8039d8bf7a6","correlationId","String","00-7fb795186408cd469f983bf1d322975e-00b36e9badda71ff-00"
"","","","","","","","","","state","String","CREATED"

###Scala Code####

package frontline.sample


import com.amazonaws.regions.Regions
import io.gatling.core.Predef._
import aws.Predef._
import aws.protocol.AwsProtocolBuilder
import com.amazonaws.auth.{AWSStaticCredentialsProvider, BasicSessionCredentials}
import com.amazonaws.services.sqs.{AmazonSQS, AmazonSQSClientBuilder}
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration
import com.amazonaws.services.sqs.model.SendMessageRequest
import io.gatling.core.feeder.SourceFeederBuilder
import io.gatling.core.structure.ScenarioBuilder

import scala.concurrent.duration._
import scala.language.postfixOps



/**
  * Send message to AWS SQS FIFO queue in batch mode
  * max batchSize is 10
  */

class BasicSimulation extends Simulation {

  val testcsv: SourceFeederBuilder[String] = ssv("result.csv").circular
  val devQueueUrl = "sqs_classified_events"
  val endpoint = "https://sqs.eu-west-1.amazonaws.com"
  val accessKey = "<<access key>>"
  val secretKey = "<<secretkey>>"
  val session_token = "<<sessiontoken>>"
  val batchSize = 10
  val awsCreds = new BasicSessionCredentials(accessKey, secretKey, session_token)

  var client: AmazonSQS = AmazonSQSClientBuilder
    .standard()
    .withCredentials(new AWSStaticCredentialsProvider(awsCreds))
    .withEndpointConfiguration(new EndpointConfiguration(endpoint, Regions.EU_WEST_1.getName)) // update region if needed sqs fifo queue
    .build()

  val awsConfig: AwsProtocolBuilder = Aws
      .batchSize(batchSize)
    .queueUrl(s"$endpoint/$devQueueUrl")
    .awsQueue(client)

  val lambdaScenario: ScenarioBuilder = scenario("SQS FIFO Batch")
    .feed(testcsv, batchSize) // grabs 10 records from the csv at once
    .exec(
      lambda("Send Batch").sendBatch("")
    )

  setUp(
    lambdaScenario.inject(
      constantUsersPerSec(1) during (5 seconds) // 10K
    )
  ).protocols(awsConfig)

}

Hi @Julius,

Not sure what you want to achieve here.
I’m not aware of any AwsProtocolBuilder, so either try to reach the community of this plugin I don’t know, or stick with supported protocol.

For instance: Gatling explains how to Load Test AWS SQS (2019 article)

Cheers!

Also, unless I’ve missed it, there isn’t a single occurrence of user_account_code1 in the sample you’ve provided.

yes, which is also suprising. The code I used is based on this existing github public repository: gatling-sqs/BasicSimulation.scala at master · evertonteotonio/gatling-sqs · GitHub.
It uses hjorders.csv file as a sample demo which has this user_account_code column (might be related to user_account_code1). I am not sure of these are related. I replace this sample csv file to the one I need(result.csv) to use. Basically the csv is originally a json format which I converted to csv to fit to the code. Despite replacing the file, the error is still there which frustrates me as to why, my csv file do not have this user account code1 column.

Hi, my code is based on this github public repository. gatling-sqs/BasicSimulation.scala at master · evertonteotonio/gatling-sqs · GitHub. My aim is to load the csv file to the sqs endpoint dev url. The link you provided is using a jms protocol which only caters string message.

This github project doesn’t seem to be anything more than a work in progress that’s been abandoned since then. Payloads are hardcoded, see gatling-sqs/SqsOrder.scala at master · evertonteotonio/gatling-sqs · GitHub

Don’t try to use it unless you’re willing to complete it yourself.

ah, thank you for identifying this. I can see that this object SqsOrder, def getOrder method is tailor fit for the sample hjorders.csv. How were you able to trace that this method is being called in the main code? I tried doing ctrl + double clicking in each part of the main code and not one led me to the method getOrder.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.