I have checked-in 'Generate parent sample' for a transaction controller which has a few HTTP requests. Aggregate Report shows only the transaction controller name but Simple Data Writer report shows both the transaction controller name and the HTTP requests under that. Is there a way to see the Simple data writer with only the transaction controller names and not the HTTP requests underneath?
Thanks,
N
Try running JMeter as:
jmeter -Jjmeter.save.saveservice.subresults=false
if it produces the output you want - you can make the change permanent by adding the next line to user.properties file:
jmeter.save.saveservice.subresults=false
More information:
Results file configuration
Configuring JMeter
Apache JMeter Properties Customization Guide
Related
I have quarkus.http.enable-compression=true in my src/main/resources/application.properties file, and with Quarkus 2.8.3.Final it works as expected. i.e. HTTP requests with an Accept-Encoding: gzip header receive a gzip'd response body.
But when I update to Quarkus 2.9.0.Final (or later) quarkus.http.enable-compression=true seems to be ignored, and HTTP response bodies are no longer gzip'd.
I see from the Migration Guide 2.9 that "HTTP compression settings have been made build time configuration so they cannot be overridden at runtime anymore." But my understanding is that application.properties can hold both build time and runtime configuration.
I also tried taking the setting out of application.properties and instead:
quarkus:dev -Dquarkus.http.enable-compression=true
That works on 2.8.3.Final, but not on 2.9.0.Final.
What am I missing?
yes, the migration guide is incomplete. Previously, all HTTP responses were compressed if the config property quarkus.http.enable-compression was set to true. Since 2.9 the response body is compressed if quarkus.http.enable-compression=true AND:
A JAX-RS resource method or a reactive route is annotated with #io.quarkus.vertx.http.Compressed, or
The Content-Type header is set and the value is a compressed media type as configured via quarkus.http.compress-media-types.
See also:
https://quarkus.io/guides/resteasy-reactive#http-compression
https://quarkus.io/guides/reactive-routes#http-compression
https://quarkus.io/guides/http-reference#http-compression
We use MDC to add a request id to HTTP requests in our Spring Boot application using SLF4J.
We do this by adding a GenericFilterBean that intercepts the request, converts to HTTTP, and writes the desired information to MDC.put(...);
What is the correct pattern for doing this on, for example, a QuartzJob that uses a CronTrigger to launch jobs? Or a Spring Batch job?
I solved it for Spring Batch by adding a JobExecutionListener, similar to what you have done for the HTTP with the GenericFilterBean.
In beforeJob() you can do MDC.put(...); and in afterJob() you can do MDC.remove(...);
Also, I added a TaskDecorator to copy the DMC from the parent thread to the sub-threads in case of a multi-threaded Job.
You can find a more detailed answer with code, here:
https://stackoverflow.com/a/68347374/6837191
I am using spring-boot with open-tracing enabled for microservices developement.
I would like to print the 'uber-trace-id' header value in my log file. I understand that I can load that value into MDC context and print it in log file. I am thinking of implementing a 'HandlerInterceptor' and intercept each request to look for 'uber-trace-id' header and load its value to MDC context so that I can print in log file. Is it the right method? Anyother better possible approach is there ?
I am trying to test some JDBC methods using apache jmeter like getFunctions. I have successfully created DB connection and executed a query to create one function.
Now I wanted to test the output of getFunctions method. For this I am using JDBC Request Sampler. I have done below configuration for the JDBC request Sampler to test this method
When I run this Test I am getting below error
Response message: java.sql.SQLSyntaxErrorException: [XXXX][SQLServer JDBC Driver][SQLServer]Line 1: Incorrect syntax near 'NULL'.
I tried 'NULL' , "NULL" and $NULL$ but all are giving same exception.
Can someone please guide me how can I test such methods using JDBC request in Apache Jemeter
As far as I can see from getFunctions() method description it is applicable to DatabaseMetaData therefore unfortunately you won't be able to use JDBC Request sampler for testing this method.
The solution would be switching to JSR223 Sampler and Groovy language, the relevant code would be something like:
def conn = org.apache.jmeter.protocol.jdbc.config.DataSourceElement.getConnection('foo')
def resultSet = conn.getMetaData().getFunctions(null,null,null)
Demo:
I have setup a Spring Integration flow configuration to send messages to an external web service and then unmarshalling the response and then doing some post processing based on the response object type.
I have the following outbound-gateway configuration:
<int:channel id="sendRequestChannel"/>
<ws:outbound-gateway request-channel="sendRequestChannel" uri="${send.ws.uri}" reply-channel="responseTransformer" >
<ws:request-handler-advice-chain>
<ref bean="retryAdviceUserUpdateWs" />
</ws:request-handler-advice-chain>
</ws:outbound-gateway>
Now, I want to test the flow and check that the correct post processing is triggered based on the response object.
Is there anyway in my integration test to mock the Endpoint response based on the message I'm sending?
Actually you should understand from which part of your flow it would be better to mock and return the desired response.
You can inject ChannelInterceptor to the sendRequestChannel with preSend which returns null, to prevent the further process and send a message with desired response to the responseTransformer.
Another powerful option is to add one more Advice to the <ws:request-handler-advice-chain> and implement it as extension of AbstractRequestHandlerAdvice.
And the last option which I see via Java code is a mock for WebServiceTemplate.sendAndReceive and inject it to the <ws:outbound-gateway>.
From other side I know that SoapUI has a tool to mock target service, so, you even don't need to do anything in Java, unless tests.
So, it up to you to choose the proper way to test you flow.