@Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    {
        synchronized (this) {
            if (lastItems == null || Duration.between(lastRSSFetch, Instant.now()).compareTo(REFRESH.getDefaultValue()) > 0) {
                Log.debug("Trying to obtain latest blog posts from IgniteRealtime.org");

                final String proxyHost = UpdateManager.PROXY_HOST.getValue();
                final int proxyPort = UpdateManager.PROXY_PORT.getValue();

                final HttpRoutePlanner routePlanner;
                if (proxyHost != null && !proxyHost.isEmpty() && proxyPort > 0) {
                    routePlanner = new DefaultProxyRoutePlanner(new HttpHost(proxyHost, proxyPort, "http"));
                } else {
                    routePlanner = new DefaultRoutePlanner(null);
                }
                final HttpGet httpGet = new HttpGet(URL.getValue());

                try (final CloseableHttpClient client = HttpClients.custom().setRoutePlanner(routePlanner).build();
                     final CloseableHttpResponse httpResponse = client.execute(httpGet);
                     final InputStream stream = httpResponse.getEntity().getContent()) {

                    lastItems = parseFirstEntries(stream, 7);
                    lastRSSFetch = Instant.now();
                } catch (final Throwable throwable) {
                    Log.warn("Unable to download blogposts from igniterealtime.org", throwable);
                }
            }
        }

        final JSONObject result = new JSONObject();
        result.put("items", lastItems);

        response.setContentType("application/json");
        response.setCharacterEncoding("UTF-8");
        response.getWriter().write(result.toString(2));
    }
Servlet used for retrieval of IgniteRealtime's blog's RSS feed.

@author Guus der Kinderen, guus.der.kinderen@gmail.com
xmppserver/src/main/java/org/jivesoftware/admin/servlet/BlogPostServlet.java