prosgarz35 commented on code in PR #3194:
URL: https://github.com/apache/james-project/pull/3194#discussion_r4143269586


##########
server/container/guice/queue/activemq/src/main/java/org/apache/james/modules/queue/activemq/ActiveMQQueueModule.java:
##########
@@ -50,33 +48,40 @@
 import com.google.inject.multibindings.Multibinder;
 import com.google.inject.multibindings.ProvidesIntoSet;
 
+/**
+ * Guice module for the Artemis-backed mail queue.
+ * Replaces the legacy ActiveMQ embedded broker with Apache ActiveMQ Artemis.
+ */
 public class ActiveMQQueueModule extends AbstractModule {
 
     private static final Logger LOGGER = 
LoggerFactory.getLogger(ActiveMQQueueModule.class);
     private static final String FILENAME = "activemq";
 
     @Override
     protected void configure() {
-        bind(PersistenceAdapter.class).to(KahaDBPersistenceAdapter.class);
-        bind(KahaDBPersistenceAdapter.class).in(Scopes.SINGLETON);
         bind(EmbeddedActiveMQ.class).in(Scopes.SINGLETON);
         bind(ActiveMQMailQueueFactory.class).in(Scopes.SINGLETON);
-        
bind(ActiveMQMetricCollector.class).to(ActiveMQMetricCollectorImpl.class);
-        bind(ActiveMQMetricCollectorImpl.class).in(Scopes.SINGLETON);
+        // Use Noop metric collector since Artemis does not support ActiveMQ 
Statistics Plugin.
+        // Artemis metrics can be obtained via JMX or dedicated management 
APIs.
+        
bind(ActiveMQMetricCollector.class).to(ActiveMQMetricCollectorNoop.class);
+        bind(ActiveMQMetricCollectorNoop.class).in(Scopes.SINGLETON);

Review Comment:
       Thanks for the review @Arsnael!
   
       1. Regarding metrics:
       Actually, James application-level queue metrics (`enqueuedMailsMetric`, 
`dequeuedMailsMetric`, and
     `queueSizeGauge`) are still fully gathered and reported inside James by 
`JMSCacheableMailQueue` through James's standard `MetricFactory` and 
`GaugeRegistry`.
       The only thing `ActiveMQMetricCollectorImpl` did was poll ActiveMQ 
Classic's proprietary advisory statistics plugin 
(`ActiveMQ.Statistics.Destination.*`), which doesn't exist in Artemis. 
Broker-level statistics in Artemis can  be obtained natively via Micrometer / 
Prometheus or JMX. I updated the comment in `ActiveMQQueueModule` and ADR 0076 
to make this completely clear.
   
       2. Regarding Spring configuration:
       Added `activemq.properties` to 
`server/apps/spring-app/src/main/resources/activemq.properties` (which is 
packaged directly into `conf/` for the Spring app) with the same durability and 
NIO group commit defaults as `postgres-app`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to