Query an embedded Spring Data elasticsearch directly over HTTP? - spring-data-elasticsearch

Is it possible with Spring Data ES to query an embedded ES directly over HTTP without using the Java Client?
How?

Put the http parameter true and it works
<elasticsearch:node-client cluster-name="cluster" http-enabled="true" id="cluster"/>

Related

Enable API Response Compression (gzip) on ServiceStack 5.8.1

We have a ServiceStack 5.8.1 API running in Azure that uses EF Core to run queries against an Azure SQL database that is returning 500,000+ records. Calling the API methods returns a JSON representation of the data down to the client.
The front-end client also running in Azure is an Angular 7.x SPA which is doing HTTP client calls to the API and consuming the returned JSON response.
Is there a way in ServiceStack to enable response compression something like GZIP (not caching - as we want the most recent data on every request) that would send the JSON response back to the Angular client in a compressed format?
If that is possible then we could then look to de-compress the result in the Angular client (if that's possible) so to reduce the amount of data being transferred over the network.
Look at method ToOptimizedResultAsync.
There is also ToOptimizedResultUsingCache if you are wanting responses that were cached.
Also mentioned here Enable gzip/deflate compression
Example:
var response = new SomeViewModel
{
Results = ....
}
return base.Request.ToOptimizedResultAsync(response);

Spring Cloud Data Flow - Http --> HttpClient (pass headers)

Assume a Spring Cloud Dataflow (SCDF) stream like
http|httpclient|custom-app|log
Given I invoke the stream from postman with headers: Content-Type and Custom header (e.g 'fileName')
What would be the approach to pass all the headers from 'http' app to 'custom-app' in above scenario in SCDF.
Issue fix: to configure mapped-request-headers and headers-expression as shown here
I think you need to use mapped-request-headers option in the http application as defined here.

No response when calling read() method of oData model

I have a problem that no data returns when I read an OData service via ODataModel.
But when I copy the request URL directly to web browser I can get through the odata service and the results are listed. Can you please help on this issue?
This was solved because of some CORS coding in the backend services.

CXF post api fails via jmeter

Trying to automate my test cases using jmeter. I have used cxf for rest apis on my web server. I have an api which actually takes a java object as parameter. On jmeter I have selected the POST method under HTTP-request and sending json data in Body data. The api gets called fine. However the parameter comes null and hence by api fails. I did try changing the parameter to String object, however I get this string as null.
Is this the right way to call apis via jmeter. Or is this failing because I have used cxf on my server.
Any help is appreciated.
Thanks
Most likely you need to add a HTTP Header Manager and configure it to send Content-Type header with the value of application/json
See Testing SOAP/REST Web Services Using JMeter for detailed explanation on JMeter configuration for REST API testing.
Other thing you could try out is using SoapUI tool to send the request to your CXF endpoint and if it succeeds - inspect the request and configure JMeter accordingly. By the way, SoapUI has some limited load testing capabilities, may be it will be enough for your scenario

Grails - detect if request is over HTTP or HTTPS

In Grails how do you ask if the request coming in is http or https?
Should you approach this from the request object?
Use request.isSecure(). This isn't a Grails feature btw, it's in the javax.servlet.ServletRequest interface.

Resources