@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { if (getSolrConfiguration() == null) { throw new SiteWhereException("No Solr configuration provided."); } try { // Create and start Solr connection. this.solrConnection = new SolrConnection(getSolrConfiguration()); getSolrConnection().start(monitor); getLogger().info("Attempting to ping Solr server to verify availability..."); SolrPingResponse response = getSolrConnection().getSolrClient().ping(); int pingTime = response.getQTime(); getLogger().info("Solr server location verified. Ping responded in " + pingTime + " ms."); } catch (SolrServerException e) { throw new SiteWhereException("Ping failed. Verify that Solr server is available.", e); } catch (IOException e) { throw new SiteWhereException("Exception in ping. Verify that Solr server is available.", e); } }
@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { // Required for filters. super.start(monitor); if (getSolrConfiguration() == null) { throw new SiteWhereException("No Solr configuration provided."); } try { // Create and start Solr connection. this.solrConnection = new SolrConnection(getSolrConfiguration()); getSolrConnection().start(monitor); getLogger().info("Attempting to ping Solr server to verify availability..."); SolrPingResponse response = getSolrConnection().getSolrClient().ping(); int pingTime = response.getQTime(); getLogger().info("Solr server location verified. Ping responded in " + pingTime + " ms."); } catch (SolrServerException e) { throw new SiteWhereException("Ping failed. Verify that Solr server is available.", e); } catch (IOException e) { throw new SiteWhereException("Exception in ping. Verify that Solr server is available.", e); } getLogger().info( "Solr event processor indexing events to server at: " + getSolrConfiguration().getSolrServerUrl()); executor.execute(new SolrDocumentQueueProcessor()); }