From 28bc8e675bd212b460cb3bc460cf9ae136c77a87 Mon Sep 17 00:00:00 2001 From: josegar74 Date: Mon, 1 Jun 2026 09:16:39 +0200 Subject: [PATCH 1/2] Use version 2.5.2 of markdown-page-generator-plugin plugin, compatible with Java 11 --- pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pom.xml b/pom.xml index 092ec9b6f9bc..df8272760b7e 100644 --- a/pom.xml +++ b/pom.xml @@ -233,6 +233,11 @@ maven-assembly-plugin 3.3.0 + + com.ruleoftech + markdown-page-generator-plugin + 2.5.2 + maven-antrun-plugin 3.0.0 From a399ca1fc1d87da1b47a17ce9605dfb8bd5fd49c Mon Sep 17 00:00:00 2001 From: josegar74 Date: Mon, 1 Jun 2026 13:29:51 +0200 Subject: [PATCH 2/2] Remove ActiveMQ/JMS and migrate to Camel SEDA - Removed 'messaging' module and JMS-related dependencies (ActiveMQ). - Migrated internal messaging from ActiveMQ queues to Camel SEDA components. - Updated to use instead of . - Replaced with in for sending events. - Cleaned up JMS-related configuration properties and Maven profiles. - Updated to use SEDA as the default consumer URI. --- messaging/pom.xml | 58 ---------------- .../org/geonetwork/messaging/JMSMessager.java | 59 ---------------- .../config-spring-geonetwork-parent.xml | 69 ------------------- pom.xml | 3 - .../webResources/WEB-INF/config.properties | 2 - .../MessageProducerService.java | 4 +- workers/pom.xml | 22 +----- workers/wfsfeature-harvester/pom.xml | 5 -- .../wfsfeatures/WFSHarvesterApi.java | 10 +-- .../worker/WFSHarvesterRouteBuilder.java | 12 ++-- .../config-spring-geonetwork-jms.xml | 54 --------------- 11 files changed, 14 insertions(+), 284 deletions(-) delete mode 100644 messaging/pom.xml delete mode 100644 messaging/src/main/java/org/geonetwork/messaging/JMSMessager.java delete mode 100644 messaging/src/main/resources/config-spring-geonetwork-parent.xml delete mode 100644 workers/wfsfeature-harvester/src/main/resources/config-spring-geonetwork-jms.xml diff --git a/messaging/pom.xml b/messaging/pom.xml deleted file mode 100644 index 41e896a7752a..000000000000 --- a/messaging/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - geonetwork - org.geonetwork-opensource - 4.4.11-SNAPSHOT - - 4.0.0 - - gn-messaging - - - - org.apache.activemq - activemq-core - ${activemq.version} - - - org.apache.activemq - activemq-pool - ${activemq.version} - - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - copy-filter-resource - process-resources - - copy-resources - - - \ - false - ${project.build.directory} - - - ${basedir}/src/main/resources - true - ${project.build.directory}/classes - - - true - - - - - - - - diff --git a/messaging/src/main/java/org/geonetwork/messaging/JMSMessager.java b/messaging/src/main/java/org/geonetwork/messaging/JMSMessager.java deleted file mode 100644 index 7fe91a3f49ca..000000000000 --- a/messaging/src/main/java/org/geonetwork/messaging/JMSMessager.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.geonetwork.messaging; - -import org.apache.activemq.ActiveMQConnectionFactory; -import org.springframework.context.ApplicationEvent; - -import javax.jms.*; - -/** - * Created by francois on 05/11/15. - */ -public class JMSMessager { - private String jmsUrl; - - public String getJmsUrl() { - return jmsUrl; - } - - public void setJmsUrl(String jmsUrl) { - this.jmsUrl = jmsUrl; - } - - public void sendMessage(String queue, ApplicationEvent event) { - try { - // Create a ConnectionFactory - ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(this.jmsUrl); - - // Create a Connection - Connection connection = connectionFactory.createConnection(); - connection.start(); - try { - // Create a Session - Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); - - try { - // Create the destination (Topic or Queue) - Destination destination = session.createQueue(queue); - - // Create a MessageProducer from the Session to the Topic or Queue - MessageProducer producer = session.createProducer(destination); - producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT); - - // Create a messages - ObjectMessage message = session.createObjectMessage(event); - - // Tell the producer to send the message - producer.send(message); - } finally { - session.close(); - } - } finally { - connection.close(); - } - } catch (Exception e) { - // TODO : dedicated logger needed - System.out.println("Caught: " + e); - e.printStackTrace(); - } - } -} diff --git a/messaging/src/main/resources/config-spring-geonetwork-parent.xml b/messaging/src/main/resources/config-spring-geonetwork-parent.xml deleted file mode 100644 index 8ae01ab856dd..000000000000 --- a/messaging/src/main/resources/config-spring-geonetwork-parent.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pom.xml b/pom.xml index df8272760b7e..e662684c6d8f 100644 --- a/pom.xml +++ b/pom.xml @@ -1460,7 +1460,6 @@ es release workers - messaging estest index datastorages @@ -1679,8 +1678,6 @@ 5601 http://localhost:${kb.port} - tcp://localhost:61616 - 5.7.0 diff --git a/web/src/main/webResources/WEB-INF/config.properties b/web/src/main/webResources/WEB-INF/config.properties index 060446291fe4..c9ef80c70a3d 100644 --- a/web/src/main/webResources/WEB-INF/config.properties +++ b/web/src/main/webResources/WEB-INF/config.properties @@ -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. diff --git a/workers/camelPeriodicProducer/src/main/java/org/fao/geonet/camelPeriodicProducer/MessageProducerService.java b/workers/camelPeriodicProducer/src/main/java/org/fao/geonet/camelPeriodicProducer/MessageProducerService.java index ca12cda9df85..567a649e5727 100644 --- a/workers/camelPeriodicProducer/src/main/java/org/fao/geonet/camelPeriodicProducer/MessageProducerService.java +++ b/workers/camelPeriodicProducer/src/main/java/org/fao/geonet/camelPeriodicProducer/MessageProducerService.java @@ -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) * @@ -51,7 +51,7 @@ @Component public class MessageProducerService implements ApplicationListener { - 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; diff --git a/workers/pom.xml b/workers/pom.xml index b19dbc0059fd..b1b3ec520d50 100644 --- a/workers/pom.xml +++ b/workers/pom.xml @@ -52,11 +52,6 @@ camel-spring ${camel.version} - - org.apache.camel - camel-jms - ${camel.version} - org.apache.camel camel-jaxb @@ -97,21 +92,6 @@ - - org.apache.activemq - activemq-core - ${activemq.version} - - - org.apache.activemq - activemq-pool - ${activemq.version} - - - org.apache.activemq - activemq-camel - ${activemq.version} - org.apache.xbean xbean-spring @@ -141,7 +121,7 @@ camel-maven-plugin ${camel.version} - config-spring-geonetwork-jms.xml + config-spring-geonetwork.xml diff --git a/workers/wfsfeature-harvester/pom.xml b/workers/wfsfeature-harvester/pom.xml index 404dca453469..6f761d948610 100644 --- a/workers/wfsfeature-harvester/pom.xml +++ b/workers/wfsfeature-harvester/pom.xml @@ -90,11 +90,6 @@ gn-core ${project.version} - - ${project.groupId} - gn-messaging - ${project.version} - ${project.groupId} gn-services diff --git a/workers/wfsfeature-harvester/src/main/java/org/fao/geonet/harvester/wfsfeatures/WFSHarvesterApi.java b/workers/wfsfeature-harvester/src/main/java/org/fao/geonet/harvester/wfsfeatures/WFSHarvesterApi.java index 8d7e4596cc46..3dd9859a9693 100644 --- a/workers/wfsfeature-harvester/src/main/java/org/fao/geonet/harvester/wfsfeatures/WFSHarvesterApi.java +++ b/workers/wfsfeature-harvester/src/main/java/org/fao/geonet/harvester/wfsfeatures/WFSHarvesterApi.java @@ -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) * @@ -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; @@ -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; @@ -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", @@ -99,7 +99,7 @@ public JSONObject deleteWfs( JSONObject result = new JSONObject(); result.put("success", true); - + return result; } @@ -107,7 +107,7 @@ 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()); diff --git a/workers/wfsfeature-harvester/src/main/java/org/fao/geonet/harvester/wfsfeatures/worker/WFSHarvesterRouteBuilder.java b/workers/wfsfeature-harvester/src/main/java/org/fao/geonet/harvester/wfsfeatures/worker/WFSHarvesterRouteBuilder.java index 3938f4e931a9..97e6876ab9a7 100644 --- a/workers/wfsfeature-harvester/src/main/java/org/fao/geonet/harvester/wfsfeatures/worker/WFSHarvesterRouteBuilder.java +++ b/workers/wfsfeature-harvester/src/main/java/org/fao/geonet/harvester/wfsfeatures/worker/WFSHarvesterRouteBuilder.java @@ -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) * @@ -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; @@ -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"); diff --git a/workers/wfsfeature-harvester/src/main/resources/config-spring-geonetwork-jms.xml b/workers/wfsfeature-harvester/src/main/resources/config-spring-geonetwork-jms.xml deleted file mode 100644 index c87639e04630..000000000000 --- a/workers/wfsfeature-harvester/src/main/resources/config-spring-geonetwork-jms.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -