getting too many follow-up request as response of request - java

we have a Restful web service created using Jersey and running on TomEE 7.0.3
we are using Android platform for client-side and it's using Retrofit for having communication with the server.
our system is modular and contains more than 14 parts.
about 3 weeks (until now), sometimes the clients getting too many follow-up requests as the response.
we searched for it in here and retrofit issues in github.
they said that it might be server falt so we trace the request with ngrep command on the server.
we saw that server was getting the request and also responding to it correctly even when clients get follow-up.
we also test this matter with different networks and this matter still remains.
so what else could cause this problem?

after several tests, we realized that this error is only on Android platforms (we tested the APIs with Postman when Android platforms were receiving Too many follow up request.
so after some more tests, we found out, when Android platforms get 408 as a response code they show this message. we changed the status code and this problem fixed.
I put this issue on square/okhttp repository in github and they put the bug flag on it.
you can see it here
---- update ----
they said it fixed in OkHttp v3.10

Related

How to connect a java client to SignalR Hub using only websockets?

I need to access a websocket server that runs with SignalR Hub, from my Java desktop application.
There is a library that does exactly that, but it's dead. There are lots of issues and pull requests and it hasn't been updated since 2015.
I also found another library but, as far as I can tell, it's only for Android projects.
I found a SO question that says it's possible to talk directly to the SignalR server (standard websocket calls) with some workarounds, but the given link is dead.
When I tried to access the server directly with websocket, the HTTP handshaking fails (I get HTTP 200 instead of 101).
Can anyone help ?
You will not be able to connect to SignalR 2.x with just bare webSocket. The reason for that is that starting the connection requires a few HTTP requests which have to be sent with in a specific order and contain specific content. I described the SignalR protocol in a blog post. After reading this post you will understand why dedicated client for SignalR 2.x existed.
Having said that - the new version of SignalR for ASP.NET Core no longer has this protocol and requirements and it is possible to connect to the server with just bare websockets. I created a demo a while ago showing how to do this - you can find details here. I also started working on an example for the hubs layer but need to finish it.

Capturing Android applicataion traffic using FIddler

So far I managed to capture the traffic of local Java programs & Android browser successfully. However, I failed to capture traffic of my Android application (using HttpsUrlConnection).
While following the steps in this guide to configure the WiFi network on the device, in the step of downloading the certificate I faced an odd behavior as Chrome raised an error and Firefox installed it without opening the expected dialog:
But when I try to download it again, it says that the certificate is already installed.
Anyway, when running my app (on a real device, Karbonn S203 API 19), there are no requests nor tunnels logged in Fiddler. I tried a lot including inspecting this thread to no avail. In other articles I read about showing tunnels only but I don't have them either. Am I missing anything?
Thanks.
EDIT: I managed to install is "correctly" (with the above screen) from Settings -> Security -> Install Certificate after copying if from PC. Still I cannot see the requests in Fiddler.
Apparently the problem occurred due to using some uncommon devices (well, at least uncommon in Europe/North America). They've probably made some configuration changes in their AOSP version. When working the same way with Nexus 5 I managed to add the ceritifcate under 'WiFi' and then captured requests successfully.
Looks like your app does not use Fiddler as a proxy. When you call openConnection do you pass a Proxy object to it? If so, how do you initialize this proxy object?
You might want to try sending some HTTP traffic through first to make sure you are using the correct proxy settings and then try with HTTPS.

Google App Engine gets a 502 error in the client

We have an API with Googe App Engine. The process does as follows. We have two calls to datastore with objetify and a call with urlfetch (to an external API).
We were working normally and suddenly we started to get in the client some 502 errors. There is not error traces in the server. The message we are getting is this one:
Do you have any idea of what is happening??? The only change we made was to release the project with different versions, we did it because somebody in Google support recommended us to do it.
Does it mean that GAE is doing some internal maintenance? if so, shouldn't they tell us in some way.
We talked to Google support. They told us that these errors are unpredictable and expected (if they are in a very small percentage, less than 0.01%). They suggested to do an exponential back-off and retry the request.
The reason why this happened was due to a network connectivity loss for a single machine in Google's wide cluster.

java over http protocol in Loadrunner

I'm doing performance testing for mobile application which is developed in java language and
coming to load runner scripting i'm using java over HTTP as protocol.
Actually i'm not aware of this protocol,i can able to record the application but i don't know whether all the requests got captured or not.
Note:In java over HTTP protocol no generation log and no run time viewer to validate the requests .So how can we validate?
Please share your experience on this protocol and get me out of this issue.
This appears to be a cross post with several posts on facebook. If these other posts are yours then please pick one thread as reference for answers
ShotgunPostsAreSPAM

Issues with Java EWS API

I am using Java EWS API in my web application to connect my application to MS Exchange and read user email requests. Also I am using a scheduler to pull subscription every 1 minute.
Problem is when I start my application, EWS-API works fine. It gets all new mails and processes it. But after few days, whenever the scheduler tries to pull the subscription inbox, the application throws the following error :
microsoft.exchange.webservices.data.ServiceResponseException: The specified subscription was not found.
Maybe it is thread issue or memory issue, I am not sure. Please suggest any reason for this issue.
Have a look at this article, the Client Access Server affinity issue it describes maybe what you are encountering.
http://blogs.msdn.com/b/exchangedev/archive/2011/07/20/client-access-server-affinity-and-network-load-balancing-considerations-for-programmatic-access-to-exchange-online.aspx
Supposedly if you use the EWS Java version 1.1 library (or later) you shouldn't get this particular issue however.
So I'd try checking your EWS library version, and if you still get the problem, add retry logic into your app to recreate the subscription when you encounter this error.
I have been using EWS Push subscription since 2017 so not sure if below might help or not but if you can share your code I can check and see if I can found something.
For Push Subscription I have seen many different errors and to avoid any issues I am using an Object Pool of connection and if I encounter any random error from Exchange Server, I discard current connection and create a new one which mostly solve these kind of issues.
Also you can try setting anchor mailbox while establishing connection it helps with some of the issues.
Also if you can share some sample code I am happy to check.

Categories