This has to be a `static Map<BDR, Object>`. The parser creates a new instance of the registrar for each XML element. Also, each `@EnableMessageHistory` gets a new instance; I changed your test case to..

````java
	@Configuration
	@ComponentScan(basePackageClasses = EnableIntegrationTests.class)
	@EnableIntegration
	@EnableMessageHistory("input")
	public static class ContextConfiguration {

		@Bean
		public MessageChannel input() {
			return new DirectChannel();
		}

		@Bean
		public PollableChannel output() {
			return new QueueChannel();
		}

	}

	@Configuration
	@EnableIntegration
	@EnableMessageHistory("input")
	public static class ContextConfiguration2 {

		@Bean
		public PollableChannel publishedChannel() {
			return new QueueChannel();
		}

	}

````

And got an `NPE` because componentNamePatterns is `null`.