How to restart listening Twitter straming Api Again? - twitter-streaming-api

I'm using Twitter4j to get Tweets real time via. Twitter streaming API and it is working fine . Sometime it throws Exception due to network connecting issue(or some other reason) which is also OK to me however I'm not able to recover from this condition & it require server restart . Can someone please suggest how to restart listening Twitter straming Api Again without server restart . We have TwitterStreamFactory & TwitterStream class in Twitter4j. Many thanks in advance .

You should create a handler for such exceptions and in it create a loop that tries to start listening a few times before erroring out.

Related

kotlin https request timeout using ktor httpclient suggestions

i have an app that is being used in many places across my country and it comunicated with a flask server (deployed on apache).
sometimes the reception is not so good in areas of my country. my users sometimes fetching/sending data to the server, but its loading too much time and then its fails/ stuck. i think somthing is lost in the comunication between the app and the server. also, it happend from 6:am in the morning where i guess there are more activity/load on the server
what is the best configuration to apply in this case for the http request:
this is what i use.
requestTimeoutMillis = 15000
connectTimeoutMillis = 10000
socketTimeoutMillis = 10000
further more, if anybody have a suggestion for a protocol that can "hide" this behevior from the user. they tell me that if its stuck, they going to surf on some website like facebook, go back to the app, then try to press the send button again and its working.
thanks

I have a web server Apache setup question

Good morning . For the first time I have written to stackoverflow.
Currently we have a running server. We are using Apache as the web server and WebLogic 10.3.6 as the WAS server.
There is a problem here ... The WAS server has an action that generates a specific error code when accessing it directly. This particular error code is the 902 error code.
When you log in again, you will be given an error code of 902. If you access WAS directly, it will return error code 902.
However, when you access the web server (domain address), it will return a 500 error code instead of 902. Obviously this seems to be a problem with setting up a web server. I do not know where to return the 500 error code instead of the 902 error code.
Do you have any of these in your Apache configuration? I did not set up my own web server but I did not know that someone else was going out.
If you have a similar experience, please help. Thank you.
Attach a photo caputured by Developer Tools.

Play 2.1.0 + Apache 2.2 Reverse proxy => 502 proxy error when idle

Config
We have a play 2.1.0 with angularjs setup in a production mode.
We have reverse proxy load balancer setup with apache 2.2 something like mentioned in here
http://www.playframework.com/documentation/2.1.0/HTTPServer
This whole app is running in an iframe inside navigated from a jboss application.
Problem
Most of the time it works and sometimes when the connection is left idle for 2/3 hours, untouched, no one hit the reverse proxy url to load the jboss/play, then we are getting the 502 proxy error in the iframe content after a few mins wait.
Play receives the request, but somehow decides not to respond at all. This occurs only for the first time or couple of time after the wakeup. Then when we refresh the page play receives the request and responds it properly.
Tried
We get a tcpdump on the play port and it we have got all the requests being received, but no response sent from play for the failed scenario. Whereas the same request got responded by play subsequent times.
X-Forwarded-For: ,X-Forwarded-Host: X-Forwarded-Server: .. Connection: Keep-Alive - all these headers are being sent in the lost response tcpdump.
Tried KeepAlive, with timeouts in the proxy server, not much help. Why the play didn't respond for the initial connections after idle state, is there any conf we can set to keep it alive?
Workaround
Polling the play server url constantly every half an hour from the same server makes this issue not reproducible.
Still any help/suggestions would be really appreciated to fix this issue..
I tried to solve this problem myself. Approaches like the answers mentioned here and here did not change anything.
I then decided to go for nginx again which I have been using with Play applications before. The setup is to be found here. Since then the problem is gone.

Can uplodading a file using org.apache.net.ftp wait infinitely?

I am using apache.net.ftp api to download from and upload to ftp server. Its working fine in normal scenarios.
But the issue starts when there is some latency or connection is closed by the server for some reasons.
Here comes the time-out. I found a parameter 'SO_TIMEOUT' which is considered when reading from socket. So, I used ftpClient.setSoTimeout(time in millis) method to set it which will be used while downloading a file. It worked fine.
I am not getting how to set time-out while uploading the file to the ftp-server.
Thanks in advance.
Check the following things to make sure everything is running fine,and then try again::
Check the Firewall setting,if any which might be blocking the incoming connections and the connection timeout.

sipml5 webrtc not able to hold a call or transfer

Registered the users Bob , alice and hunt on local installation of kamailio server on linux redhat . The sipml5 is able to register all the three users and make calls as well as send instant message over sip .
The bad functionality of Call transfer and call hold-resume have worn out my energies .
So far I have tested and tried Sipml5 client with Officesip (without webrtc2sip) , sip2sip.info (without webrtc2sip) , opencloud Rhino (with webrtc2sip) and Kamalio (without webrtc2sip) , but the problem of error generation on sip reinvite persists .
Any help / hint to make Call transfer and call hold-resume work in sipml5 will be great.
ps: I have already posted the questions on webrtc and sipml5 google groups and issue sites however no helpful response as yet .
You could try using the native AMI. I also had the same problems trying to make hold and transfer work but eventually I gave up, implemented them using PAMI ( Php AMI ) + Ajax
Here's the link. I hope this helps
http://marcelog.github.io/PAMI/