The java application I'm working on is having some problems when connecting to pushwoosh server. A ConnectionException is thrown with some frequency, and it has been growing for the past 2 weeks.
The tallest bar indicates 677 events
The code I'm using is basically this:
URL url = new URL("https://cp.pushwoosh.com/json/1.3/createMessage"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type", "application/json"); connection.setDoInput(true); connection.setDoOutput(true); DataOutputStream writer = new DataOutputStream(connection.getOutputStream()); // exception thrown here writer.write(request.getBytes("UTF-8")); writer.flush(); writer.close();
How can I ensure the connection with the pushwoosh server? I thought about retrying the connection, but I'm afraid it could overload, instead of resolving the problem.
Please sign in to leave a comment.