Sonar Build (Master) - https://sonar.spring.io/dashboard/index/org.springframework.amqp:spring-amqp-dist

Build: #2835 was successful Scheduled with changes by Gary Russell

Build result summary

Details

Completed
Duration
13 minutes
Labels
None
Agent
bamboo-19.af.pivotal.io
Revision
9e4ba4f2cb85d4bc3fcad99f895a125d7bbd2a8f 9e4ba4f2cb85d4bc3fcad99f895a125d7bbd2a8f
Successful since
#2783 ()

Sonar analysis results

ProjectQuality gate status
org.springframework.amqp:spring-amqp-dist:master

Code commits

Author Commit Message Commit date
Gary Russell Gary Russell 9e4ba4f2cb85d4bc3fcad99f895a125d7bbd2a8f 9e4ba4f2cb85d4bc3fcad99f895a125d7bbd2a8f GH-1148: Log4jAppender - fix initialization cycle
Resolves https://github.com/spring-projects/spring-amqp/issues/1148

Defer creation of all Spring static loggers from appender until the
appender is initialized.

The first logger (e.g. Spring Boot) initializes the static `LoggerContext`
field in `LogAdapter.Log4jLog`; this, in turn initializes the appender.

However, the appender references Spring objects that have static loggers.
This causes the `Log4jLog` CTOR to be called before the field is initialized,
causing an NPE.

Defer creation of all static loggers until the appender is fully initialized.

Tested with the log4j2 sample app.

Also add a test for async sends.

**cherry-pick to 2.1.x**

* NOSONAR - inconsistent sync

Jira issues

IssueDescriptionStatus
Unknown Issue TypeGH-1148Could not obtain issue details from Jira