Comments (4)
I am able to solve this by adding "autoDelete" tag in the declare.
.declare(queue("measurement_data_hino_us_pilot_uat",autoDelete = false))
I am trying to publish 100kb json date. I have stored the data in file and i am trying to use the file name in "textMessage" attribute. I am not able publish the data, could you please help with this ?
package simulations
import io.gatling.core.Predef._
import io.gatling.core.structure.{ChainBuilder, ScenarioBuilder}
import ru.tinkoff.gatling.amqp.Predef._
import ru.tinkoff.gatling.amqp.protocol.AmqpProtocolBuilder
class PublishWithFeeeder extends Simulation{
//val publishMessage = ElFileBody("src/test/resources/testData/publish.json")
val publishMessage = jsonFile("src/test/resources/testData/publish.json")
val amqpConf: AmqpProtocolBuilder = amqp
.connectionFactory(
rabbitmq
.host("hasty-whale.rmq.cloudamqp.com")
.port(5672)
.username("HINO_US_PILOT_Fleet_Management")
.password("RVkjh2pFu18KGVCc")
.vhost("fdc97e13-563c-41b1-843b-1ecf7dbc62d3")
)
.declare(queue("measurement_data_hino_us_pilot_uat",autoDelete = false))
def publishMessageWithFeeder(): ChainBuilder ={
repeat(1){
.exec(
amqp("publish to us_pilot_uat")
.publish
.queueExchange("measurement_data_hino_us_pilot_uat")
.textMessage("$publishMessage")
.priority(0))
}
}
val scn = scenario("Message Publish with Feeder")
.exec(publishMessageWithFeeder())
setUp(
scn.inject(atOnceUsers(1))).protocols(amqpConf)
}
also, i tried to add validaiton like "check" and its not available. Could you please help on this as well ?
from gatling-amqp-plugin.
Hello @naveenincture.
jsonFile
works differently, look in the gatling documentation.
In your caseElFileBody
is correct solution, but you need to save file content in session before use it intextMessage
.
Something like this may help:
import io.gatling.commons.validation.SuccessWrapper
...
val publishMessage = ElFileBody("testData/publish.json").expression
...
.exec { session =>
for {
json <- publishMessage(session)
r <- session.set("publishMessage", json).success
} yield r
}
.exec(
amqp("publish to us_pilot_uat")
.publish
.queueExchange("measurement_data_hino_us_pilot_uat")
.textMessage("$publishMessage")
.priority(0))
check
is not available becausepublish
only publish message and not receive response. And for check need response. If you need response userequestReply
from gatling-amqp-plugin.
Thank you :) I am able to publish the message using ElFileBody as below.
Really appreciate the reply. I am getting started with Gatling and facing an another issue. I have seeked help from community as well. It would be really helpful, if you can give some inputs.
package simulations
import io.gatling.core.Predef._
import io.gatling.core.structure.{ChainBuilder, ScenarioBuilder}
import ru.tinkoff.gatling.amqp.Predef._
import ru.tinkoff.gatling.amqp.protocol.AmqpProtocolBuilder
class PublishWithFeeeder extends Simulation{
val csvFeederVINNumber = csv("testData/vinNumber.csv").circular
val amqpConf: AmqpProtocolBuilder = amqp
.connectionFactory(rabbitmq
.host("hasty-whale.rmq.cloudamqp.com")
.port(5672)
.username("username")
.password("password")
.vhost("host"))
.declare(queue("measurement_data_hino_us_pilot_uat",autoDelete = false))
def publishMessageWithFeeder(): ChainBuilder ={
feed(csvFeederVINNumber)
.exec(amqp("publish to us_pilot_uat")
.publish
.queueExchange("measurement_data_hino_us_pilot_uat")
.textMessage(ElFileBody("testData/publish.json"))
.priority(0)
.contentType("application/json"))
.pause(1)
}
val scn: ScenarioBuilder = scenario("Message Publish with Feeder")
.exec(publishMessageWithFeeder())
setUp(
scn.inject(atOnceUsers(1))).protocols(amqpConf)
}
Issue Link : https://stackoverflow.com/questions/66950680/using-timestamp-in-json-file-in-gating
Description :
I have json file in below format
Scenario :
Publishing message into RabbitMQ using Gatling.
I have saved the json file in resource folder.
Passing json file using "ElFileBody" builder.
i have to get the current timestamp and increment current time accordingly in the downstream timestamps. Attached below ex
Could you please help in generating the timestamp, how can we increment/decrement the current timestamps by seconds/minutes/hours/days and pass directly in json file.
{
"series": {
"uid": "60329dd7-cc15-43ca-ac5d-6907126b017a",
"seriesName": "APP",
"valueType": "DOUBLE",
"description": "",
"signalCollectionId": "ed6a6744-32c7-4f96-969c-8e1bd1b26f41",
"sourceId": "70f15369-9ac0-4533-8f49-c7f0326a2a05",
"sourceName": "v7r2_J_ENG_DEC",
"unit": "%",
"protocol": "CAN_RAW",
"type": "SIGNAL",
"samplingRate": 1000
},
"dataPoints": [
{
"uniqueId": "34ad93e0-bdb3-4cbc-8354-ab59a808960f",
"timeStamp": "2021-03-15T13:13:01.111Z", //Current timestamp
"value": 0
},
{
"uniqueId": "f901ec1e-5fd5-4015-97ad-b14aadae17ff",
"timeStamp": "2021-03-15T13:13:11.111Z", //Current timestamp + 10 seconds
"value": 0
},
{
"uniqueId": "abc79341-2388-447c-8bd1-4671c791f9b9",
"timeStamp": "2021-03-15T13:13:21.111Z", //Current timestamp + 20 seconds
"value": 0
}
]
}
Thank you :)
Naveen.
from gatling-amqp-plugin.
Наркоманы, грохните тред к хуям, там же креды к AMQP инстансу попалены.
Инстанс живой, там что-то вертится, какие-то данные в наличии.
FYI @naveenincture use translate.google.com, please. I'm just fuck English in 04:30 AM, sorry.
FYI @red-bashmak @icyberdeveloper [email protected]
from gatling-amqp-plugin.
Related Issues (20)
- Include bytesMessage in PublishDslBuilderMessage.java HOT 2
- Known issues for requestReply? HOT 4
- Request/Reply Message Matching using headers HOT 4
- If a messages could not be matched than the test should output failed counter HOT 1
- How do I configure two messageBrokers HOT 1
- AmqpConnectionPool should check whether connection is open HOT 1
- Support for gatling 3.5? HOT 2
- Connecting with an existing queue/exchange? HOT 2
- MessageMatcher.prepareRequest not used
- how to run these tests HOT 1
- Generating timestamps - Json file HOT 1
- Request/Reply : send message in Exchange reply in multi exchange HOT 1
- How to use consume request separately? HOT 1
- Simulation blocked when more than 7 scenarios HOT 3
- SSL connection to Rabbit HOT 1
- Adding support for fanout exchange HOT 4
- Got the following errors when I used PublishExample.scala HOT 4
- Message id matching in request-reply
- Binding Multiple Queues
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatling-amqp-plugin.