Passing the JDBC query values list from one thread group to another

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Passing the JDBC query values list from one thread group to another

Soumya Nayak
Hi Team,

I have a set up thread group where I am running a JDBC request to get some "n" no of row data into 4 variables.
Now I want to access all the above variable values in a loop(for n DB records) in another thread group. How can I achieve this?

For a single variable value access I was able to achieve by defining a bean shell assertion and setting the variable as a property (${__setProperty()) and accessing the property({__property()} in another thread group.  But , how to achieve the same when we have a list of values fetched from JDBC request in one thread group and access all the list another thread group ?

Regards,
Soumya

******************************************************************************************
This message may contain confidential or proprietary information intended only for the use of the
addressee(s) named above or may contain information that is legally privileged. If you are
not the intended addressee, or the person responsible for delivering it to the intended addressee,
you are hereby notified that reading, disseminating, distributing or copying this message is strictly
prohibited. If you have received this message by mistake, please immediately notify us by
replying to the message and delete the original message and any copies immediately thereafter.

If you received this email as a commercial message and would like to opt out of future commercial
messages, please let us know and we will remove you from our distribution list.

Thank you.~
******************************************************************************************
FAFLD
Reply | Threaded
Open this post in threaded view
|

Re: Passing the JDBC query values list from one thread group to another

Divyang Raval
Hi Soumya,

It can be achieved in 2 steps.

Step-1:
Add Regx extractor on JDBC query response to extract target field.
While extracting list of values you can set Match No.= -1.
Let's say variable name in Regx extractor is "listdata".

Step-2 : Add For each controller in test plan and give input variable=
listdata.
And output variable let's say "data".
Check the check box of add _.

Under this controller add your next request where you want to iterate based
on JDBC output you recieved and use ${data} to achieve the target.

Feel free to let me know if you find any difficulty while execution.

Regards,
Divyang


On Mon, Jan 6, 2020, 12:33 PM Soumya Nayak <[hidden email]> wrote:

> Hi Team,
>
> I have a set up thread group where I am running a JDBC request to get some
> "n" no of row data into 4 variables.
> Now I want to access all the above variable values in a loop(for n DB
> records) in another thread group. How can I achieve this?
>
> For a single variable value access I was able to achieve by defining a
> bean shell assertion and setting the variable as a property
> (${__setProperty()) and accessing the property({__property()} in another
> thread group.  But , how to achieve the same when we have a list of values
> fetched from JDBC request in one thread group and access all the list
> another thread group ?
>
> Regards,
> Soumya
>
>
> ******************************************************************************************
> This message may contain confidential or proprietary information intended
> only for the use of the
> addressee(s) named above or may contain information that is legally
> privileged. If you are
> not the intended addressee, or the person responsible for delivering it to
> the intended addressee,
> you are hereby notified that reading, disseminating, distributing or
> copying this message is strictly
> prohibited. If you have received this message by mistake, please
> immediately notify us by
> replying to the message and delete the original message and any copies
> immediately thereafter.
>
> If you received this email as a commercial message and would like to opt
> out of future commercial
> messages, please let us know and we will remove you from our distribution
> list.
>
> Thank you.~
>
> ******************************************************************************************
> FAFLD
>
Reply | Threaded
Open this post in threaded view
|

Re: Passing the JDBC query values list from one thread group to another

Divyang Raval
In reply to this post by Soumya Nayak
Hi Soumya,

It can be achieved in 2 steps.

Step-1:
Add Regx extractor on JDBC query response to extract target field.
While extracting list of values you can set Match No.= -1.
Let's say variable name in Regx extractor is "listdata".

Step-2 : Add For each controller in test plan and give input variable=
listdata.
And output variable let's say "data".
Check the check box of add _.

Under this controller add your next request where you want to iterate based
on JDBC output you recieved and use ${data} to achieve the target.

Feel free to let me know if you find any difficulty while execution.

Regards,
Divyang


On Mon, Jan 6, 2020, 12:33 PM Soumya Nayak <[hidden email]> wrote:

> Hi Team,
>
> I have a set up thread group where I am running a JDBC request to get some
> "n" no of row data into 4 variables.
> Now I want to access all the above variable values in a loop(for n DB
> records) in another thread group. How can I achieve this?
>
> For a single variable value access I was able to achieve by defining a
> bean shell assertion and setting the variable as a property
> (${__setProperty()) and accessing the property({__property()} in another
> thread group.  But , how to achieve the same when we have a list of values
> fetched from JDBC request in one thread group and access all the list
> another thread group ?
>
> Regards,
> Soumya
>
>
> ******************************************************************************************
> This message may contain confidential or proprietary information intended
> only for the use of the
> addressee(s) named above or may contain information that is legally
> privileged. If you are
> not the intended addressee, or the person responsible for delivering it to
> the intended addressee,
> you are hereby notified that reading, disseminating, distributing or
> copying this message is strictly
> prohibited. If you have received this message by mistake, please
> immediately notify us by
> replying to the message and delete the original message and any copies
> immediately thereafter.
>
> If you received this email as a commercial message and would like to opt
> out of future commercial
> messages, please let us know and we will remove you from our distribution
> list.
>
> Thank you.~
>
> ******************************************************************************************
> FAFLD
>
Reply | Threaded
Open this post in threaded view
|

Passing the JDBC query values list from one thread group to another

Soumya Nayak
Hi Divyang,

So the Step – 1 will be in one thread group.
And the Step-2 will be in the other thread group right?

Regards,
Soumya

From: Divyang Raval <[hidden email]>
Sent: Monday, January 6, 2020 12:53 PM
To: Soumya Nayak <[hidden email]>
Cc: JMeter Users List <[hidden email]>
Subject: Re: Passing the JDBC query values list from one thread group to another

Hi Soumya,

It can be achieved in 2 steps.

Step-1:
Add Regx extractor on JDBC query response to extract target field.
While extracting list of values you can set Match No.= -1.
Let's say variable name in Regx extractor is "listdata".

Step-2 : Add For each controller in test plan and give input variable= listdata.
And output variable let's say "data".
Check the check box of add _.

Under this controller add your next request where you want to iterate based on JDBC output you recieved and use ${data} to achieve the target.

Feel free to let me know if you find any difficulty while execution.

Regards,
Divyang


On Mon, Jan 6, 2020, 12:33 PM Soumya Nayak <[hidden email]<mailto:[hidden email]>> wrote:
Hi Team,

I have a set up thread group where I am running a JDBC request to get some "n" no of row data into 4 variables.
Now I want to access all the above variable values in a loop(for n DB records) in another thread group. How can I achieve this?

For a single variable value access I was able to achieve by defining a bean shell assertion and setting the variable as a property (${__setProperty()) and accessing the property({__property()} in another thread group.  But , how to achieve the same when we have a list of values fetched from JDBC request in one thread group and access all the list another thread group ?

Regards,
Soumya

******************************************************************************************
This message may contain confidential or proprietary information intended only for the use of the
addressee(s) named above or may contain information that is legally privileged. If you are
not the intended addressee, or the person responsible for delivering it to the intended addressee,
you are hereby notified that reading, disseminating, distributing or copying this message is strictly
prohibited. If you have received this message by mistake, please immediately notify us by
replying to the message and delete the original message and any copies immediately thereafter.

If you received this email as a commercial message and would like to opt out of future commercial
messages, please let us know and we will remove you from our distribution list.

Thank you.~
******************************************************************************************
FAFLD
Reply | Threaded
Open this post in threaded view
|

Re: Passing the JDBC query values list from one thread group to another

Divyang Raval
I would prefer in same thread group.


On Mon, Jan 6, 2020 at 1:32 PM Soumya Nayak <[hidden email]> wrote:

> Hi Divyang,
>
> So the Step – 1 will be in one thread group.
> And the Step-2 will be in the other thread group right?
>
> Regards,
> Soumya
>
> From: Divyang Raval <[hidden email]>
> Sent: Monday, January 6, 2020 12:53 PM
> To: Soumya Nayak <[hidden email]>
> Cc: JMeter Users List <[hidden email]>
> Subject: Re: Passing the JDBC query values list from one thread group to
> another
>
> Hi Soumya,
>
> It can be achieved in 2 steps.
>
> Step-1:
> Add Regx extractor on JDBC query response to extract target field.
> While extracting list of values you can set Match No.= -1.
> Let's say variable name in Regx extractor is "listdata".
>
> Step-2 : Add For each controller in test plan and give input variable=
> listdata.
> And output variable let's say "data".
> Check the check box of add _.
>
> Under this controller add your next request where you want to iterate
> based on JDBC output you recieved and use ${data} to achieve the target.
>
> Feel free to let me know if you find any difficulty while execution.
>
> Regards,
> Divyang
>
>
> On Mon, Jan 6, 2020, 12:33 PM Soumya Nayak <[hidden email]<mailto:
> [hidden email]>> wrote:
> Hi Team,
>
> I have a set up thread group where I am running a JDBC request to get some
> "n" no of row data into 4 variables.
> Now I want to access all the above variable values in a loop(for n DB
> records) in another thread group. How can I achieve this?
>
> For a single variable value access I was able to achieve by defining a
> bean shell assertion and setting the variable as a property
> (${__setProperty()) and accessing the property({__property()} in another
> thread group.  But , how to achieve the same when we have a list of values
> fetched from JDBC request in one thread group and access all the list
> another thread group ?
>
> Regards,
> Soumya
>
>
> ******************************************************************************************
> This message may contain confidential or proprietary information intended
> only for the use of the
> addressee(s) named above or may contain information that is legally
> privileged. If you are
> not the intended addressee, or the person responsible for delivering it to
> the intended addressee,
> you are hereby notified that reading, disseminating, distributing or
> copying this message is strictly
> prohibited. If you have received this message by mistake, please
> immediately notify us by
> replying to the message and delete the original message and any copies
> immediately thereafter.
>
> If you received this email as a commercial message and would like to opt
> out of future commercial
> messages, please let us know and we will remove you from our distribution
> list.
>
> Thank you.~
>
> ******************************************************************************************
> FAFLD
>
Reply | Threaded
Open this post in threaded view
|

Passing the JDBC query values list from one thread group to another

Soumya Nayak
Hi Divyang,

For same thread group I am able to achieve.
But my requirement is like I have the JDBC request in one thread group and want to pass the values from the JDBC request to another thread group. Why am asking so is there are 16 thread groups which will use the data from the JDBC request , so rather than calling it 16 times I wanted to call once.

Regards,
Soumya

From: Divyang Raval <[hidden email]>
Sent: Monday, January 6, 2020 2:28 PM
To: Soumya Nayak <[hidden email]>
Cc: JMeter Users List <[hidden email]>
Subject: Re: Passing the JDBC query values list from one thread group to another

I would prefer in same thread group.


On Mon, Jan 6, 2020 at 1:32 PM Soumya Nayak <[hidden email]<mailto:[hidden email]>> wrote:
Hi Divyang,

So the Step – 1 will be in one thread group.
And the Step-2 will be in the other thread group right?

Regards,
Soumya

From: Divyang Raval <[hidden email]<mailto:[hidden email]>>
Sent: Monday, January 6, 2020 12:53 PM
To: Soumya Nayak <[hidden email]<mailto:[hidden email]>>
Cc: JMeter Users List <[hidden email]<mailto:[hidden email]>>
Subject: Re: Passing the JDBC query values list from one thread group to another

Hi Soumya,

It can be achieved in 2 steps.

Step-1:
Add Regx extractor on JDBC query response to extract target field.
While extracting list of values you can set Match No.= -1.
Let's say variable name in Regx extractor is "listdata".

Step-2 : Add For each controller in test plan and give input variable= listdata.
And output variable let's say "data".
Check the check box of add _.

Under this controller add your next request where you want to iterate based on JDBC output you recieved and use ${data} to achieve the target.

Feel free to let me know if you find any difficulty while execution.

Regards,
Divyang


On Mon, Jan 6, 2020, 12:33 PM Soumya Nayak <[hidden email]<mailto:[hidden email]><mailto:[hidden email]<mailto:[hidden email]>>> wrote:
Hi Team,

I have a set up thread group where I am running a JDBC request to get some "n" no of row data into 4 variables.
Now I want to access all the above variable values in a loop(for n DB records) in another thread group. How can I achieve this?

For a single variable value access I was able to achieve by defining a bean shell assertion and setting the variable as a property (${__setProperty()) and accessing the property({__property()} in another thread group.  But , how to achieve the same when we have a list of values fetched from JDBC request in one thread group and access all the list another thread group ?

Regards,
Soumya

******************************************************************************************
This message may contain confidential or proprietary information intended only for the use of the
addressee(s) named above or may contain information that is legally privileged. If you are
not the intended addressee, or the person responsible for delivering it to the intended addressee,
you are hereby notified that reading, disseminating, distributing or copying this message is strictly
prohibited. If you have received this message by mistake, please immediately notify us by
replying to the message and delete the original message and any copies immediately thereafter.

If you received this email as a commercial message and would like to opt out of future commercial
messages, please let us know and we will remove you from our distribution list.

Thank you.~
******************************************************************************************
FAFLD
Reply | Threaded
Open this post in threaded view
|

Re: Passing the JDBC query values list from one thread group to another

shettyd
Hi
if you want to pass complex data between thread groups /threads , you can
a. Use properties like you mentioned. Complex data needs complex schemes
(e.g. Store a JSON string which can have an array of objects and parse it)
- Messy for most,non simple, use cases
b. Use a plugin like
https://jmeter-plugins.org/wiki/InterThreadCommunication/ . Useful when
data is to be generated and consumed at the same time.
c. Use something that can be shared across thread groups - e.g. Files /
RDBMS / Redis etc. So in your example use a setup thread group and write
the data you want to a CSV file and then read it from the following
threadgroups that need it. In your case you seem to be implying that you
want to generate the data once and then read it from multiple thread groups.
d. Write your own java code that can deal with data as it wishes.
Bear in mind , what you want to happen if you distribute this script across
multiple JMeter servers - some sharing methods are scoped to the JVM(in
memory) , others to the host (files) and others to the script (DB)

regards
dee[al

On Mon, Jan 6, 2020 at 1:01 AM Soumya Nayak <[hidden email]> wrote:

> Hi Divyang,
>
> For same thread group I am able to achieve.
> But my requirement is like I have the JDBC request in one thread group and
> want to pass the values from the JDBC request to another thread group. Why
> am asking so is there are 16 thread groups which will use the data from the
> JDBC request , so rather than calling it 16 times I wanted to call once.
>
> Regards,
> Soumya
>
> From: Divyang Raval <[hidden email]>
> Sent: Monday, January 6, 2020 2:28 PM
> To: Soumya Nayak <[hidden email]>
> Cc: JMeter Users List <[hidden email]>
> Subject: Re: Passing the JDBC query values list from one thread group to
> another
>
> I would prefer in same thread group.
>
>
> On Mon, Jan 6, 2020 at 1:32 PM Soumya Nayak <[hidden email]<mailto:
> [hidden email]>> wrote:
> Hi Divyang,
>
> So the Step – 1 will be in one thread group.
> And the Step-2 will be in the other thread group right?
>
> Regards,
> Soumya
>
> From: Divyang Raval <[hidden email]<mailto:[hidden email]>>
> Sent: Monday, January 6, 2020 12:53 PM
> To: Soumya Nayak <[hidden email]<mailto:[hidden email]>>
> Cc: JMeter Users List <[hidden email]<mailto:
> [hidden email]>>
> Subject: Re: Passing the JDBC query values list from one thread group to
> another
>
> Hi Soumya,
>
> It can be achieved in 2 steps.
>
> Step-1:
> Add Regx extractor on JDBC query response to extract target field.
> While extracting list of values you can set Match No.= -1.
> Let's say variable name in Regx extractor is "listdata".
>
> Step-2 : Add For each controller in test plan and give input variable=
> listdata.
> And output variable let's say "data".
> Check the check box of add _.
>
> Under this controller add your next request where you want to iterate
> based on JDBC output you recieved and use ${data} to achieve the target.
>
> Feel free to let me know if you find any difficulty while execution.
>
> Regards,
> Divyang
>
>
> On Mon, Jan 6, 2020, 12:33 PM Soumya Nayak <[hidden email]<mailto:
> [hidden email]><mailto:[hidden email]<mailto:[hidden email]>>>
> wrote:
> Hi Team,
>
> I have a set up thread group where I am running a JDBC request to get some
> "n" no of row data into 4 variables.
> Now I want to access all the above variable values in a loop(for n DB
> records) in another thread group. How can I achieve this?
>
> For a single variable value access I was able to achieve by defining a
> bean shell assertion and setting the variable as a property
> (${__setProperty()) and accessing the property({__property()} in another
> thread group.  But , how to achieve the same when we have a list of values
> fetched from JDBC request in one thread group and access all the list
> another thread group ?
>
> Regards,
> Soumya
>
>
> ******************************************************************************************
> This message may contain confidential or proprietary information intended
> only for the use of the
> addressee(s) named above or may contain information that is legally
> privileged. If you are
> not the intended addressee, or the person responsible for delivering it to
> the intended addressee,
> you are hereby notified that reading, disseminating, distributing or
> copying this message is strictly
> prohibited. If you have received this message by mistake, please
> immediately notify us by
> replying to the message and delete the original message and any copies
> immediately thereafter.
>
> If you received this email as a commercial message and would like to opt
> out of future commercial
> messages, please let us know and we will remove you from our distribution
> list.
>
> Thank you.~
>
> ******************************************************************************************
> FAFLD
>
Reply | Threaded
Open this post in threaded view
|

Passing the JDBC query values list from one thread group to another

Soumya Nayak
Hi Deepak ,

Thanks for the reply. I tried with points a and c , was able to achieve that.
Will try with b and d option also and let you know if any issues.

Regards,
Soumya

-----Original Message-----
From: Deepak Shetty <[hidden email]>
Sent: Tuesday, January 7, 2020 4:13 AM
To: JMeter Users List <[hidden email]>
Cc: Divyang Raval <[hidden email]>
Subject: Re: Passing the JDBC query values list from one thread group to another

Hi
if you want to pass complex data between thread groups /threads , you can a. Use properties like you mentioned. Complex data needs complex schemes (e.g. Store a JSON string which can have an array of objects and parse it)
- Messy for most,non simple, use cases
b. Use a plugin like
https://jmeter-plugins.org/wiki/InterThreadCommunication/ . Useful when data is to be generated and consumed at the same time.
c. Use something that can be shared across thread groups - e.g. Files / RDBMS / Redis etc. So in your example use a setup thread group and write the data you want to a CSV file and then read it from the following threadgroups that need it. In your case you seem to be implying that you want to generate the data once and then read it from multiple thread groups.
d. Write your own java code that can deal with data as it wishes.
Bear in mind , what you want to happen if you distribute this script across multiple JMeter servers - some sharing methods are scoped to the JVM(in
memory) , others to the host (files) and others to the script (DB)

regards
dee[al

On Mon, Jan 6, 2020 at 1:01 AM Soumya Nayak <[hidden email]> wrote:

> Hi Divyang,
>
> For same thread group I am able to achieve.
> But my requirement is like I have the JDBC request in one thread group
> and want to pass the values from the JDBC request to another thread
> group. Why am asking so is there are 16 thread groups which will use
> the data from the JDBC request , so rather than calling it 16 times I wanted to call once.
>
> Regards,
> Soumya
>
> From: Divyang Raval <[hidden email]>
> Sent: Monday, January 6, 2020 2:28 PM
> To: Soumya Nayak <[hidden email]>
> Cc: JMeter Users List <[hidden email]>
> Subject: Re: Passing the JDBC query values list from one thread group
> to another
>
> I would prefer in same thread group.
>
>
> On Mon, Jan 6, 2020 at 1:32 PM Soumya Nayak <[hidden email]<mailto:
> [hidden email]>> wrote:
> Hi Divyang,
>
> So the Step – 1 will be in one thread group.
> And the Step-2 will be in the other thread group right?
>
> Regards,
> Soumya
>
> From: Divyang Raval
> <[hidden email]<mailto:[hidden email]>>
> Sent: Monday, January 6, 2020 12:53 PM
> To: Soumya Nayak <[hidden email]<mailto:[hidden email]>>
> Cc: JMeter Users List <[hidden email]<mailto:
> [hidden email]>>
> Subject: Re: Passing the JDBC query values list from one thread group
> to another
>
> Hi Soumya,
>
> It can be achieved in 2 steps.
>
> Step-1:
> Add Regx extractor on JDBC query response to extract target field.
> While extracting list of values you can set Match No.= -1.
> Let's say variable name in Regx extractor is "listdata".
>
> Step-2 : Add For each controller in test plan and give input variable=
> listdata.
> And output variable let's say "data".
> Check the check box of add _.
>
> Under this controller add your next request where you want to iterate
> based on JDBC output you recieved and use ${data} to achieve the target.
>
> Feel free to let me know if you find any difficulty while execution.
>
> Regards,
> Divyang
>
>
> On Mon, Jan 6, 2020, 12:33 PM Soumya Nayak <[hidden email]<mailto:
> [hidden email]><mailto:[hidden email]<mailto:[hidden email]
> m>>>
> wrote:
> Hi Team,
>
> I have a set up thread group where I am running a JDBC request to get
> some "n" no of row data into 4 variables.
> Now I want to access all the above variable values in a loop(for n DB
> records) in another thread group. How can I achieve this?
>
> For a single variable value access I was able to achieve by defining a
> bean shell assertion and setting the variable as a property
> (${__setProperty()) and accessing the property({__property()} in
> another thread group.  But , how to achieve the same when we have a
> list of values fetched from JDBC request in one thread group and
> access all the list another thread group ?
>
> Regards,
> Soumya
>
>
> **********************************************************************
> ******************** This message may contain confidential or
> proprietary information intended only for the use of the
> addressee(s) named above or may contain information that is legally
> privileged. If you are not the intended addressee, or the person
> responsible for delivering it to the intended addressee, you are
> hereby notified that reading, disseminating, distributing or copying
> this message is strictly prohibited. If you have received this message
> by mistake, please immediately notify us by replying to the message
> and delete the original message and any copies immediately thereafter.
>
> If you received this email as a commercial message and would like to
> opt out of future commercial messages, please let us know and we will
> remove you from our distribution list.
>
> Thank you.~
>
> **********************************************************************
> ********************
> FAFLD
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]