Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 0 additions & 58 deletions messaging/pom.xml

This file was deleted.

59 changes: 0 additions & 59 deletions messaging/src/main/java/org/geonetwork/messaging/JMSMessager.java

This file was deleted.

69 changes: 0 additions & 69 deletions messaging/src/main/resources/config-spring-geonetwork-parent.xml

This file was deleted.

3 changes: 0 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,6 @@
<module>es</module>
<module>release</module>
<module>workers</module>
<module>messaging</module>
<module>estest</module>
<module>index</module>
<module>datastorages</module>
Expand Down Expand Up @@ -1674,8 +1673,6 @@
<kb.port>5601</kb.port>
<kb.url>http://localhost:${kb.port}</kb.url>

<jms.url>tcp://localhost:61616</jms.url>
<activemq.version>5.7.0</activemq.version>

<!-- Avoid to create any sessions for crawlers.
Define the list of User-Agent to be considered as bot. -->
Expand Down
2 changes: 0 additions & 2 deletions web/src/main/webResources/WEB-INF/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ es.index.checker.interval=0/5 * * * * ?
# Headers allowed for the portal/search proxy to Elasticsearch
es.proxy.headers=content-type,content-encoding,transfer-encoding

jms.url=${jms.url}

# If using a scaled environment with more than one node,
# * only enable harvester scheduler on one node
# which will be responsible for scheduled harvesting tasks.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2001-2015 Food and Agriculture Organization of the
* Copyright (C) 2001-2026 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
Expand Down Expand Up @@ -51,7 +51,7 @@

@Component
public class MessageProducerService implements ApplicationListener<ServerStartup> {
private static final String DEFAULT_CONSUMER_URI = "activemq://queue:" + MESSAGE_HARVEST_WFS_FEATURES + "?concurrentConsumers=5";
private static final String DEFAULT_CONSUMER_URI = "seda:harvest-wfs-features";
private static Logger LOGGER = LoggerFactory.getLogger(WFSHarvesterRouteBuilder.LOGGER_NAME);
private static boolean isConfigured = false;
protected String consumerUri = DEFAULT_CONSUMER_URI;
Expand Down
22 changes: 1 addition & 21 deletions workers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@
<artifactId>camel-spring</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jaxb</artifactId>
Expand Down Expand Up @@ -97,21 +92,6 @@
</dependency>


<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-pool</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-camel</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-spring</artifactId>
Expand Down Expand Up @@ -141,7 +121,7 @@
<artifactId>camel-maven-plugin</artifactId>
<version>${camel.version}</version>
<configuration>
<applicationContextUri>config-spring-geonetwork-jms.xml</applicationContextUri>
<applicationContextUri>config-spring-geonetwork.xml</applicationContextUri>
</configuration>
</plugin>
</plugins>
Expand Down
5 changes: 0 additions & 5 deletions workers/wfsfeature-harvester/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@
<artifactId>gn-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>gn-messaging</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>gn-services</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2001-2015 Food and Agriculture Organization of the
* Copyright (C) 2001-2026 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
Expand All @@ -26,6 +26,7 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import net.sf.json.JSONObject;
import org.apache.camel.ProducerTemplate;
import org.fao.geonet.ApplicationContextHolder;
import org.fao.geonet.api.API;
import org.fao.geonet.harvester.wfsfeatures.event.WFSHarvesterEvent;
Expand All @@ -34,7 +35,6 @@
import org.fao.geonet.harvester.wfsfeatures.worker.WFSHarvesterRouteBuilder;
import org.fao.geonet.index.es.EsRestClient;
import org.fao.geonet.utils.Log;
import org.geonetwork.messaging.JMSMessager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.http.HttpStatus;
Expand All @@ -56,7 +56,7 @@
description = "Workers related operations")
public class WFSHarvesterApi {
@Autowired
private JMSMessager jmsMessager;
private ProducerTemplate producerTemplate;

@Operation(summary = "Index a WFS feature type")
@RequestMapping(value = "start",
Expand Down Expand Up @@ -99,15 +99,15 @@ public JSONObject deleteWfs(

JSONObject result = new JSONObject();
result.put("success", true);

return result;
}

private JSONObject sendMessage(WFSHarvesterParameter parameters) {
ConfigurableApplicationContext appContext = ApplicationContextHolder.get();
WFSHarvesterEvent event = new WFSHarvesterEvent(appContext, parameters);
// TODO: Messages should be node specific eg. srv channel ?
jmsMessager.sendMessage(WFSHarvesterRouteBuilder.MESSAGE_HARVEST_WFS_FEATURES, event);
producerTemplate.sendBody(WFSHarvesterRouteBuilder.HARVEST_WFS_FEATURES_SEDA_URI, event);

JSONObject j = new JSONObject();
j.put("url", parameters.getUrl());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2001-2015 Food and Agriculture Organization of the
* Copyright (C) 2001-2026 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
Expand Down Expand Up @@ -39,7 +39,7 @@ public class WFSHarvesterRouteBuilder extends RouteBuilder {
public static final String LOGGER_NAME = "geonetwork.harvest.wfs.features";
public static final String MESSAGE_HARVEST_WFS_FEATURES = "harvest-wfs-features";
public static final String MESSAGE_DELETE_WFS_FEATURES = "delete-wfs-features";
public static final String HARVEST_WFS_FEATURES_QUEUE_URI = "activemq:queue:" + MESSAGE_HARVEST_WFS_FEATURES + "?concurrentConsumers=5";
public static final String HARVEST_WFS_FEATURES_SEDA_URI = "seda:harvest-wfs-features?concurrentConsumers=5&blockWhenFull=true";

private boolean startsFromXMLConfigurationFile = false;

Expand Down Expand Up @@ -96,18 +96,18 @@ public void configure() {
* types and the WFSDatastore.
* This bean will be pass to next Route.
*/
from(HARVEST_WFS_FEATURES_QUEUE_URI)
from(HARVEST_WFS_FEATURES_SEDA_URI)
.id("harvest-wfs-start-from-message")
.log(LoggingLevel.INFO, LOGGER_NAME, "Harvest features message received.")
.log(LoggingLevel.INFO, LOGGER_NAME, "Harvest features message received via SEDA.")
.log(LoggingLevel.INFO, LOGGER_NAME, "${body}")
.setProperty("configuration", simple("${body.parameters}"))
.beanRef("WFSFeatureIndexer", "initialize(*, true)")
.to("direct:delete-wfs-featuretype-features")
.to("direct:index-wfs");

from("activemq:queue:" + MESSAGE_DELETE_WFS_FEATURES + "?concurrentConsumers=5")
from("seda:queue:" + MESSAGE_DELETE_WFS_FEATURES + "?concurrentConsumers=5")
.id("harvest-wfs-delete-features-from-message")
.log(LoggingLevel.INFO, LOGGER_NAME, "Delete features message received.")
.log(LoggingLevel.INFO, LOGGER_NAME, "Delete features message received via SEDA.")
.setProperty("url", simple("${body.parameters.url}"))
.setProperty("typeName", simple("${body.parameters.typeName}"))
.to("direct:delete-wfs-featuretype-features");
Expand Down
Loading
Loading