Source:
<code>public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) { Map<String, Object> annotationAttributes = importingClassMetadata.getAnnotationAttributes(EnablePublisher.class.getName()); <START> String value = (annotationAttributes == null ? null : (String) annotationAttributes.get("value")); <END> if (!registry.containsBeanDefinition(IntegrationContextUtils.PUBLISHER_ANNOTATION_POSTPROCESSOR_NAME)) { BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(PublisherAnnotationBeanPostProcessor.class) .setRole(BeanDefinition.ROLE_INFRASTRUCTURE); if (StringUtils.hasText(value)) { builder.addPropertyValue("defaultChannelName", value); if (logger.isInfoEnabled()) { logger.info("Setting '@Publisher' default-output-channel to '" + value + "'."); } } registry.registerBeanDefinition(IntegrationContextUtils.PUBLISHER_ANNOTATION_POSTPROCESSOR_NAME, builder.getBeanDefinition()); } else { BeanDefinition beanDefinition = registry.getBeanDefinition(IntegrationContextUtils.PUBLISHER_ANNOTATION_POSTPROCESSOR_NAME); MutablePropertyValues propertyValues = beanDefinition.getPropertyValues(); PropertyValue defaultChannelPropertyValue = propertyValues.getPropertyValue("defaultChannelName"); if (StringUtils.hasText(value)) { if (defaultChannelPropertyValue == null) { propertyValues.addPropertyValue("defaultChannelName", value); if (logger.isInfoEnabled()) { logger.info("Setting '@Publisher' default-output-channel to '" + value + "'."); } } else if (!value.equals(defaultChannelPropertyValue.getValue())) { throw new BeanDefinitionStoreException("When more than one enable publisher definition " + "(@EnablePublisher or <annotation-config>)" + " is found in the context, they all must have the same 'default-publisher-channel' value."); } } } }</code><technical_language>do AnnotationUtils.getDefaultValue(EnablePublisher.class) instead of assuming null - this protect future changes (if any)</technical_language>

Target:
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) { Map<String, Object> annotationAttributes = importingClassMetadata.getAnnotationAttributes(EnablePublisher.class.getName()); String value = (annotationAttributes == null ? (String) AnnotationUtils.getDefaultValue(EnablePublisher.class) : (String) annotationAttributes.get("value")); if (!registry.containsBeanDefinition(IntegrationContextUtils.PUBLISHER_ANNOTATION_POSTPROCESSOR_NAME)) { BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(PublisherAnnotationBeanPostProcessor.class) .setRole(BeanDefinition.ROLE_INFRASTRUCTURE); if (StringUtils.hasText(value)) { builder.addPropertyValue("defaultChannelName", value); if (logger.isInfoEnabled()) { logger.info("Setting '@Publisher' default-output-channel to '" + value + "'."); } } registry.registerBeanDefinition(IntegrationContextUtils.PUBLISHER_ANNOTATION_POSTPROCESSOR_NAME, builder.getBeanDefinition()); } else { BeanDefinition beanDefinition = registry.getBeanDefinition(IntegrationContextUtils.PUBLISHER_ANNOTATION_POSTPROCESSOR_NAME); MutablePropertyValues propertyValues = beanDefinition.getPropertyValues(); PropertyValue defaultChannelPropertyValue = propertyValues.getPropertyValue("defaultChannelName"); if (StringUtils.hasText(value)) { if (defaultChannelPropertyValue == null) { propertyValues.addPropertyValue("defaultChannelName", value); if (logger.isInfoEnabled()) { logger.info("Setting '@Publisher' default-output-channel to '" + value + "'."); } } else if (!value.equals(defaultChannelPropertyValue.getValue())) { throw new BeanDefinitionStoreException("When more than one enable publisher definition " + "(@EnablePublisher or <annotation-config>)" + " is found in the context, they all must have the same 'default-publisher-channel' value."); } } } }