[英]Jmeter JMS point-to-point with dynamic messgae content
I am new to jmeter. 我是jmeter的新手。 I am trying to setup JMS point-to-point load test script.
我正在尝试设置JMS点对点负载测试脚本。 The request message is a fixed-length format.
请求消息是固定长度格式。 I need a way to read fields from csv and arrange them in fixed-length format.
我需要一种从csv读取字段并将它们以固定长度格式排列的方法。 I tried using javascript slice function by using csv data config variables and slicing to required length, concating them all in one line.
我尝试通过使用csv数据配置变量并切片为所需的长度,将它们全部隐藏在一行中来使用javascript slice函数。 But it is not working.
但这是行不通的。 May be my approach is wrong.
可能是我的方法是错误的。 Any pointers on how to make it work with fixed length format will help.
关于如何使其以固定长度格式工作的任何指示都将有所帮助。 This is what I tried:
这是我尝试的:
${__javascript((" ".slice(-6))+(("0000000000000000"+${Var2}).slice(-16)) + ((" " + ${Var3}).slice(-19))+((" "+${Var4}).slice(-3))}
where Var1,Var2..Var4 are from csv. 其中Var1,Var2..Var4来自CSV。
Jmeter version:3.3 Jmeter版本:3.3
MQ: IBM Websphere MQ MQ:IBM Websphere MQ
With a single input message I am able to execute the test. 使用一条输入消息,我就可以执行测试。 I need to dynamically populate values from csv and/or date/time functions and arrange them in fixed-length format.
我需要从csv和/或日期/时间函数动态填充值,并以固定长度格式排列它们。
__javaScript
(mind the capital S
__javaScript
(注意大写S
And last but not the least, in order to get the most performance I would recommend using __substring() function instead of your slice()
function. 最后但并非最不重要的一点,为了获得最佳性能,我建议使用__substring()函数而不是
slice()
函数。 You can install __substring()
and other Custom JMeter Functions using JMeter Plugins Manager 您可以使用JMeter Plugins Manager安装
__substring()
和其他自定义JMeter函数
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.