Whats the difference between sampler types(HttpClient 4,HttpClient 3.1 and Java) - jmeter

I am new to Jmeter.Under 'HTTP(S) Test Script Recorder' elment what is the difference between
HttpClient 4,HttpClient 3.1 and Java Types?
which option will be best for recording?
regadrs.

See the JMeter Documentation of Sampler HTTP_Request:
HTTP Request - this has an implementation drop-down box, which selects the HTTP protocol implementation to be used:
Java - uses the HTTP implementation provided by the JVM. This has some limitations in comparison with the HttpClient implementations - see below.
HTTPClient3.1 - uses Apache Commons HttpClient 3.1. This is no longer being developed, and support for this may be dropped in a future JMeter release.
HTTPClient4 - uses Apache HttpComponents HttpClient 4.x.
Blank Value - does not set implementationon HTTP Samplers, so relies on HTTP Request Defaults if present or on jmeter.httpsampler property defined in jmeter.properties

Related

Performance Testing ActiveMQ Artemis using AMQP protocol

I need to test ActiveMQ Artemis using AMQP protocol (not JMS or MQTT). I am completely new on testing message queues.
Thanks in advance.
Please assist on how to try this in Jmeter or LoadRunner tool.
For JMeter there is JMeter AMQP Plugin. If it's not sufficient for your needs, i.e. doesn't support SASL and you explicitly need this authentication - you will need to go for JSR223 Sampler and Groovy language or even to create your own JMeter Plugin using client libraries of your AMPQ broker.
For loadrunner the approach should be more or less the same

Enabling HTTP/2 on the plain text connector

Following Jetty documentation of enabling HTTP/2,
I reached till the following step,
2015-06-17 14:16:12.549:INFO:oejs.ServerConnector:main: Started
ServerConnector#6f32cd1e{HTTP/1.1,[http/1.1, h2c]}{0.0.0.0:8080}
From the docs,
No major browser currently supports plain text HTTP/2, so the 8080
port will only be able to use HTTP/2 with specific clients (eg curl)
that use the upgrade mechanism or assume HTTP/2.
The documentation mentions "specific clients", but what client I can use for overcoming this issue? I tried okHttp and apache-httpclient, okHttp doesn't support the upgrade mechanism (AFAIK, Would be great if it is otherwise), and apache-httpClient doesn't support h2.
I basically need to make GET/POST request from my program to this endpoint(Obviously, using HTTP/2).
To put in a simple words, Please suggest any Java client which support non-encrypted http/2 (h2c)
Thanks!
Apache HttpCore and HttpClient 5.0 support h2 as well as h2c but presently do not support the http/1.1 to h2c upgrade mechanism. I am not sure they ever will given it is unclear how useful this upgrade mechanism is in the first place.
For code examples please refer to
http://hc.apache.org/httpcomponents-client-5.0.x/examples-async.html
For HttpClient 4.5.x to HttpClient 5.0 upgrade guide please refer to:
https://ok2c.github.io/httpclient-migration-guide/
The Jetty Project has a HTTP client library that can be used as HTTP client and supports HTTP/2, both clear text and encrypted.
You want to look at this documentation.
See also how the Jetty Project uses that same client for tests.

What is implementation option in JMeter and how it actually works?

Could anyone please make me understand what exactly implemantion in JMeter is. How it works if I select different fields in it such as HC4,HC3.1. Also please tell me when to use Java and when to use HC4. Do we have this same feature in HP Load Runner.
Thanks in advance.
I believe HTTP Request sampler documentation contains all the answers:
HTTP Request
this has an implementation drop-down box, which selects the HTTP protocol implementation to be used:
Java
uses the HTTP implementation provided by the JVM. This has some limitations in comparison with the HttpClient implementations - see below.
HTTPClient3.1
(DEPRECATED SINCE 3.0) uses Apache Commons HttpClient 3.1. This is no longer being developed, and support for this will be dropped in a future JMeter release.
HTTPClient4
uses Apache HttpComponents HttpClient 4.x.
Blank Value
does not set implementation on HTTP Samplers, so relies on HTTP Request Defaults if present or on jmeter.httpsampler property defined in jmeter.properties
The Java HTTP implementation has some limitations:
There is no control over how connections are re-used. When a connection is released by JMeter, it may or may not be re-used by the same thread.
The API is best suited to single-threaded usage - various settings are defined via system properties, and therefore apply to all connections.
There is a bug in the handling of HTTPS via a Proxy (the CONNECT is not handled correctly). See Java bugs 6226610 and 6208335.
It does not support virtual hosts.
It supports only the following methods: GET, POST, HEAD, OPTIONS, PUT, DELETE and TRACE
It does not support client based certificate testing with Keystore Config.
So the recommended option is using HTTPClient4 (you don't even have HTTPClient3.1 since JMeter 3.2).
HTTPClient4 is the default implementation so you don't even have to bother about it. If for some reason you need to switch to Java - you can do it in a single shot using HTTP Request Defaults
LoadRunner doesn't have this option as it is uses C language runtime under the hood and JMeter is based on Java.

Why does HTTP Authorization Manager only work if HTTP Request implementation is HTTPClient3.1?

I have configured the HTTP Authorization Manager, but for some reason it only logs in if HTTPClient3.1 is selected as the implementation of my HTTP Request. Furthermore it does not seem like JMeter sends the information at all if Java or HTTPClient4 is selected. I'd like to know why that is the case.
Is it possible to change the configuration in one of the .properties files to get it to work with HTTPClient4? Especially since HTTPCLient3.1 is no longer being developed, and support for this may be dropped in a future JMeter release.
This is a limitation of JMeter as of 2.13 version, see:
https://bz.apache.org/bugzilla/show_bug.cgi?id=57242
Java Implementation does not support this.
Rest assured HttpClient 3.1 will not be dropped soon from JMeter.

Using gzip to compress rest response

I have a rest service which is exposed to end user. This service sends response(say 500K) and the response times are high.
How can we use Gzip to compress the response and send.
I'm using Spring boot and maven.
Thanks in advance.
The GZIP configuration was updated in Spring Boot release 1.3. Now, the correct handling is to use server.compression.enabled property.
server.compression.enabled=true
See the Enable HTTP response compression chapter in the reference docs for configuration details such as response size and content type. Please read the Release Notes for the motivations of this change.
Spring boot allows you to simply configure tomcat to use compression via your application.properties/yaml
server.tomcat.compression: on
(for more options see http://docs.spring.io/spring-boot/docs/1.2.3.RELEASE/reference/htmlsingle/#how-to-enable-http-response-compression)
Look at your container. Many will do this for you transparently at the server level, you shouldn't have to do anything at all with your code.
Consider this Tomcat example.

Resources