ppkarwasz commented on PR #1856:
URL: https://github.com/apache/logging-log4j2/pull/1856#issuecomment-1756951260

   @Dreeam-qwq,
   
   All 2.x releases must run on JDK 8. Since Disruptor 4.x requires a Java 11 
runtime, we can not drop support for Disruptor 3.x.
   
   Looking at your patch, the only breaking change that occurred is the 
disappearance of the `SequenceReportingEventHandler` and `LifecycleAware` 
interfaces, so you can work around these restrictions by:
    - restoring version `3.4.4` in the POM file,
    - removing the `@Override` annotations from the new `EventHandler` methods,
    - create a `RingBufferLogEventHandler3` and 
`AsyncLoggerConfigDisruptor#Log4jEventWrapperHandler3` classes that extend 
their v4 counterparts and differ just in the `implements` clause:
       ```java
       public class RingBufferLogEventHandler3 extends RingBufferLogEventHandler
           implements SequenceReportingEventHandler<RingBufferLogEvent>, 
LifecycleAware  {}
        ```
    - add logic to switch between `RingBufferLogEventHandler3` and 
`RingBufferLogEventHandler` based on the existence of the 
`SequenceReportingEventHandler` interface.
    - add some logic to switch between our `TimeoutBlockingWaitStrategy` and 
the one shipped with Disruptor 4.x.
    
    To test the PR run:
    ```
    ./mvnw install -pl log4j-core
    ```
    followed by:
    ```
    ./mvnw verify -Pjava8-tests -Dtest="org/apache/logging/log4j/core/async/*"
    ```
    to test on JDK 8 (you need a Maven toolchains configuration) and Disruptor 
3.x and
    ```
     ./mvnw verify -Dtest="org/apache/logging/log4j/core/async/*" 
-Ddisruptor.version=4.0.0
     ```
     to test on JDK 11 and Disruptor 4.x.


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

Reply via email to