How to access jmeter variable in pepper-box producer?

Multi tool use
Multi tool use


How to access jmeter variable in pepper-box producer?



I am trying to test my kafka-cluster using jmeter and pepper-box pluging.



I am using jmeter and pepper-box plugin for the first time.so excuse me if you feel i am asking some non-sense questions.



I have written a Bean shell pre-processor and there i put UUID in a variable and mark it as jmeter variable


import java.util.UUID;
vars.put("msgUuid",UUID.randomUUID().toString());



now when i am trying to use this variable in my pepper box producer and use this "msgUuid" variable in it then it gives me error saying



symbol: variable msgUuid location: class
MessageIterator1530514979627 1 error Uncaught Exception
java.lang.ClassFormatError: Truncated class file. See log file for
details.



The sample producer is


{
"message_id": "${{msgUuid}}",
"type": "chat",
"sender": "xxx",
"receiver": "yyy",
"stype": "text",
"xml": "message"
"timestamp": "{{TIMESTAMP()}}"
}



Can you please guide me how to fix this?



Thanks in advance.




1 Answer
1



You should refer to Jmeter variables like this ${msgUuid} NOT ${{msgUuid}}.


${msgUuid}


${{msgUuid}}



Also you can use Jmeter function ${__UUID}directly instead of using beanshell code.


${__UUID}



You can find more information about jmeter variables and functions in Jmeter usermanual






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

HFeH4IDDesgUWgKPdI,hFvh3A,7t,Sm8n,p,DOPQrhAILvDv92,q iFOxob
0fvPDkluVDvcZOMW71F8sdqfP Qbp CVuit,cesO7ksmxbaLDqFx01bi9CJW7Q

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications