Not able to connect to iothub using device connection string - Jmeter - jmeter

I am trying to connect 100 mqtt clients to iothub using jmeter.
In mqtt connection panel, for pwd, am using iothubowner connection string (available in shared access policy page in azure portal), from which SAS get generated & using the same in pwd for all 100 clients.
connection is successful as well.
but when i try to use the respective client connection string, from which SAS get generated using device explorer, get applied in pwd and the connection get failed.
Any help pls.

JMeter executes Samplers upside down by each virtual user so you don't need to duplicate this Gateway Connect sampler, just define 2 threads (virtual users) in the Thread Group and each thread (virtual user) will execute Gateway Connect sampler and establish its own connection with the broker.
The credentials can be parameterized using i.e. CSV Data Set Config so each virtual user would connect with its own username/password combination
More information: Testing the MQTT Messaging Broker for IoT - A Guide

Am not sure still why respective connection string is creating props, but in such case, the recommended solution is to use iothubowner connection string from the shared access policy page. It's quite successful.

Related

How to use JMeter to performance test using a laptop systems connected to a VPN instead of the internet

I would like to test the send/receive metrics when connected via a VPN using the JMeter tool then compare the results when not connected to the VPN. Would appreciate any thoughts on this subject.
I don't think there is something you have to do from JMeter perspective as traffic routing is the job for the VPN client so it should be sufficient just to execute the test 2 times:
1 test when the VPN connection is down
2 test when the VPN connection is up
The results can be compared using Merge Results Tool
If for some reason your VPN client doesn't pick up the traffic from JMeter to your application due to its configuration you can force JMeter to use your VPN network interface as the source IP address, the setting lives under "Advanced" tab of the HTTP Request Defaults configuration element

VPN connection in JMeter

I am trying to connect my DB with JMeter (JDBC Connection) but VPN is required to access the DB. I have VPN details with me but know how can I connect with my DB using JMeter?
Thanks in advance
If you have active VPN connection (like the machine you're running JMeter on is connected to the VPN at the moment of test execution) you don't need to do anything, JMeter will be able to connect to the database.
If you don't want to have the VPN connection up all the time and looking for the way of connecting to the VPN prior to executing your test you can:
Use setUp Thread Group and OS Process Sampler to establish the VPN connection before your main Thread Group(s) containing JDBC Test Elements start
Eventually you might go for tearDown Thread Group to disconnect the VPN after main Thread Group(s) execution end.

how to hit total 1000 ssh commands using jmeter by 1000 users (1command/user) using 1 ssh connection

how to hit total 1000 ssh commands using jmeter by 1000 users (1command/user) using 1 ssh connection.
Also is there a way to do ssh connection using private connection in Jmeter ?
Any leads will be helpful.
Thanks Balaram
Your test doesn't make a lot of sense a it is not realistic scenario, i.e. you cannot have 2 users sharing one SSH connection as it is not possible at the SSH protocol level
Using JMeter you can open 1 session per user, you can use the same username and password (or public key), however each JMeter thread (virtual user) will create a separate SSH session (connection) to the server.
So you can implement the above scenario in JMeter, the easiest way is going for SSH Command sampler which can be parameterised via i.e. CSV Data Set Config
You can get SSH Sampler as a part of SSH Protocol Support bundle using JMeter Plugins Manager

client-mode="true" and retryInterval on the inbound adapter with Client Connection factory

In spring Documentation --> 32.6 TCP Adapters it is mentioned that we use clientMode = "true" then the inbound adapter is responsible for the connection with external server.
I have created a flow in which the TCP Adapter with client connection factory makes connection with external server the code for the flow is :
IntegrationFlow flow = IntegrationFlows.from(Tcp.inboundAdapter(Tcp.nioClient(hostConnection.getIpAddress(),Integer.parseInt(hostConnection.getPort()))
.serializer(customSerializer)
.deserializer(customSerializer)
.id(hostConnection.getConnectionNumber())).clientMode(true).retryInterval(1000).errorChannel("testChannel").id(hostConnection.getConnectionNumber()+"adapter"))
.enrichHeaders(f->f.header("CustomerCode",hostConnection.getConnectionNumber()))
.channel(directChannel())
.handle(Jms.outboundAdapter(ConnectionFactory())
.destination(hostConnection.getConnectionNumber()))
.get();
theFlow = this.flowContext.registration(flow).id(hostConnection.getConnectionNumber()+"outflow").register();
I have created multiple flow by iterating over the list of connections and
iterate the above code in for loop and register them in flowcontext with unique ID.
My clients are created successfully with no issue and then establish there connection as supported by topology.
Issue :
I have counted the number of client connection created successfully so I have counted that 7 client connection (7 Integration flow) made successfully and they initiate connection from themselves.
when I create 8th client connection (8th flow created and registered successfully) but the .clientMode(true) is not working means the client don't initiate connection itself after first failure means it try for the first time to make connection if connected successfully then no issue but in case of failure it don't retry again.
Also my other created clients i.e 7 clients connection which are created successfully they also stopped initiating connection from itself when they got disconnected.
Note: There is no issue with flow only the TCP Adapters they stop initiating the connection
The flow is created and registered successfully as there is no issue it is because when I run a control bus command #adapter_id.retryConnection() it got connected with the server.
I don't understand that what is the issue with my flow that i couldn't initiate a connection after a particular count i.e seven or is there limitation in creating number of clients.
One possibility is the taskScheduler's thread pool is exhausted - that shouldn't happen with the above configuration, but it depends on what else is in the application. Take a thread dump (e.g. jstack) to see what the taskScheduler threads are doing.
See the documentation for information about how to configure the threads in the scheduler. However, if it solves it, you should really figure out what task(s) are using scheduler threads for long tasks.
Also turn on DEBUG logging to see if it provides any clues.

Database connection for JDBC request on jmeter

For JDBC request on Jmeter I have configured properly Database Connection Configuration with giving
Database Url- jdbc:mysql://developmentdb.cwwxeukesrtn.ap-southeast-1.rds.amazonaws.com;Development_DB
JDBC Driver Class- com.mysql.jdbc.Driver
Username-...
Password-...
then I create a JDBC request with Select Statementbut after run this request,on the response message got this message-
Response message:
java.sql.SQLException: Cannot create PoolableConnectionFactory (Communications link failure The last packet sent successfully to the
server was 0 milliseconds ago. The driver has not received any packets
from the server.)
Now my question is , how to solve this problem?
You need two basic things to get that done:
Tunneling
mysql.jdbc jar in JMeter lib folder.
For 1st:
Open Putty
Go to Connection >> SSH >> Tunnels
Put down the details as port: 9876
Put down the details as database URL (present in the application config file), e.g:
jdbc:mysql://developmentdb.cwwxeukesrtn.ap-southeast-.rds.amazonaws.com;Development_DB
Add it
Open JMeter >> Add JDBC Connection Configuration
Use DataBase URL as jdbc:mysql://localhost:9876 and the
other details as shown in the picture, like JDBC driver Class
For step 2. Go through this link:
https://www.blazemeter.com/blog/mysql-database-and-jmeter-how-to-test-your-connection/
Looking into Driver/Datasource Class Names, URL Syntax and Configuration Properties for Connector/J article:
I believe you need to replace the semicolon before Development_DB with a slash like:
jdbc:mysql://developmentdb.cwwxeukesrtn.ap-southeast-1.rds.amazonaws.com/Development_DB
For more information on databases load testing see The Real Secret to Building a Database Test Plan With JMeter article.
You might also need to open port 3306 in your operating system firewall and add the relevant Security Group to your instance in order to allow MySQL JDBC traffic.

Resources