You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2022/08/02 09:28:36 UTC

[GitHub] [james-project] quantranhong1999 commented on a diff in pull request #1102: JAMES-3775 Guice packaging for RSpamd

quantranhong1999 commented on code in PR #1102:
URL: https://github.com/apache/james-project/pull/1102#discussion_r935327131


##########
third-party/rspamd/docker-compose.yml:
##########
@@ -3,11 +3,29 @@ version: '3'
 services:
 
   james:
+    depends_on:
+      - rspamd
     image: apache/james:memory-latest
     container_name: james
     hostname: james.local
     volumes:
+      - /home/tungtv/workplace/2_JAMES/ENV/tmail-backend-memory/keystore:/root/conf/keystore

Review Comment:
   Please share the `keystore` file.



##########
third-party/rspamd/src/main/java/org/apache/james/rspamd/module/RSpamDModule.java:
##########
@@ -49,4 +57,11 @@ protected void configure() {
     public AdditionalInformationDTOModule<? extends TaskExecutionDetails.AdditionalInformation, ? extends AdditionalInformationDTO> webAdminFeedSpamAdditionalInformation() {
         return FeedSpamToRSpamDTaskAdditionalInformationDTO.SERIALIZATION_MODULE;
     }
+
+    @Provides
+    @Singleton
+    public RSpamDHttpClient rSpamDHttpClient(PropertiesProvider propertiesProvider) throws ConfigurationException, FileNotFoundException {
+        RSpamDClientConfiguration rSpamDClientConfiguration = RSpamDClientConfiguration.from(propertiesProvider.getConfiguration("rspamd"));
+        return new RSpamDHttpClient(rSpamDClientConfiguration);
+    }

Review Comment:
   Should we create bean from `RSpamDClientConfiguration` level? (we inject it into the client https://github.com/apache/james-project/blob/eb2178a9269851cf4d15eed98669faa172cedd61/third-party/rspamd/src/main/java/org/apache/james/rspamd/client/RSpamDHttpClient.java).
   
   And we still can set `RSpamDHttpClient` instance to singleton if we want.
   



-- 
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: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org