From 23a46b4be35277e06ec89f48730eeb694e686be8 Mon Sep 17 00:00:00 2001
From: Kenmegne <stephanie.kenmegne@gmail.com>
Date: Thu, 18 Jun 2026 15:40:06 +0000
Subject: [PATCH] add fdx-commons and fdx-consultation

---
 apifdxweb/api/apifdxweb-service-impl/src/main/java/com/megatim/apifdxweb/service/impl/camel/routes/in/ReferentielIntegrationLocalRoute.java |   51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/apifdxweb/api/apifdxweb-service-impl/src/main/java/com/megatim/apifdxweb/service/impl/camel/routes/in/ReferentielIntegrationLocalRoute.java b/apifdxweb/api/apifdxweb-service-impl/src/main/java/com/megatim/apifdxweb/service/impl/camel/routes/in/ReferentielIntegrationLocalRoute.java
new file mode 100644
index 0000000..49e2f59
--- /dev/null
+++ b/apifdxweb/api/apifdxweb-service-impl/src/main/java/com/megatim/apifdxweb/service/impl/camel/routes/in/ReferentielIntegrationLocalRoute.java
@@ -0,0 +1,51 @@
+package com.megatim.apifdxweb.service.impl.camel.routes.in;
+
+import com.megatim.apifdxweb.service.impl.camel.config.CamelRouteConfiguration;
+import com.megatim.apifdxweb.service.impl.camel.config.LocalConfiguration;
+import com.megatim.apifdxweb.service.impl.camel.filters.ReferentielFilter;
+import com.megatim.apifdxweb.service.impl.camel.processors.ReferentielProcessor;
+import com.megatim.fdxcommons.model.pojo.ReferentielToImportData;
+import com.megatim.fdxcommons.tools.context.AppContext;
+import com.megatim.fdxcommons.tools.resolvers.JacksonMapperFormat;
+import java.util.concurrent.RejectedExecutionException;
+import javax.inject.Inject;
+import org.apache.camel.builder.RouteBuilder;
+
+/**
+ *
+ * @author ASUS
+ */
+public class ReferentielIntegrationLocalRoute extends RouteBuilder {
+
+    @Inject
+    private ReferentielProcessor referentielProcessor;
+
+    @Override
+    public void configure() throws Exception {
+
+        LocalConfiguration localConfiguration
+                = new CamelRouteConfiguration(com.megatim.apifdxweb.tools.AppContext.PROPERTY_FILE_PATH).getLocalConfiguration();
+
+        onException(IllegalArgumentException.class)
+                .process(exchange -> {
+                    exchange.getException().printStackTrace();
+                })
+                .handled(true);
+
+        onException(RejectedExecutionException.class)
+                .log("Caught RejectedExecutionException: ${exception.message}")
+                .handled(true);
+
+        from(localConfiguration.referentielRouteURI())
+                .filter()
+                .method(ReferentielFilter.class, "isConsumable")
+                .process(referentielProcessor)
+                .marshal(JacksonMapperFormat.jacksonDataFormat(ReferentielToImportData.class))
+                .to("rabbitmq:"
+                        + AppContext.REFERENTIEL_INTEGRATION_EXCHANGE
+                        + "?queue=" + AppContext.REFERENTIEL_INTEGRATION_QUEUE
+                        + "&routingKey=" + AppContext.REFERENTIEL_INTEGRATION_ROUTING_KEY
+                        + "&autoDelete=false");
+    }
+
+}

--
Gitblit v1.10.0