chibenwa commented on code in PR #3194:
URL: https://github.com/apache/james-project/pull/3194#discussion_r4126549536
##########
server/container/guice/queue/activemq/src/main/java/org/apache/james/modules/queue/activemq/ActiveMQQueueModule.java:
##########
@@ -50,33 +48,37 @@
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);
Multibinder.newSetBinder(binder(),
HealthCheck.class).addBinding().to(ActiveMQHealthCheck.class);
}
-
+
@Provides
@Singleton
- ConnectionFactory provideEmbededActiveMQ(EmbeddedActiveMQ
embeddedActiveMQ) {
+ ConnectionFactory provideEmbeddedArtemis(EmbeddedActiveMQ
embeddedActiveMQ) {
return embeddedActiveMQ.getConnectionFactory();
}
@Provides
@Singleton
public MailQueueFactory<? extends ManageableMailQueue>
createActiveMQManageableMailQueueFactory(ActiveMQMailQueueFactory
activeMQMailQueueFactory) {
- activeMQMailQueueFactory.setUseJMX(true);
+ activeMQMailQueueFactory.setUseJMX(false);
Review Comment:
While I hate JMX that's technically a breaking change.
How about having a system property `-Djames.mail.queue.jmx.activated=true`
to enable this if needed ?
--
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]