quantranhong1999 commented on PR #1824:
URL: https://github.com/apache/james-project/pull/1824#issuecomment-1837791746

   > Likely you would need to do something similar with 
additional.healthchecks: 
https://github.com/apache/james-project/blob/master/examples/custom-healthcheck/README.md#L34.
 e.g. additional.connectionchecks=org.apache.james.CustomConnectionCheck
   
   Maybe no need to declare a new configuration file just for connection check, 
we can declare it in `imapserver.xml`:
   
   ```xml
   <imapservers>
       <imapserver enabled="true">
           <jmxName>imapserver</jmxName>
           <bind>0.0.0.0:143</bind>
   ...
        
<additionalConnectionChecks>org.apache.james.connection.check.A,org.apache.james.connection.check.B</additionalConnectionChecks>
       </imapserver>
   </imapservers>
   ```
   
   Then in `IMAPServerModule`, use `GuiceGenericLoader` to load the connection 
check classes into instances. e.g. like what 
   James did to extend the `ImapPackage`:
   - 
https://github.com/apache/james-project/blob/master/server/container/guice/protocols/imap/src/main/java/org/apache/james/modules/protocols/IMAPServerModule.java#L147
   - 
https://github.com/apache/james-project/blob/master/examples/custom-imap/README.md#L1
   
   I can imagine splitting this into smaller tasks:
   - Introduce ConnectionCheck interface and noop guice binding for it
   - Implement `additionalConnectionChecks` extension for IMAP (configuration + 
guice loading + binding + example and documentation)
   - Implement `CrowdSecConnectionCheck` and binding to James using the 
`additionalConnectionChecks` extension.


-- 
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