├── .editorconfig ├── .github ├── ISSUE_TEMPLATE │ └── new-issue.md ├── dco.yml ├── settings.xml └── workflows │ ├── ci-pr.yml │ └── deploy-docs.yml ├── .gitignore ├── .jdk8 ├── .mvn ├── jvm.config ├── maven.config └── wrapper │ ├── MavenWrapperDownloader.java │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── .settings.xml ├── .springformat ├── .travis.yml ├── CODE_OF_CONDUCT.adoc ├── LICENSE ├── README.adoc ├── binders ├── kafka-binder │ ├── .gitignore │ ├── .jdk8 │ ├── .mvn │ │ ├── jvm.config │ │ ├── maven.config │ │ └── wrapper │ │ │ ├── MavenWrapperDownloader.java │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── .settings.xml │ ├── LICENSE │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ ├── spring-cloud-starter-stream-kafka │ │ ├── .jdk8 │ │ └── pom.xml │ ├── spring-cloud-stream-binder-kafka-core │ │ ├── .jdk8 │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── springframework │ │ │ │ └── cloud │ │ │ │ └── stream │ │ │ │ └── binder │ │ │ │ └── kafka │ │ │ │ ├── common │ │ │ │ ├── AbstractKafkaBinderHealthIndicator.java │ │ │ │ ├── BinderHeaderMapper.java │ │ │ │ ├── KafkaBinderEnvironmentPostProcessor.java │ │ │ │ └── TopicInformation.java │ │ │ │ ├── properties │ │ │ │ ├── JaasLoginModuleConfiguration.java │ │ │ │ ├── KafkaBinderConfigurationProperties.java │ │ │ │ ├── KafkaBindingProperties.java │ │ │ │ ├── KafkaConsumerProperties.java │ │ │ │ ├── KafkaExtendedBindingProperties.java │ │ │ │ ├── KafkaProducerProperties.java │ │ │ │ └── KafkaTopicProperties.java │ │ │ │ ├── provisioning │ │ │ │ ├── AdminClientConfigCustomizer.java │ │ │ │ └── KafkaTopicProvisioner.java │ │ │ │ ├── support │ │ │ │ ├── ConsumerConfigCustomizer.java │ │ │ │ └── ProducerConfigCustomizer.java │ │ │ │ └── utils │ │ │ │ ├── BindingUtils.java │ │ │ │ ├── DlqDestinationResolver.java │ │ │ │ ├── DlqPartitionFunction.java │ │ │ │ └── KafkaTopicUtils.java │ │ │ └── test │ │ │ ├── java │ │ │ └── org │ │ │ │ └── springframework │ │ │ │ └── cloud │ │ │ │ └── stream │ │ │ │ └── binder │ │ │ │ └── kafka │ │ │ │ ├── properties │ │ │ │ └── KafkaBinderConfigurationPropertiesTest.java │ │ │ │ └── provisioning │ │ │ │ └── KafkaTopicProvisionerTests.java │ │ │ └── resources │ │ │ ├── test.truststore.ks │ │ │ ├── testclient.keystore │ │ │ └── testclient.truststore │ ├── spring-cloud-stream-binder-kafka-reactive │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── org │ │ │ │ │ └── springframework │ │ │ │ │ └── cloud │ │ │ │ │ └── stream │ │ │ │ │ └── binder │ │ │ │ │ └── reactorkafka │ │ │ │ │ ├── ReactorKafkaBinder.java │ │ │ │ │ ├── ReactorKafkaBinderConfiguration.java │ │ │ │ │ ├── ReactorKafkaBinderHealthIndicator.java │ │ │ │ │ ├── ReactorKafkaBinderHealthIndicatorConfiguration.java │ │ │ │ │ ├── ReceiverOptionsCustomizer.java │ │ │ │ │ ├── SenderOptionsCustomizer.java │ │ │ │ │ └── package-info.java │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ ├── spring.binders │ │ │ │ └── spring.factories │ │ │ └── test │ │ │ ├── java │ │ │ └── org │ │ │ │ └── springframework │ │ │ │ └── cloud │ │ │ │ └── stream │ │ │ │ └── binder │ │ │ │ └── reactorkafka │ │ │ │ ├── ReactorKafkaBinderHealthIndicatorTests.java │ │ │ │ ├── ReactorKafkaBinderIntegrationTests.java │ │ │ │ ├── ReactorKafkaBinderObservationTests.java │ │ │ │ └── ReactorKafkaBinderTests.java │ │ │ └── resources │ │ │ └── logback.xml │ ├── spring-cloud-stream-binder-kafka-streams │ │ ├── .jdk8 │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── org │ │ │ │ │ └── springframework │ │ │ │ │ └── cloud │ │ │ │ │ └── stream │ │ │ │ │ └── binder │ │ │ │ │ └── kafka │ │ │ │ │ └── streams │ │ │ │ │ ├── AbstractKafkaStreamsBinderProcessor.java │ │ │ │ │ ├── DeserializationExceptionHandler.java │ │ │ │ │ ├── DltAwareProcessor.java │ │ │ │ │ ├── DltPublishingContext.java │ │ │ │ │ ├── EncodingDecodingBindAdviceHandler.java │ │ │ │ │ ├── ExtendedBindingHandlerMappingsProviderAutoConfiguration.java │ │ │ │ │ ├── GlobalKTableBinder.java │ │ │ │ │ ├── GlobalKTableBinderConfiguration.java │ │ │ │ │ ├── GlobalKTableBoundElementFactory.java │ │ │ │ │ ├── InteractiveQueryService.java │ │ │ │ │ ├── KStreamBinder.java │ │ │ │ │ ├── KStreamBinderConfiguration.java │ │ │ │ │ ├── KStreamBoundElementFactory.java │ │ │ │ │ ├── KTableBinder.java │ │ │ │ │ ├── KTableBinderConfiguration.java │ │ │ │ │ ├── KTableBoundElementFactory.java │ │ │ │ │ ├── KafkaStreamsBinderEnvironmentPostProcessor.java │ │ │ │ │ ├── KafkaStreamsBinderHealthIndicator.java │ │ │ │ │ ├── KafkaStreamsBinderHealthIndicatorConfiguration.java │ │ │ │ │ ├── KafkaStreamsBinderMetrics.java │ │ │ │ │ ├── KafkaStreamsBinderSupportAutoConfiguration.java │ │ │ │ │ ├── KafkaStreamsBinderUtils.java │ │ │ │ │ ├── KafkaStreamsBindingInformationCatalogue.java │ │ │ │ │ ├── KafkaStreamsFunctionProcessor.java │ │ │ │ │ ├── KafkaStreamsJaasConfiguration.java │ │ │ │ │ ├── KafkaStreamsMessageConversionDelegate.java │ │ │ │ │ ├── KafkaStreamsRegistry.java │ │ │ │ │ ├── KafkaStreamsVersionAgnosticTopologyInfoFacade.java │ │ │ │ │ ├── KeyValueSerdeResolver.java │ │ │ │ │ ├── MultiBinderPropertiesConfiguration.java │ │ │ │ │ ├── RecordRecoverableProcessor.java │ │ │ │ │ ├── SendToDlqAndContinue.java │ │ │ │ │ ├── SerdeResolverUtils.java │ │ │ │ │ ├── SkipAndContinueExceptionHandler.java │ │ │ │ │ ├── StoreQueryParametersCustomizer.java │ │ │ │ │ ├── StreamsBuilderFactoryManager.java │ │ │ │ │ ├── aot │ │ │ │ │ └── KafkaStreamsBinderRuntimeHints.java │ │ │ │ │ ├── endpoint │ │ │ │ │ ├── KafkaStreamsTopologyEndpoint.java │ │ │ │ │ └── KafkaStreamsTopologyEndpointAutoConfiguration.java │ │ │ │ │ ├── function │ │ │ │ │ ├── FunctionDetectorCondition.java │ │ │ │ │ ├── KafkaStreamsBindableProxyFactory.java │ │ │ │ │ ├── KafkaStreamsFunctionAutoConfiguration.java │ │ │ │ │ ├── KafkaStreamsFunctionBeanPostProcessor.java │ │ │ │ │ └── KafkaStreamsFunctionProcessorInvoker.java │ │ │ │ │ ├── properties │ │ │ │ │ ├── KafkaStreamsBinderConfigurationProperties.java │ │ │ │ │ ├── KafkaStreamsBindingProperties.java │ │ │ │ │ ├── KafkaStreamsConsumerProperties.java │ │ │ │ │ ├── KafkaStreamsExtendedBindingProperties.java │ │ │ │ │ └── KafkaStreamsProducerProperties.java │ │ │ │ │ └── serde │ │ │ │ │ └── CollectionSerde.java │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ ├── spring.binders │ │ │ │ ├── spring.factories │ │ │ │ └── spring │ │ │ │ ├── aot.factories │ │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ │ └── test │ │ │ ├── java │ │ │ └── org │ │ │ │ └── springframework │ │ │ │ └── cloud │ │ │ │ └── stream │ │ │ │ └── binder │ │ │ │ └── kafka │ │ │ │ └── streams │ │ │ │ ├── EventTypeRoutingWithInferredSerdeTests.java │ │ │ │ ├── ExtendedBindingHandlerMappingsProviderAutoConfigurationTests.java │ │ │ │ ├── InteractiveQueryServiceMultiStateStoreTests.java │ │ │ │ ├── KafkaStreamsBinderEnvironmentPostProcessorTests.java │ │ │ │ ├── KafkaStreamsBinderUtilsTests.java │ │ │ │ ├── KafkaStreamsEventTypeRoutingTests.java │ │ │ │ ├── KafkaStreamsFunctionCompositionTests.java │ │ │ │ ├── KafkaStreamsInteractiveQueryIntegrationTests.java │ │ │ │ ├── KafkaStreamsVersionAgnosticTopologyInfoFacadeTests.java │ │ │ │ ├── MultipleFunctionsInSameAppTests.java │ │ │ │ ├── SerdeResolverUtilsTests.java │ │ │ │ ├── bootstrap │ │ │ │ ├── KafkaStreamsBinderBootstrapTest.java │ │ │ │ └── KafkaStreamsBinderJaasInitTests.java │ │ │ │ ├── function │ │ │ │ ├── KafkaStreamsBinderWordCountBranchesFunctionTests.java │ │ │ │ ├── KafkaStreamsBinderWordCountFunctionTests.java │ │ │ │ ├── KafkaStreamsComponentBeansTests.java │ │ │ │ ├── KafkaStreamsFunctionStateStoreTests.java │ │ │ │ ├── KafkaStreamsRetryTests.java │ │ │ │ ├── SerdesProvidedAsBeansTests.java │ │ │ │ ├── StreamToGlobalKTableFunctionTests.java │ │ │ │ └── StreamToTableJoinFunctionTests.java │ │ │ │ ├── integration │ │ │ │ ├── DlqDestinationResolverTests.java │ │ │ │ ├── DltAwareProcessorTests.java │ │ │ │ ├── KafkaStreamsBinderDestinationIsPatternTests.java │ │ │ │ ├── KafkaStreamsBinderHealthIndicatorTests.java │ │ │ │ ├── KafkaStreamsBinderMultipleInputTopicsTest.java │ │ │ │ ├── KafkaStreamsBinderPojoInputAndPrimitiveTypeOutputTests.java │ │ │ │ ├── KafkaStreamsBinderTombstoneTests.java │ │ │ │ ├── KafkaStreamsNativeEncodingDecodingDisabledTests.java │ │ │ │ ├── KafkaStreamsNativeEncodingDecodingEnabledTests.java │ │ │ │ ├── KafkaStreamsStateStoreIntegrationTests.java │ │ │ │ └── KafkastreamsBinderPojoInputStringOutputIntegrationTests.java │ │ │ │ └── serde │ │ │ │ └── CollectionSerdeTest.java │ │ │ └── resources │ │ │ └── logback.xml │ └── spring-cloud-stream-binder-kafka │ │ ├── .jdk8 │ │ ├── pom.xml │ │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── springframework │ │ │ │ └── cloud │ │ │ │ └── stream │ │ │ │ └── binder │ │ │ │ └── kafka │ │ │ │ ├── BinderHeaderMapper.java │ │ │ │ ├── KafkaBinderHealth.java │ │ │ │ ├── KafkaBinderHealthIndicator.java │ │ │ │ ├── KafkaBinderMetrics.java │ │ │ │ ├── KafkaBindingRebalanceListener.java │ │ │ │ ├── KafkaExpressionEvaluatingInterceptor.java │ │ │ │ ├── KafkaListenerContainerCustomizer.java │ │ │ │ ├── KafkaMessageChannelBinder.java │ │ │ │ ├── KafkaNullConverter.java │ │ │ │ ├── ListenerContainerWithDlqAndRetryCustomizer.java │ │ │ │ ├── aot │ │ │ │ └── KafkaBinderRuntimeHints.java │ │ │ │ └── config │ │ │ │ ├── ClientFactoryCustomizer.java │ │ │ │ ├── DefaultMessageConverterHelper.java │ │ │ │ ├── ExtendedBindingHandlerMappingsProviderConfiguration.java │ │ │ │ ├── KafkaBinderConfiguration.java │ │ │ │ ├── KafkaBinderHealthIndicatorConfiguration.java │ │ │ │ └── MessageConverterHelperConfiguration.java │ │ └── resources │ │ │ └── META-INF │ │ │ ├── spring.binders │ │ │ ├── spring.factories │ │ │ └── spring │ │ │ ├── aot.factories │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── stream │ │ │ └── binder │ │ │ └── kafka │ │ │ ├── AbstractKafkaTestBinder.java │ │ │ ├── AdminConfigTests.java │ │ │ ├── AutoCreateTopicDisabledTests.java │ │ │ ├── BatchWithDlqCustomizerDisablesBinderDlqTests.java │ │ │ ├── FunctionBatchingConversionTests.java │ │ │ ├── KafkaBinderAutoConfigurationPropertiesTest.java │ │ │ ├── KafkaBinderConfigurationTest.java │ │ │ ├── KafkaBinderConfigurationWithTransactionsTest.java │ │ │ ├── KafkaBinderHealthIndicatorTest.java │ │ │ ├── KafkaBinderJaasInitializerListenerTest.java │ │ │ ├── KafkaBinderMetricsTest.java │ │ │ ├── KafkaBinderPropertiesTest.java │ │ │ ├── KafkaBinderTests.java │ │ │ ├── KafkaBinderTransactionCustomizerTest.java │ │ │ ├── KafkaBinderUnitTests.java │ │ │ ├── KafkaListenerContainerCustomizerTests.java │ │ │ ├── KafkaTestBinder.java │ │ │ ├── KafkaTransactionTests.java │ │ │ ├── MultipleOutputBindingsPartitionsTests.java │ │ │ ├── RawKafkaPartitionTestSupport.java │ │ │ ├── TestKafkaProperties.java │ │ │ ├── bootstrap │ │ │ ├── KafkaBinderBootstrapTest.java │ │ │ ├── KafkaBinderCustomHealthCheckTests.java │ │ │ └── KafkaBinderMeterRegistryTest.java │ │ │ ├── integration │ │ │ ├── KafkaBinderActuatorTests.java │ │ │ ├── KafkaBinderExtendedPropertiesTest.java │ │ │ ├── KafkaBindingServiceTests.java │ │ │ ├── KafkaConfigCustomizationTests.java │ │ │ ├── KafkaNullConverterTest.java │ │ │ ├── KafkaRetryDlqBinderOrContainerTests.java │ │ │ ├── ProducerOnlyTransactionTests.java │ │ │ └── topic │ │ │ │ └── configs │ │ │ │ ├── BaseKafkaBinderTopicPropertiesUpdateTest.java │ │ │ │ ├── DisabledKafkaBinderTopicPropertiesUpdateTest.java │ │ │ │ └── KafkaBinderTopicPropertiesUpdateTest.java │ │ │ └── integration2 │ │ │ └── ConsumerProducerTransactionTests.java │ │ └── resources │ │ ├── binder-config-autoconfig.properties │ │ ├── binder-config.properties │ │ ├── jaas-sample-kafka-only.conf │ │ ├── jaas-sample-with-zk.conf │ │ └── logback.xml ├── pom.xml ├── pulsar-binder │ ├── pom.xml │ └── spring-cloud-stream-binder-pulsar │ │ ├── pom.xml │ │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── springframework │ │ │ │ └── cloud │ │ │ │ └── stream │ │ │ │ └── binder │ │ │ │ └── pulsar │ │ │ │ ├── PulsarBinderHeaderMapper.java │ │ │ │ ├── PulsarBinderUtils.java │ │ │ │ ├── PulsarMessageChannelBinder.java │ │ │ │ ├── config │ │ │ │ ├── ExtendedBindingHandlerMappingsProviderConfiguration.java │ │ │ │ └── PulsarBinderConfiguration.java │ │ │ │ ├── package-info.java │ │ │ │ ├── properties │ │ │ │ ├── ConsumerConfigProperties.java │ │ │ │ ├── ProducerConfigProperties.java │ │ │ │ ├── PulsarBinderConfigurationProperties.java │ │ │ │ ├── PulsarBindingProperties.java │ │ │ │ ├── PulsarConsumerProperties.java │ │ │ │ ├── PulsarExtendedBindingProperties.java │ │ │ │ ├── PulsarProducerProperties.java │ │ │ │ └── package-info.java │ │ │ │ └── provisioning │ │ │ │ ├── PulsarTopicProvisioner.java │ │ │ │ └── package-info.java │ │ └── resources │ │ │ └── META-INF │ │ │ ├── spring.binders │ │ │ └── spring │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ └── test │ │ └── java │ │ └── org │ │ └── springframework │ │ └── cloud │ │ └── stream │ │ └── binder │ │ └── pulsar │ │ ├── AbstractPulsarTestBinder.java │ │ ├── ConsumerConfigPropertiesTests.java │ │ ├── ProducerConfigPropertiesTests.java │ │ ├── PulsarBinderConfigurationPropertiesTests.java │ │ ├── PulsarBinderHeaderMapperTests.java │ │ ├── PulsarBinderIntegrationTests.java │ │ ├── PulsarBinderTests.java │ │ ├── PulsarBinderUtilsTests.java │ │ ├── PulsarExtendedBindingDefaultPropertiesTests.java │ │ ├── PulsarExtendedBindingPropertiesTests.java │ │ ├── PulsarTestBinder.java │ │ ├── PulsarTestContainerSupport.java │ │ └── PulsarTopicProvisionerTests.java └── rabbit-binder │ ├── .gitignore │ ├── .mvn │ ├── jvm.config │ ├── maven.config │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── .settings.xml │ ├── LICENSE │ ├── ci-docker-compose │ ├── docker-compose-RABBITMQ-stop.sh │ ├── docker-compose-RABBITMQ.sh │ └── docker-compose-RABBITMQ.yml │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ ├── spring-cloud-starter-stream-rabbit │ └── pom.xml │ ├── spring-cloud-stream-binder-rabbit-core │ ├── .jdk8 │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── stream │ │ │ └── binder │ │ │ └── rabbit │ │ │ ├── admin │ │ │ ├── RabbitAdminException.java │ │ │ └── RabbitBindingCleaner.java │ │ │ ├── properties │ │ │ ├── RabbitBinderConfigurationProperties.java │ │ │ ├── RabbitBindingProperties.java │ │ │ ├── RabbitCommonProperties.java │ │ │ ├── RabbitConsumerProperties.java │ │ │ ├── RabbitExtendedBindingProperties.java │ │ │ └── RabbitProducerProperties.java │ │ │ └── provisioning │ │ │ └── RabbitExchangeQueueProvisioner.java │ │ └── test │ │ └── java │ │ └── org │ │ └── springframework │ │ └── cloud │ │ └── stream │ │ └── binder │ │ └── rabbit │ │ └── provisioning │ │ └── RabbitExchangeQueueProvisionerTests.java │ ├── spring-cloud-stream-binder-rabbit-test-support │ ├── .jdk8 │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── springframework │ │ └── cloud │ │ └── stream │ │ └── binder │ │ └── test │ │ └── junit │ │ └── rabbit │ │ ├── AbstractExternalResourceTestSupport.java │ │ └── RabbitTestSupport.java │ ├── spring-cloud-stream-binder-rabbit │ ├── .jdk8 │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── springframework │ │ │ │ └── cloud │ │ │ │ └── stream │ │ │ │ └── binder │ │ │ │ └── rabbit │ │ │ │ ├── BatchCapableRejectAndDontRequeueRecoverer.java │ │ │ │ ├── RabbitExpressionEvaluatingInterceptor.java │ │ │ │ ├── RabbitMessageChannelBinder.java │ │ │ │ ├── StreamUtils.java │ │ │ │ ├── aot │ │ │ │ └── RabbitBinderRuntimeHints.java │ │ │ │ ├── config │ │ │ │ ├── DefaultMessageConverterHelper.java │ │ │ │ ├── ExtendedBindingHandlerMappingsProviderConfiguration.java │ │ │ │ ├── MessageConverterHelperConfiguration.java │ │ │ │ ├── RabbitBinderConfiguration.java │ │ │ │ ├── RabbitConfiguration.java │ │ │ │ └── RabbitMessageChannelBinderConfiguration.java │ │ │ │ └── deployer │ │ │ │ ├── RabbitDeployer.java.todo │ │ │ │ └── RabbitDeployerEnvironmentPostProcessor.java │ │ └── resources │ │ │ └── META-INF │ │ │ ├── spring.binders │ │ │ ├── spring.factories │ │ │ └── spring │ │ │ ├── aot.factories │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── stream │ │ │ └── binder │ │ │ └── rabbit │ │ │ ├── BatchCapableRejectAndDontRequeueRecovererTest.java │ │ │ ├── FunctionBatchingConversionTests.java │ │ │ ├── RabbitBinderCleanerTests.java │ │ │ ├── RabbitBinderTests.java │ │ │ ├── RabbitTestBinder.java │ │ │ ├── RabbitTestContainer.java │ │ │ ├── RepublishUnitTests.java │ │ │ ├── RestUtils.java │ │ │ ├── integration │ │ │ ├── RabbitBinderModuleTests.java │ │ │ └── RabbitMultiBinderObservationTests.java │ │ │ ├── stream │ │ │ └── RabbitStreamBinderModuleTests.java │ │ │ └── stream2 │ │ │ └── RabbitStreamBinderModuleIntegrationTests.java │ │ └── resources │ │ ├── log4j.properties │ │ └── rabbit-multi-binder-observation.yml │ └── src │ └── checkstyle │ └── checkstyle-suppressions.xml ├── bom ├── .editorconfig ├── .gitignore ├── .gitmodules ├── .mvn │ ├── jvm.config │ ├── maven.config │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── .springformat ├── LICENSE.txt ├── README.adoc ├── mvnw ├── mvnw.cmd ├── pom.xml ├── spring-cloud-starter-parent │ └── pom.xml └── spring-cloud-stream-dependencies │ └── pom.xml ├── buildCore.sh ├── buildDependencies.sh ├── buildKafkaBinder.sh ├── buildPulsarBinder.sh ├── buildRabbitBinder.sh ├── buildSchemaRegistry.sh ├── core ├── pom.xml ├── spring-cloud-stream-integration-tests │ ├── pom.xml │ └── src │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── stream │ │ │ ├── binder │ │ │ ├── BasicAbstractMessageChannelBinderTests.java │ │ │ ├── BinderErrorChannelTests.java │ │ │ ├── ErrorBindingTests.java │ │ │ ├── PollableConsumerTests.java │ │ │ └── tck │ │ │ │ └── ContentTypeTckTests.java │ │ │ ├── binding │ │ │ ├── BindingServiceTests.java │ │ │ ├── ExplicitBindingTests.java │ │ │ └── FluxMessageChannelBindingTests.java │ │ │ ├── config │ │ │ ├── BindingHandlerAdviseTests.java │ │ │ ├── BindingServiceConfigurationTests.java │ │ │ └── RetryTemplateTests.java │ │ │ ├── endpoint │ │ │ └── ActuatorBindingsTest.java │ │ │ ├── function │ │ │ ├── DynamicDestinationFunctionTests.java │ │ │ ├── FunctionBatchingTests.java │ │ │ ├── FunctionPostProcessingTests.java │ │ │ ├── GreenfieldFunctionEnableBindingTests.java │ │ │ ├── HeaderTests.java │ │ │ ├── ImplicitFunctionBindingTests.java │ │ │ ├── MultipleInputOutputFunctionTests.java │ │ │ ├── PollableSourceTests.java │ │ │ ├── RoutingFunctionTests.java │ │ │ ├── ScenarioTests.java │ │ │ ├── StreamBridgeTests.java │ │ │ └── edgecases │ │ │ │ └── GH1801Test.java │ │ │ ├── kotlin │ │ │ └── KotlinConfigurationTests.java │ │ │ └── utils │ │ │ └── IntegrationTestsMockBinderConfiguration.java │ │ ├── kotlin │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── stream │ │ │ └── kotlin │ │ │ └── KotlinTestConfiguration.kt │ │ └── resources │ │ └── binder1 │ │ └── META-INF │ │ └── spring.binders ├── spring-cloud-stream-test-binder │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── stream │ │ │ └── binder │ │ │ └── test │ │ │ ├── AbstractDestination.java │ │ │ ├── EnableTestBinder.java │ │ │ ├── FunctionBindingTestUtils.java │ │ │ ├── InputDestination.java │ │ │ ├── OutputDestination.java │ │ │ ├── TestChannelBinder.java │ │ │ ├── TestChannelBinderConfiguration.java │ │ │ └── TestChannelBinderProvisioner.java │ │ └── test │ │ └── java │ │ └── org │ │ └── springframework │ │ └── cloud │ │ └── stream │ │ └── binder │ │ └── test │ │ └── TestChannelBinderTests.java ├── spring-cloud-stream-test-support │ ├── .jdk8 │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── stream │ │ │ └── binder │ │ │ ├── AbstractBinderTests.java │ │ │ ├── AbstractPollableConsumerTestBinder.java │ │ │ ├── AbstractTestBinder.java │ │ │ ├── BinderTestEnvironmentPostProcessor.java │ │ │ ├── BinderTestUtils.java │ │ │ ├── PartitionCapableBinderTests.java │ │ │ ├── PartitionTestSupport.java │ │ │ ├── Spy.java │ │ │ └── TestUtils.java │ │ └── resources │ │ └── META-INF │ │ └── spring.factories └── spring-cloud-stream │ ├── .jdk8 │ ├── pom.xml │ ├── src │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── springframework │ │ │ │ └── cloud │ │ │ │ └── stream │ │ │ │ ├── annotation │ │ │ │ └── StreamRetryTemplate.java │ │ │ │ ├── aot │ │ │ │ └── StreamRuntimeHints.java │ │ │ │ ├── binder │ │ │ │ ├── AbstractBinder.java │ │ │ │ ├── AbstractExtendedBindingProperties.java │ │ │ │ ├── AbstractMessageChannelBinder.java │ │ │ │ ├── Binder.java │ │ │ │ ├── BinderChildContextInitializer.java │ │ │ │ ├── BinderConfiguration.java │ │ │ │ ├── BinderCustomizer.java │ │ │ │ ├── BinderErrorChannel.java │ │ │ │ ├── BinderException.java │ │ │ │ ├── BinderFactory.java │ │ │ │ ├── BinderHeaders.java │ │ │ │ ├── BinderSpecificPropertiesProvider.java │ │ │ │ ├── BinderType.java │ │ │ │ ├── BinderTypeRegistry.java │ │ │ │ ├── BinderWrapper.java │ │ │ │ ├── Binding.java │ │ │ │ ├── BindingCleaner.java │ │ │ │ ├── BindingCreatedEvent.java │ │ │ │ ├── ConsumerProperties.java │ │ │ │ ├── DefaultBinderFactory.java │ │ │ │ ├── DefaultBinderTypeRegistry.java │ │ │ │ ├── DefaultBinding.java │ │ │ │ ├── DefaultPollableMessageSource.java │ │ │ │ ├── DirectHandler.java │ │ │ │ ├── EmbeddedHeaderUtils.java │ │ │ │ ├── ExtendedBindingProperties.java │ │ │ │ ├── ExtendedConsumerProperties.java │ │ │ │ ├── ExtendedProducerProperties.java │ │ │ │ ├── ExtendedPropertiesBinder.java │ │ │ │ ├── FinalRethrowingErrorMessageHandler.java │ │ │ │ ├── HeaderMode.java │ │ │ │ ├── JavaClassMimeTypeUtils.java │ │ │ │ ├── LastSubscriberAwareChannel.java │ │ │ │ ├── LastSubscriberMessageHandler.java │ │ │ │ ├── MessageValues.java │ │ │ │ ├── PartitionHandler.java │ │ │ │ ├── PartitionKeyExtractorStrategy.java │ │ │ │ ├── PartitionSelectorStrategy.java │ │ │ │ ├── PollableConsumerBinder.java │ │ │ │ ├── PollableMessageSource.java │ │ │ │ ├── PollableSource.java │ │ │ │ ├── ProducerProperties.java │ │ │ │ └── RequeueCurrentMessageException.java │ │ │ │ ├── binding │ │ │ │ ├── AbstractBindableProxyFactory.java │ │ │ │ ├── AbstractBindingLifecycle.java │ │ │ │ ├── AbstractBindingTargetFactory.java │ │ │ │ ├── Bindable.java │ │ │ │ ├── BindableProxyFactory.java │ │ │ │ ├── BinderAwareRouter.java │ │ │ │ ├── BindingService.java │ │ │ │ ├── BindingTargetFactory.java │ │ │ │ ├── BindingsLifecycleController.java │ │ │ │ ├── BoundTargetHolder.java │ │ │ │ ├── CompositeMessageChannelConfigurer.java │ │ │ │ ├── ContextStartAfterRefreshListener.java │ │ │ │ ├── DefaultPartitioningInterceptor.java │ │ │ │ ├── DynamicDestinationsBindable.java │ │ │ │ ├── FluxMessageChannelBindingTargetFactory.java │ │ │ │ ├── InputBindingLifecycle.java │ │ │ │ ├── MessageChannelAndSourceConfigurer.java │ │ │ │ ├── MessageChannelConfigurer.java │ │ │ │ ├── MessageConverterConfigurer.java │ │ │ │ ├── MessageSourceBindingTargetFactory.java │ │ │ │ ├── NewDestinationBindingCallback.java │ │ │ │ ├── OutputBindingLifecycle.java │ │ │ │ ├── StreamAnnotationErrorMessages.java │ │ │ │ ├── SubscribableChannelBindingTargetFactory.java │ │ │ │ └── SupportedBindableFeatures.java │ │ │ │ ├── config │ │ │ │ ├── BinderFactoryAutoConfiguration.java │ │ │ │ ├── BinderProperties.java │ │ │ │ ├── BindersHealthIndicatorAutoConfiguration.java │ │ │ │ ├── BindingHandlerAdvise.java │ │ │ │ ├── BindingProperties.java │ │ │ │ ├── BindingServiceConfiguration.java │ │ │ │ ├── BindingServiceProperties.java │ │ │ │ ├── BindingsEndpointAutoConfiguration.java │ │ │ │ ├── ChannelsEndpointAutoConfiguration.java │ │ │ │ ├── ConsumerEndpointCustomizer.java │ │ │ │ ├── ContentTypeConfiguration.java │ │ │ │ ├── ListenerContainerCustomizer.java │ │ │ │ ├── MessageSourceCustomizer.java │ │ │ │ ├── PollerConfigEnvironmentPostProcessor.java │ │ │ │ ├── ProducerMessageHandlerCustomizer.java │ │ │ │ ├── SmartMessageMethodArgumentResolver.java │ │ │ │ ├── SmartPayloadArgumentResolver.java │ │ │ │ ├── SpelExpressionConverterConfiguration.java │ │ │ │ ├── SpringIntegrationProperties.java │ │ │ │ └── VersionExtractor.java │ │ │ │ ├── converter │ │ │ │ ├── CompositeMessageConverterFactory.java │ │ │ │ ├── ConversionException.java │ │ │ │ ├── CustomMimeTypeConverter.java │ │ │ │ ├── MessageConverterUtils.java │ │ │ │ └── ObjectStringMessageConverter.java │ │ │ │ ├── endpoint │ │ │ │ ├── BindingsEndpoint.java │ │ │ │ └── ChannelsEndpoint.java │ │ │ │ ├── function │ │ │ │ ├── BindableFunctionProxyFactory.java │ │ │ │ ├── FunctionConfiguration.java │ │ │ │ ├── FunctionConstants.java │ │ │ │ ├── PartitionAwareFunctionWrapper.java │ │ │ │ ├── PollableSourceInitializer.java │ │ │ │ ├── RoutingFunctionEnvironmentPostProcessor.java │ │ │ │ ├── StandardBatchUtils.java │ │ │ │ ├── StreamBridge.java │ │ │ │ ├── StreamFunctionConfigurationProperties.java │ │ │ │ ├── StreamFunctionProperties.java │ │ │ │ └── StreamOperations.java │ │ │ │ ├── messaging │ │ │ │ └── DirectWithAttributesChannel.java │ │ │ │ ├── provisioning │ │ │ │ ├── ConsumerDestination.java │ │ │ │ ├── ProducerDestination.java │ │ │ │ ├── ProvisioningException.java │ │ │ │ └── ProvisioningProvider.java │ │ │ │ ├── reflection │ │ │ │ └── GenericsUtils.java │ │ │ │ └── utils │ │ │ │ └── CacheKeyCreatorUtils.java │ │ └── resources │ │ │ ├── META-INF │ │ │ ├── additional-spring-configuration-metadata.json │ │ │ ├── shared.beans │ │ │ ├── spring.factories │ │ │ └── spring │ │ │ │ ├── aot.factories │ │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ │ └── banner.txt │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── stream │ │ │ ├── binder │ │ │ ├── AbstractMessageChannelBinderTests.java │ │ │ ├── BinderChildContextInitializerTests.java │ │ │ ├── BindingTargetTests.java │ │ │ ├── DefaultBinderFactoryTests.java │ │ │ ├── DefaultBinderTests.java │ │ │ ├── ExtendedPropertiesDefaultTests.java │ │ │ ├── InputOutputBindingOrderTest.java │ │ │ ├── MessageConverterTests.java │ │ │ └── SinkBindingWithDefaultsTests.java │ │ │ ├── binding │ │ │ ├── BindingLifecycleTests.java │ │ │ ├── CustomPartitionedProducerTest.java │ │ │ └── MessageConverterConfigurerTests.java │ │ │ ├── config │ │ │ ├── ArgumentResolversTests.java │ │ │ └── SpelExpressionConverterConfigurationTests.java │ │ │ ├── function │ │ │ └── StandardBatchUtilsTests.java │ │ │ ├── partitioning │ │ │ ├── CustomPartitionKeyExtractorClass.java │ │ │ ├── CustomPartitionSelectorClass.java │ │ │ └── PartitionedConsumerTest.java │ │ │ └── utils │ │ │ ├── FooBindingProperties.java │ │ │ ├── FooConsumerProperties.java │ │ │ ├── FooExtendedBindingProperties.java │ │ │ ├── FooProducerProperties.java │ │ │ ├── MockBinderConfiguration.java │ │ │ └── MockExtendedBinderConfiguration.java │ │ └── resources │ │ ├── META-INF │ │ └── spring.binders │ │ ├── application.yml │ │ ├── binder-aot-test │ │ └── application.yml │ │ ├── binder1 │ │ └── META-INF │ │ │ └── spring.binders │ │ ├── binder2 │ │ └── META-INF │ │ │ └── spring.binders │ │ └── org │ │ └── springframework │ │ └── cloud │ │ └── stream │ │ └── binder │ │ ├── arbitrary-binding-test.properties │ │ ├── cloud-function-test.properties │ │ ├── custom-partitioned-producer-test.properties │ │ ├── partitioned-consumer-test.properties │ │ ├── partitioned-producer-test.properties │ │ ├── processor-binding-test.properties │ │ ├── sink-binding-test.properties │ │ └── source-binding-test.properties │ └── work.txt ├── docs ├── .jdk8 ├── antora-playbook.yml ├── antora.yml ├── modules │ └── ROOT │ │ ├── assets │ │ └── images │ │ │ ├── SCSt-groups.png │ │ │ ├── SCSt-overview.png │ │ │ ├── SCSt-partitioning.png │ │ │ ├── SCSt-sensors.png │ │ │ ├── SCSt-with-binder.png │ │ │ ├── custom_vs_global_error_channels.png │ │ │ ├── part-bindings.png │ │ │ ├── part-exchange.png │ │ │ ├── part-queues.png │ │ │ ├── producers-consumers.png │ │ │ ├── redis-binder.png │ │ │ ├── registration.png │ │ │ ├── schema_reading.png │ │ │ ├── schema_resolution.png │ │ │ └── spring-initializr.png │ │ ├── nav.adoc │ │ └── pages │ │ ├── README.adoc │ │ ├── binders.adoc │ │ ├── configprops.adoc │ │ ├── index.adoc │ │ ├── intro.adoc │ │ ├── kafka │ │ ├── kafka-binder │ │ │ ├── admin-client-config-cust.adoc │ │ │ ├── config-options.adoc │ │ │ ├── cons-prod-config-cust.adoc │ │ │ ├── consume-batches.adoc │ │ │ ├── container-cust-kafka-binder.adoc │ │ │ ├── custom-health-ind.adoc │ │ │ ├── dlq-partition.adoc │ │ │ ├── dlq.adoc │ │ │ ├── error-channels.adoc │ │ │ ├── manual-ack.adoc │ │ │ ├── metrics.adoc │ │ │ ├── overview.adoc │ │ │ ├── partitions.adoc │ │ │ ├── pause_resume.adoc │ │ │ ├── rebalance_listener.adoc │ │ │ ├── reset-offsets.adoc │ │ │ ├── retry-dlq.adoc │ │ │ ├── security-config.adoc │ │ │ ├── tombstone.adoc │ │ │ ├── transactional.adoc │ │ │ └── usage.adoc │ │ ├── kafka-reactive-binder │ │ │ ├── concurrency.adoc │ │ │ ├── consuming.adoc │ │ │ ├── examples.adoc │ │ │ ├── health_indicator.adoc │ │ │ ├── multiplex.adoc │ │ │ ├── overview.adoc │ │ │ ├── pattern.adoc │ │ │ ├── reactive_observability.adoc │ │ │ ├── sender_result.adoc │ │ │ └── usage.adoc │ │ ├── kafka-streams-binder │ │ │ ├── accessing-metrics.adoc │ │ │ ├── ancillaries-to-the-programming-model.adoc │ │ │ ├── binding-visualization-and-control-in-binder.adoc │ │ │ ├── configuration-options.adoc │ │ │ ├── error-handling.adoc │ │ │ ├── event-type-based-routing-in-applications.adoc │ │ │ ├── health-indicator.adoc │ │ │ ├── interactive-queries.adoc │ │ │ ├── manually-starting-processors-selectively.adoc │ │ │ ├── manually-starting-processors.adoc │ │ │ ├── mixing-high-level-dsl-and-low-level-processor-api.adoc │ │ │ ├── multi-binders-with-based-binders-and-regular-binder.adoc │ │ │ ├── overview.adoc │ │ │ ├── partition-support-on-the-outbound.adoc │ │ │ ├── programming-model.adoc │ │ │ ├── record-serialization-and-deserialization.adoc │ │ │ ├── retrying-critical-business-logic.adoc │ │ │ ├── state-cleanup.adoc │ │ │ ├── state-store.adoc │ │ │ ├── streamsbuilderfactorybean-customizer.adoc │ │ │ ├── timestamp-extractor.adoc │ │ │ ├── topology-visualization.adoc │ │ │ ├── tracing-using-spring-cloud-sleuth.adoc │ │ │ └── usage.adoc │ │ ├── kafka-streams.adoc │ │ ├── kafka_overview.adoc │ │ ├── kafka_reactive_binder.adoc │ │ ├── kafka_tips.adoc │ │ └── spring-cloud-stream-binder-kafka.adoc │ │ ├── observability.adoc │ │ ├── preface.adoc │ │ ├── pulsar │ │ ├── pulsar_binder.adoc │ │ └── spring-cloud-stream-binder-pulsar.adoc │ │ ├── rabbit │ │ ├── rabbit_dlq.adoc │ │ ├── rabbit_overview.adoc │ │ ├── rabbit_overview │ │ │ ├── advanced-binding-configuration.adoc │ │ │ ├── advanced-listener-container-configuration.adoc │ │ │ ├── binder-properties.adoc │ │ │ ├── error-channels.adoc │ │ │ ├── existing-destinations.adoc │ │ │ ├── health-indicator.adoc │ │ │ ├── prod-props.adoc │ │ │ ├── publisher-confirms.adoc │ │ │ ├── putting-it-all-together.adoc │ │ │ ├── rabbitmq-consumer-properties.adoc │ │ │ ├── rabbitmq-retry.adoc │ │ │ ├── rabbitmq-stream-consumer.adoc │ │ │ ├── rabbitmq-stream-producer.adoc │ │ │ └── receiving-batch.adoc │ │ ├── rabbit_partitions.adoc │ │ └── spring-cloud-stream-binder-rabbit.adoc │ │ ├── sagan-index.adoc │ │ ├── schema-registry │ │ └── spring-cloud-stream-schema-registry.adoc │ │ ├── spring-cloud-stream.adoc │ │ └── spring-cloud-stream │ │ ├── application-communication.adoc │ │ ├── binder-configuration-properties.adoc │ │ ├── binder-customizer.adoc │ │ ├── binder-detection.adoc │ │ ├── binders.adoc │ │ ├── binding-names.adoc │ │ ├── binding-properties.adoc │ │ ├── binding-service-properties.adoc │ │ ├── binding_visualization_control.adoc │ │ ├── bindings.adoc │ │ ├── configuration-options.adoc │ │ ├── consumer-groups.adoc │ │ ├── consumer-types.adoc │ │ ├── content-type.adoc │ │ ├── deploying-applications-on-cloudfoundry.adoc │ │ ├── destination-binders.adoc │ │ ├── event-routing.adoc │ │ ├── explicit-binding-creation.adoc │ │ ├── functional-binding-names.adoc │ │ ├── health-indicator.adoc │ │ ├── mechanics.adoc │ │ ├── multiple-binders.adoc │ │ ├── multiple-systems.adoc │ │ ├── overview-application-model.adoc │ │ ├── overview-binder-abstraction.adoc │ │ ├── overview-binder-api.adoc │ │ ├── overview-connecting-multiple-application-instances.adoc │ │ ├── overview-custom-binder-impl.adoc │ │ ├── overview-error-handling.adoc │ │ ├── overview-instance-index-instance-count.adoc │ │ ├── overview-partitioning.adoc │ │ ├── overview-persistent-publish-subscribe-support.adoc │ │ ├── overview-user-defined-message-converters.adoc │ │ ├── post-processing-after-sending-message.adoc │ │ ├── producing-and-consuming-messages.adoc │ │ ├── programming-model.adoc │ │ ├── provided-messageconverters.adoc │ │ ├── samples.adoc │ │ └── spring_integration_test_binder.adoc ├── package.json ├── pom.xml └── src │ └── main │ ├── antora │ └── resources │ │ └── antora-resources │ │ └── antora.yml │ ├── asciidoc │ ├── ghpages.sh │ ├── images │ │ ├── SCSt-groups.png │ │ ├── SCSt-overview.png │ │ ├── SCSt-partitioning.png │ │ ├── SCSt-sensors.png │ │ ├── SCSt-with-binder.png │ │ ├── custom_vs_global_error_channels.png │ │ ├── producers-consumers.png │ │ ├── redis-binder.png │ │ ├── registration.png │ │ ├── schema_reading.png │ │ ├── schema_resolution.png │ │ └── spring-initializr.png │ ├── kafka │ │ └── images │ │ │ ├── kafka-binder.png │ │ │ ├── kafka-streams-initializr.png │ │ │ └── spring-initializr-kafka-streams.png │ └── rabbit │ │ └── images │ │ └── rabbit-binder.png │ └── ruby │ └── generate_readme.sh ├── mvnw ├── mvnw.cmd ├── pom.xml ├── schema-registry ├── pom.xml ├── spring-cloud-stream-schema-registry-client │ ├── .jdk8 │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── springframework │ │ │ │ └── cloud │ │ │ │ └── stream │ │ │ │ └── schema │ │ │ │ └── registry │ │ │ │ ├── ParsedSchema.java │ │ │ │ ├── SchemaNotFoundException.java │ │ │ │ ├── SchemaReference.java │ │ │ │ ├── SchemaRegistrationResponse.java │ │ │ │ ├── avro │ │ │ │ ├── AbstractAvroMessageConverter.java │ │ │ │ ├── AvroMessageConverterAutoConfiguration.java │ │ │ │ ├── AvroMessageConverterProperties.java │ │ │ │ ├── AvroSchemaMessageConverter.java │ │ │ │ ├── AvroSchemaRegistryClientMessageConverter.java │ │ │ │ ├── AvroSchemaServiceManager.java │ │ │ │ ├── AvroSchemaServiceManagerImpl.java │ │ │ │ ├── DefaultSubjectNamingStrategy.java │ │ │ │ ├── OriginalContentTypeResolver.java │ │ │ │ ├── QualifiedSubjectNamingStrategy.java │ │ │ │ ├── SubjectNamingStrategy.java │ │ │ │ └── SubjectPrefixOnlyNamingStrategy.java │ │ │ │ └── client │ │ │ │ ├── CachingRegistryClient.java │ │ │ │ ├── ConfluentSchemaRegistryClient.java │ │ │ │ ├── DefaultSchemaRegistryClient.java │ │ │ │ ├── EnableSchemaRegistryClient.java │ │ │ │ ├── SchemaRegistryClient.java │ │ │ │ └── config │ │ │ │ ├── SchemaRegistryClientConfiguration.java │ │ │ │ └── SchemaRegistryClientProperties.java │ │ └── resources │ │ │ └── META-INF │ │ │ └── spring │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ └── test │ │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── stream │ │ │ └── schema │ │ │ ├── avro │ │ │ ├── AvroSchemaMessageConverterTests.java │ │ │ ├── AvroSchemaServiceManagerTests.java │ │ │ ├── AvroSchemaWithMultipleRecordsTest.java │ │ │ ├── StubSchemaRegistryClient.java │ │ │ ├── SubjectNamingStrategyTest.java │ │ │ ├── User1.java │ │ │ ├── User2.java │ │ │ ├── client │ │ │ │ └── ConfluentSchemaRegistryClientTests.java │ │ │ ├── domain │ │ │ │ └── FoodOrder.java │ │ │ └── v2 │ │ │ │ └── User1.java │ │ │ └── serialization │ │ │ ├── AvroMessageConverterSerializationTests.java │ │ │ └── AvroSchemaRegistryClientMessageConverterTests.java │ │ └── resources │ │ └── schemas │ │ ├── Command.avsc │ │ ├── imports │ │ ├── Email.avsc │ │ ├── PushNotification.avsc │ │ └── Sms.avsc │ │ ├── status.avsc │ │ ├── user.avsc │ │ ├── user1_multiple_records.schema │ │ ├── user1_v1.schema │ │ ├── user1_v2.schema │ │ ├── user_v2.avsc │ │ ├── users_v1.schema │ │ └── users_v2.schema ├── spring-cloud-stream-schema-registry-core │ ├── .jdk8 │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── org │ │ │ │ └── springframework │ │ │ │ └── cloud │ │ │ │ └── stream │ │ │ │ └── schema │ │ │ │ └── registry │ │ │ │ ├── EnableSchemaRegistryServer.java │ │ │ │ ├── config │ │ │ │ ├── SchemaServerConfiguration.java │ │ │ │ └── SchemaServerProperties.java │ │ │ │ ├── controllers │ │ │ │ └── ServerController.java │ │ │ │ ├── model │ │ │ │ ├── Compatibility.java │ │ │ │ └── Schema.java │ │ │ │ ├── repository │ │ │ │ └── SchemaRepository.java │ │ │ │ └── support │ │ │ │ ├── AvroSchemaValidator.java │ │ │ │ ├── InvalidSchemaException.java │ │ │ │ ├── SchemaDeletionNotAllowedException.java │ │ │ │ ├── SchemaNotFoundException.java │ │ │ │ ├── SchemaValidator.java │ │ │ │ └── UnsupportedFormatException.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── org │ │ └── springframework │ │ └── cloud │ │ └── stream │ │ └── schema │ │ └── registry │ │ └── entityScanning │ │ ├── AbstractServerControllerTest.java │ │ ├── EntityScanningTests.java │ │ ├── EntityScanningTestsWithEntityScan.java │ │ ├── ServerControllerTest.java │ │ └── domain │ │ └── TestEntity.java └── spring-cloud-stream-schema-registry-server │ ├── .jdk8 │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── cloud │ │ │ └── stream │ │ │ └── schema │ │ │ └── registry │ │ │ └── server │ │ │ └── SchemaRegistryServerApplication.java │ └── resources │ │ ├── META-INF │ │ └── spring.factories │ │ └── application.yml │ └── test │ ├── java │ └── org │ │ └── springframework │ │ └── cloud │ │ └── stream │ │ └── schema │ │ └── registry │ │ └── server │ │ └── SchemaRegistryServerAvroTests.java │ └── resources │ ├── avro_user_definition_schema_v1.json │ ├── avro_user_definition_schema_v2.json │ └── invalid_schema.json └── tools ├── kafka └── docker-compose │ ├── README.adoc │ ├── control-center-ui.yml │ ├── kafka-cluster.yml │ ├── kraft.yml │ └── schema-registry.yml └── rabbitmq └── docker-compose.yml /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | indent_style = tab 8 | indent_size = 4 9 | end_of_line = lf 10 | insert_final_newline = true 11 | 12 | [*.yml] 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.java] 17 | ij_java_names_count_to_use_import_on_demand = 999 18 | ij_java_class_count_to_use_import_on_demand = 999 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/new-issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: New Issue 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Thanks for considering raising a Spring Cloud Stream issue. Please take the time to review the following categories as some of them do not apply here. 11 | 12 | 🙅 "Please DO NOT Raise an Issue" Cases 13 | - Question 14 | STOP!! Please ask questions about how to use something, or to understand why something isn't working as you expect it to, on Stack Overflow using the spring-cloud-stream tag. 15 | - Security Vulnerability 16 | STOP!! Please don't raise security vulnerabilities here. Head over to https://pivotal.io/security to learn how to disclose them responsibly. 17 | - With an Immediate Pull Request 18 | An issue will be closed as a duplicate of the immediate pull request, so you don't have to raise an issue if you plan to create a pull request immediately. 19 | 20 | If your case does not match any of he above categories. . . 21 | 22 | **Describe the issue** 23 | A clear and concise description of what the bug is. 24 | 25 | **To Reproduce** 26 | Steps to reproduce the behavior: 27 | 1. Go to '...' 28 | 2. Click on '....' 29 | 3. Scroll down to '....' 30 | 4. See error 31 | 32 | **Version of the framework** 33 | **Expected behavior** 34 | **Screenshots** 35 | 36 | **Additional context** 37 | Add any other context about the problem here. 38 | -------------------------------------------------------------------------------- /.github/dco.yml: -------------------------------------------------------------------------------- 1 | require: 2 | members: false 3 | -------------------------------------------------------------------------------- /.github/workflows/deploy-docs.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Docs 2 | on: 3 | push: 4 | branches-ignore: [ gh-pages ] 5 | tags: '**' 6 | repository_dispatch: 7 | types: request-build-reference # legacy 8 | #schedule: 9 | #- cron: '0 10 * * *' # Once per day at 10am UTC 10 | workflow_dispatch: 11 | permissions: 12 | actions: write 13 | jobs: 14 | build: 15 | runs-on: ubuntu-latest 16 | # if: github.repository_owner == 'spring-cloud' 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@v3 20 | with: 21 | ref: docs-build 22 | fetch-depth: 1 23 | - name: Dispatch (partial build) 24 | if: github.ref_type == 'branch' 25 | env: 26 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 27 | run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }} 28 | - name: Dispatch (full build) 29 | if: github.ref_type == 'tag' 30 | env: 31 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 32 | run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /application.yml 2 | /application.properties 3 | asciidoctor.css 4 | *~ 5 | .#* 6 | *# 7 | target/ 8 | build/ 9 | bin/ 10 | _site/ 11 | .classpath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache/ 16 | .attach_pid* 17 | .DS_Store 18 | *.sw* 19 | *.iml 20 | *.ipr 21 | *.iws 22 | .idea/* 23 | .factorypath 24 | dump.rdb 25 | .apt_generated 26 | artifacts 27 | **/dependency-reduced-pom.xml 28 | 29 | node 30 | node_modules 31 | build 32 | /package.json 33 | package-lock.json 34 | -------------------------------------------------------------------------------- /.jdk8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/.jdk8 -------------------------------------------------------------------------------- /.mvn/jvm.config: -------------------------------------------------------------------------------- 1 | -Xmx1024m -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom -------------------------------------------------------------------------------- /.mvn/maven.config: -------------------------------------------------------------------------------- 1 | -DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local -P spring 2 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /.springformat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/.springformat -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | cache: 3 | directories: 4 | - $HOME/.m2 5 | language: java 6 | jdk: 7 | - oraclejdk8 8 | install: true 9 | # The environment variable ${TRAVIS_PULL_REQUEST} is set to "false" when the build 10 | # is for a normal branch commit. When the build is for a pull request, it will 11 | # contain the pull request’s number. 12 | script: 13 | - '[ "${TRAVIS_PULL_REQUEST}" != "false" ] || ./mvnw package -Pspring,full -U -Dmaven.test.redirectTestOutputToFile=false' 14 | - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] || ./mvnw package -Pspring -U -Dmaven.test.redirectTestOutputToFile=false' 15 | after_success: 16 | - bash <(curl -s https://codecov.io/bash) 17 | dist: trusty 18 | -------------------------------------------------------------------------------- /binders/kafka-binder/.gitignore: -------------------------------------------------------------------------------- 1 | /application.yml 2 | /application.properties 3 | asciidoctor.css 4 | *~ 5 | .#* 6 | *# 7 | target/ 8 | build/ 9 | bin/ 10 | _site/ 11 | .classpath 12 | .project 13 | .settings 14 | .springBeans 15 | .DS_Store 16 | *.sw* 17 | *.iml 18 | *.ipr 19 | *.iws 20 | .idea/* 21 | */.idea 22 | .factorypath 23 | dump.rdb 24 | .apt_generated 25 | artifacts 26 | .sts4-cache 27 | -------------------------------------------------------------------------------- /binders/kafka-binder/.jdk8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/binders/kafka-binder/.jdk8 -------------------------------------------------------------------------------- /binders/kafka-binder/.mvn/jvm.config: -------------------------------------------------------------------------------- 1 | -Xmx1024m -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom -------------------------------------------------------------------------------- /binders/kafka-binder/.mvn/maven.config: -------------------------------------------------------------------------------- 1 | -DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local -P spring 2 | -------------------------------------------------------------------------------- /binders/kafka-binder/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/binders/kafka-binder/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /binders/kafka-binder/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-starter-stream-kafka/.jdk8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/binders/kafka-binder/spring-cloud-starter-stream-kafka/.jdk8 -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-starter-stream-kafka/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.springframework.cloud 6 | spring-cloud-stream-binder-kafka-parent 7 | 4.3.1-SNAPSHOT 8 | 9 | spring-cloud-starter-stream-kafka 10 | Spring Cloud Starter Stream Kafka 11 | https://projects.spring.io/spring-cloud 12 | 13 | Pivotal Software, Inc. 14 | https://www.spring.io 15 | 16 | 17 | ${basedir}/../.. 18 | 19 | 20 | 21 | org.springframework.cloud 22 | spring-cloud-stream-binder-kafka 23 | ${project.version} 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-core/.jdk8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/.jdk8 -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/common/TopicInformation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder.kafka.common; 18 | 19 | import java.util.Collection; 20 | 21 | import org.apache.kafka.common.PartitionInfo; 22 | 23 | /** 24 | * Record to capture topic information for various binder related tasks. 25 | * 26 | * @param consumerGroup consumer group for the consumer 27 | * @param partitionInfos collection of {@link PartitionInfo} 28 | * @param isTopicPattern if the topic is specified as a pattern 29 | * 30 | * @author Soby Chacko (and previous authors before refactoring). 31 | */ 32 | public record TopicInformation(String consumerGroup, Collection partitionInfos, boolean isTopicPattern) { 33 | 34 | public boolean isConsumerTopic() { 35 | return this.consumerGroup != null; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/provisioning/AdminClientConfigCustomizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder.kafka.provisioning; 18 | 19 | import java.util.Map; 20 | 21 | /** 22 | * Customizer for configuring AdminClient. 23 | * 24 | * @author Soby Chacko 25 | * @since 3.1.2 26 | */ 27 | @FunctionalInterface 28 | public interface AdminClientConfigCustomizer { 29 | 30 | void configure(Map adminClientProperties); 31 | } 32 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/support/ConsumerConfigCustomizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder.kafka.support; 18 | 19 | import java.util.Map; 20 | 21 | /** 22 | * This customizer is called by the binder to customize consumer configuration in 23 | * Kafka Consumer factory. 24 | * 25 | * @author Soby Chacko 26 | * @since 3.0.9 27 | */ 28 | @FunctionalInterface 29 | public interface ConsumerConfigCustomizer { 30 | 31 | void configure(Map consumerProperties, String bindingName, String destination); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/support/ProducerConfigCustomizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder.kafka.support; 18 | 19 | import java.util.Map; 20 | 21 | /** 22 | * This customizer is called by the binder to customize producer configuration in 23 | * Kafka Producer factory. 24 | * 25 | * @author Soby Chacko 26 | * @since 3.0.9 27 | */ 28 | @FunctionalInterface 29 | public interface ProducerConfigCustomizer { 30 | 31 | void configure(Map producerProperties, String bindingName, String destination); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/main/java/org/springframework/cloud/stream/binder/kafka/utils/DlqDestinationResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder.kafka.utils; 18 | 19 | import java.util.function.BiFunction; 20 | 21 | import org.apache.kafka.clients.consumer.ConsumerRecord; 22 | 23 | /** 24 | * A {@link BiFunction} extension for defining DLQ destination resolvers. 25 | * 26 | * The BiFunction takes the {@link ConsumerRecord} and the exception as inputs 27 | * and returns a topic name as the DLQ. 28 | * 29 | * @author Soby Chacko 30 | * @since 3.0.9 31 | */ 32 | @FunctionalInterface 33 | public interface DlqDestinationResolver extends BiFunction, Exception, String> { 34 | 35 | } 36 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/test/resources/test.truststore.ks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/test/resources/test.truststore.ks -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/test/resources/testclient.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/test/resources/testclient.keystore -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/test/resources/testclient.truststore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/binders/kafka-binder/spring-cloud-stream-binder-kafka-core/src/test/resources/testclient.truststore -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-reactive/src/main/java/org/springframework/cloud/stream/binder/reactorkafka/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Provides classes reactor-kafka binder support. 19 | */ 20 | package org.springframework.cloud.stream.binder.reactorkafka; 21 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-reactive/src/main/resources/META-INF/spring.binders: -------------------------------------------------------------------------------- 1 | reactorKafka:\ 2 | org.springframework.cloud.stream.binder.reactorkafka.ReactorKafkaBinderConfiguration 3 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-reactive/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.env.EnvironmentPostProcessor:\ 2 | org.springframework.cloud.stream.binder.kafka.common.KafkaBinderEnvironmentPostProcessor 3 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-reactive/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{ISO8601} %5p %t %c{2}:%L - %m%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-streams/.jdk8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/binders/kafka-binder/spring-cloud-stream-binder-kafka-streams/.jdk8 -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-streams/src/main/resources/META-INF/spring.binders: -------------------------------------------------------------------------------- 1 | kstream:\ 2 | org.springframework.cloud.stream.binder.kafka.streams.KStreamBinderConfiguration 3 | ktable:\ 4 | org.springframework.cloud.stream.binder.kafka.streams.KTableBinderConfiguration 5 | globalktable:\ 6 | org.springframework.cloud.stream.binder.kafka.streams.GlobalKTableBinderConfiguration 7 | 8 | 9 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-streams/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.env.EnvironmentPostProcessor=\ 2 | org.springframework.cloud.stream.binder.kafka.streams.KafkaStreamsBinderEnvironmentPostProcessor 3 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-streams/src/main/resources/META-INF/spring/aot.factories: -------------------------------------------------------------------------------- 1 | org.springframework.aot.hint.RuntimeHintsRegistrar=org.springframework.cloud.stream.binder.kafka.streams.aot.KafkaStreamsBinderRuntimeHints 2 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-streams/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | org.springframework.cloud.stream.binder.kafka.streams.ExtendedBindingHandlerMappingsProviderAutoConfiguration 2 | org.springframework.cloud.stream.binder.kafka.streams.KafkaStreamsBinderSupportAutoConfiguration 3 | org.springframework.cloud.stream.binder.kafka.streams.function.KafkaStreamsFunctionAutoConfiguration 4 | org.springframework.cloud.stream.binder.kafka.streams.endpoint.KafkaStreamsTopologyEndpointAutoConfiguration 5 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka-streams/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{ISO8601} %5p %t %c{2}:%L - %m%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka/.jdk8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/binders/kafka-binder/spring-cloud-stream-binder-kafka/.jdk8 -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka/src/main/java/org/springframework/cloud/stream/binder/kafka/BinderHeaderMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder.kafka; 18 | 19 | /** 20 | * @deprecated since 4.2.1 Please use org.springframework.cloud.stream.binder.kafka.common.BinderHeaderMapper 21 | * 22 | */ 23 | @Deprecated 24 | public class BinderHeaderMapper extends org.springframework.cloud.stream.binder.kafka.common.BinderHeaderMapper { 25 | 26 | public BinderHeaderMapper(String... patterns) { 27 | super(patterns); 28 | } 29 | 30 | public BinderHeaderMapper() { 31 | super(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka/src/main/java/org/springframework/cloud/stream/binder/kafka/KafkaBinderHealth.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder.kafka; 18 | 19 | import org.springframework.boot.actuate.health.HealthIndicator; 20 | 21 | /** 22 | * Marker interface used for custom KafkaBinderHealth indicator implementations. 23 | * 24 | * @author Soby Chacko 25 | * @since 3.2.2 26 | */ 27 | public interface KafkaBinderHealth extends HealthIndicator { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka/src/main/java/org/springframework/cloud/stream/binder/kafka/config/ClientFactoryCustomizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder.kafka.config; 18 | 19 | import org.springframework.kafka.core.ConsumerFactory; 20 | import org.springframework.kafka.core.ProducerFactory; 21 | 22 | /** 23 | * Called by the binder to customize the factories. 24 | * 25 | * @author Gary Russell 26 | * @since 3.0.6 27 | * 28 | */ 29 | public interface ClientFactoryCustomizer { 30 | 31 | default void configure(ProducerFactory pf) { 32 | } 33 | 34 | default void configure(ConsumerFactory cf) { 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka/src/main/java/org/springframework/cloud/stream/binder/kafka/config/MessageConverterHelperConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder.kafka.config; 18 | 19 | import org.springframework.cloud.function.context.config.MessageConverterHelper; 20 | import org.springframework.context.annotation.Bean; 21 | import org.springframework.context.annotation.Configuration; 22 | 23 | /** 24 | * @author Oleg Zhurakousky 25 | * @author Soby Chacko 26 | */ 27 | @Configuration(proxyBeanMethods = false) 28 | public class MessageConverterHelperConfiguration { 29 | 30 | @Bean 31 | public MessageConverterHelper kafkaMessageConverterHelper() { 32 | return new DefaultMessageConverterHelper(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka/src/main/resources/META-INF/spring.binders: -------------------------------------------------------------------------------- 1 | kafka:\ 2 | org.springframework.cloud.stream.binder.kafka.config.KafkaBinderConfiguration 3 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.env.EnvironmentPostProcessor:\ 2 | org.springframework.cloud.stream.binder.kafka.common.KafkaBinderEnvironmentPostProcessor 3 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka/src/main/resources/META-INF/spring/aot.factories: -------------------------------------------------------------------------------- 1 | org.springframework.aot.hint.RuntimeHintsRegistrar=org.springframework.cloud.stream.binder.kafka.aot.KafkaBinderRuntimeHints 2 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | org.springframework.cloud.stream.binder.kafka.config.ExtendedBindingHandlerMappingsProviderConfiguration 2 | org.springframework.cloud.stream.binder.kafka.config.MessageConverterHelperConfiguration 3 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka/src/test/java/org/springframework/cloud/stream/binder/kafka/RawKafkaPartitionTestSupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder.kafka; 18 | 19 | import org.springframework.cloud.stream.binder.PartitionKeyExtractorStrategy; 20 | import org.springframework.cloud.stream.binder.PartitionSelectorStrategy; 21 | import org.springframework.messaging.Message; 22 | 23 | /** 24 | * @author Marius Bogoevici 25 | */ 26 | class RawKafkaPartitionTestSupport 27 | implements PartitionKeyExtractorStrategy, PartitionSelectorStrategy { 28 | 29 | @Override 30 | public int selectPartition(Object key, int divisor) { 31 | return ((byte[]) key)[0] % divisor; 32 | } 33 | 34 | @Override 35 | public Object extractKey(Message message) { 36 | return message.getPayload(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka/src/test/resources/binder-config-autoconfig.properties: -------------------------------------------------------------------------------- 1 | spring.kafka.producer.keySerializer=org.apache.kafka.common.serialization.LongSerializer 2 | spring.kafka.producer.valueSerializer=org.apache.kafka.common.serialization.LongSerializer 3 | spring.kafka.consumer.keyDeserializer=org.apache.kafka.common.serialization.LongDeserializer 4 | spring.kafka.consumer.valueDeserializer=org.apache.kafka.common.serialization.LongDeserializer 5 | spring.kafka.producer.batchSize=10 6 | spring.kafka.bootstrapServers=10.98.09.199:9092,10.98.09.196:9092 7 | spring.kafka.producer.compressionType=snappy 8 | # Test consumer properties 9 | spring.kafka.consumer.auto-offset-reset=earliest 10 | spring.kafka.consumer.group-id=groupIdFromBootConfig 11 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka/src/test/resources/binder-config.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.stream.kafka.binder.brokers=10.98.09.199:9082 2 | -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka/src/test/resources/jaas-sample-kafka-only.conf: -------------------------------------------------------------------------------- 1 | KafkaClient { 2 | com.sun.security.auth.module.Krb5LoginModule required 3 | useKeyTab=true 4 | storeKey=true 5 | keyTab="/etc/security/keytabs/kafka_client.keytab" 6 | principal="kafka-client-1@EXAMPLE.COM"; 7 | }; -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka/src/test/resources/jaas-sample-with-zk.conf: -------------------------------------------------------------------------------- 1 | KafkaClient { 2 | com.sun.security.auth.module.Krb5LoginModule required 3 | useKeyTab=true 4 | storeKey=true 5 | keyTab="/etc/security/keytabs/kafka_client.keytab" 6 | principal="kafka-client-1@EXAMPLE.COM"; 7 | }; 8 | Client { 9 | com.sun.security.auth.module.Krb5LoginModule required 10 | useKeyTab=true 11 | storeKey=true 12 | keyTab="/etc/security/keytabs/zk_client.keytab" 13 | principal="zk-client-1@EXAMPLE.COM"; 14 | }; -------------------------------------------------------------------------------- /binders/kafka-binder/spring-cloud-stream-binder-kafka/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{ISO8601} %5p %t %c{2}:%L - %m%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /binders/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | spring-cloud-stream-binders 5 | 4.3.1-SNAPSHOT 6 | binders 7 | Framework provided binders 8 | pom 9 | 10 | 11 | org.springframework.cloud 12 | spring-cloud-stream-parent 13 | 4.3.1-SNAPSHOT 14 | 15 | 16 | 17 | kafka-binder 18 | rabbit-binder 19 | pulsar-binder 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /binders/pulsar-binder/spring-cloud-stream-binder-pulsar/src/main/java/org/springframework/cloud/stream/binder/pulsar/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Package containing Spring Cloud Stream binder classes for Apache Pulsar. 19 | */ 20 | @NonNullApi 21 | @NonNullFields 22 | package org.springframework.cloud.stream.binder.pulsar; 23 | 24 | import org.springframework.lang.NonNullApi; 25 | import org.springframework.lang.NonNullFields; 26 | -------------------------------------------------------------------------------- /binders/pulsar-binder/spring-cloud-stream-binder-pulsar/src/main/java/org/springframework/cloud/stream/binder/pulsar/properties/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Package containing Spring Cloud Stream binder properties classes for Apache Pulsar. 19 | */ 20 | @NonNullApi 21 | @NonNullFields 22 | package org.springframework.cloud.stream.binder.pulsar.properties; 23 | 24 | import org.springframework.lang.NonNullApi; 25 | import org.springframework.lang.NonNullFields; 26 | -------------------------------------------------------------------------------- /binders/pulsar-binder/spring-cloud-stream-binder-pulsar/src/main/java/org/springframework/cloud/stream/binder/pulsar/provisioning/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * Package containing Spring Cloud Stream binder provisioning classes for Apache Pulsar. 19 | */ 20 | @NonNullApi 21 | @NonNullFields 22 | package org.springframework.cloud.stream.binder.pulsar.provisioning; 23 | 24 | import org.springframework.lang.NonNullApi; 25 | import org.springframework.lang.NonNullFields; 26 | -------------------------------------------------------------------------------- /binders/pulsar-binder/spring-cloud-stream-binder-pulsar/src/main/resources/META-INF/spring.binders: -------------------------------------------------------------------------------- 1 | pulsar:\ 2 | org.springframework.cloud.stream.binder.pulsar.config.PulsarBinderConfiguration 3 | -------------------------------------------------------------------------------- /binders/pulsar-binder/spring-cloud-stream-binder-pulsar/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | org.springframework.cloud.stream.binder.pulsar.config.ExtendedBindingHandlerMappingsProviderConfiguration 2 | -------------------------------------------------------------------------------- /binders/rabbit-binder/.gitignore: -------------------------------------------------------------------------------- 1 | /application.yml 2 | /application.properties 3 | asciidoctor.css 4 | *~ 5 | .#* 6 | *# 7 | target/ 8 | build/ 9 | bin/ 10 | _site/ 11 | .classpath 12 | .project 13 | .settings 14 | .springBeans 15 | .DS_Store 16 | *.sw* 17 | *.iml 18 | *.ipr 19 | *.iws 20 | .idea/* 21 | .factorypath 22 | dump.rdb 23 | .apt_generated 24 | artifacts 25 | .sts4-cache 26 | -------------------------------------------------------------------------------- /binders/rabbit-binder/.mvn/jvm.config: -------------------------------------------------------------------------------- 1 | -Xmx1024m -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom -------------------------------------------------------------------------------- /binders/rabbit-binder/.mvn/maven.config: -------------------------------------------------------------------------------- 1 | -DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local -P spring 2 | -------------------------------------------------------------------------------- /binders/rabbit-binder/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/binders/rabbit-binder/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /binders/rabbit-binder/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /binders/rabbit-binder/ci-docker-compose/docker-compose-RABBITMQ-stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LOCAL_HOST="${LOCAL_HOST:-localhost}" 4 | RETRIES="${RETRIES:-70}" 5 | 6 | PORT_TO_CHECK=5672 7 | 8 | WAIT_TIME="${WAIT_TIME:-5}" 9 | 10 | function netcat_port() { 11 | local PASSED_HOST="${2:-$LOCAL_HOST}" 12 | local RABBITMQ_STOPPED=1 13 | local counter=1 14 | for i in $( seq 1 "${RETRIES}" ); do 15 | ((counter++)) 16 | if [ "${counter}" -gt 2 ] 17 | then 18 | echo "Rabbitmq is still running. Will try to stop again in [${WAIT_TIME}] seconds" 19 | fi 20 | sleep "${WAIT_TIME}" 21 | nc -v -w 1 ${PASSED_HOST} $1 && continue 22 | echo "Rabbitmq stopped..." 23 | RABBITMQ_STOPPED=0 24 | break 25 | done 26 | return ${RABBITMQ_STOPPED} 27 | } 28 | 29 | export -f netcat_port 30 | 31 | dockerComposeFile="docker-compose-RABBITMQ.yml" 32 | docker-compose -f $dockerComposeFile kill 33 | 34 | RABBITMQ_STOPPED="no" 35 | 36 | echo "Waiting for RabbitMQ to stop for [$(( WAIT_TIME * RETRIES ))] seconds" 37 | netcat_port $PORT_TO_CHECK && RABBITMQ_STOPPED="yes" 38 | 39 | if [[ "${RABBITMQ_STOPPED}" == "no" ]] ; then 40 | echo "RabbitMQ failed to stop..." 41 | exit 1 42 | fi -------------------------------------------------------------------------------- /binders/rabbit-binder/ci-docker-compose/docker-compose-RABBITMQ.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | LOCAL_HOST="${LOCAL_HOST:-localhost}" 4 | SHOULD_START_RABBIT="${SHOULD_START_RABBIT:-yes}" 5 | PORT_TO_CHECK=5672 6 | 7 | WAIT_TIME="${WAIT_TIME:-5}" 8 | RETRIES="${RETRIES:-70}" 9 | 10 | function netcat_port() { 11 | local PASSED_HOST="${2:-$LOCAL_HOST}" 12 | local READY_FOR_TESTS=1 13 | for i in $( seq 1 "${RETRIES}" ); do 14 | sleep "${WAIT_TIME}" 15 | nc -v -w 1 ${PASSED_HOST} $1 && READY_FOR_TESTS=0 && break 16 | echo "Fail #$i/${RETRIES}... will try again in [${WAIT_TIME}] seconds" 17 | done 18 | return ${READY_FOR_TESTS} 19 | } 20 | 21 | export -f netcat_port 22 | 23 | dockerComposeFile="docker-compose-RABBITMQ.yml" 24 | docker-compose -f $dockerComposeFile kill 25 | docker-compose -f $dockerComposeFile build 26 | 27 | if [[ "${SHOULD_START_RABBIT}" == "yes" ]] ; then 28 | echo -e "\n\nBooting up RabbitMQ" 29 | docker-compose -f $dockerComposeFile up -d rabbitmq 30 | fi 31 | 32 | READY_FOR_TESTS="no" 33 | 34 | echo "Waiting for RabbitMQ to boot for [$(( WAIT_TIME * RETRIES ))] seconds" 35 | netcat_port $PORT_TO_CHECK && READY_FOR_TESTS="yes" 36 | 37 | if [[ "${READY_FOR_TESTS}" == "no" ]] ; then 38 | echo "RabbitMQ failed to start..." 39 | exit 1 40 | fi 41 | 42 | -------------------------------------------------------------------------------- /binders/rabbit-binder/ci-docker-compose/docker-compose-RABBITMQ.yml: -------------------------------------------------------------------------------- 1 | rabbitmq: 2 | image: rabbitmq:management 3 | ports: 4 | - 5672:5672 5 | - 15672:15672 -------------------------------------------------------------------------------- /binders/rabbit-binder/spring-cloud-starter-stream-rabbit/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.springframework.cloud 6 | spring-cloud-stream-binder-rabbit-parent 7 | 4.3.1-SNAPSHOT 8 | 9 | spring-cloud-starter-stream-rabbit 10 | Spring Cloud Starter Stream Rabbit 11 | https://projects.spring.io/spring-cloud 12 | 13 | Pivotal Software, Inc. 14 | https://www.spring.io 15 | 16 | 17 | ${basedir}/../.. 18 | 19 | 20 | 21 | org.springframework.cloud 22 | spring-cloud-stream-binder-rabbit 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /binders/rabbit-binder/spring-cloud-stream-binder-rabbit-core/.jdk8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/binders/rabbit-binder/spring-cloud-stream-binder-rabbit-core/.jdk8 -------------------------------------------------------------------------------- /binders/rabbit-binder/spring-cloud-stream-binder-rabbit-core/src/main/java/org/springframework/cloud/stream/binder/rabbit/admin/RabbitAdminException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder.rabbit.admin; 18 | 19 | /** 20 | * Exceptions thrown while interfacing with the RabbitMQ admin plugin. 21 | * 22 | * @author Gary Russell 23 | * @since 1.2 24 | */ 25 | public class RabbitAdminException extends RuntimeException { 26 | 27 | public RabbitAdminException(String message, Throwable cause) { 28 | super(message, cause); 29 | } 30 | 31 | public RabbitAdminException(String message) { 32 | super(message); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /binders/rabbit-binder/spring-cloud-stream-binder-rabbit-test-support/.jdk8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/binders/rabbit-binder/spring-cloud-stream-binder-rabbit-test-support/.jdk8 -------------------------------------------------------------------------------- /binders/rabbit-binder/spring-cloud-stream-binder-rabbit-test-support/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.springframework.cloud 6 | spring-cloud-stream-binder-rabbit-parent 7 | 4.3.1-SNAPSHOT 8 | 9 | spring-cloud-stream-binder-rabbit-test-support 10 | Rabbit related test classes 11 | 12 | 13 | org.springframework.boot 14 | spring-boot-starter-logging 15 | 16 | 17 | org.springframework.boot 18 | spring-boot-starter-amqp 19 | true 20 | 21 | 22 | org.springframework.boot 23 | spring-boot-starter-test 24 | 25 | 26 | org.junit.jupiter 27 | junit-jupiter 28 | compile 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /binders/rabbit-binder/spring-cloud-stream-binder-rabbit/.jdk8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/binders/rabbit-binder/spring-cloud-stream-binder-rabbit/.jdk8 -------------------------------------------------------------------------------- /binders/rabbit-binder/spring-cloud-stream-binder-rabbit/src/main/java/org/springframework/cloud/stream/binder/rabbit/config/MessageConverterHelperConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder.rabbit.config; 18 | 19 | import org.springframework.cloud.function.context.config.MessageConverterHelper; 20 | import org.springframework.context.annotation.Bean; 21 | import org.springframework.context.annotation.Configuration; 22 | 23 | /** 24 | * @author Oleg Zhurakousky 25 | */ 26 | @Configuration(proxyBeanMethods = false) 27 | public class MessageConverterHelperConfiguration { 28 | 29 | @Bean 30 | public MessageConverterHelper rabbitMessageConverterHelper() { 31 | return new DefaultMessageConverterHelper(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /binders/rabbit-binder/spring-cloud-stream-binder-rabbit/src/main/java/org/springframework/cloud/stream/binder/rabbit/deployer/RabbitDeployerEnvironmentPostProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2021 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder.rabbit.deployer; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.env.EnvironmentPostProcessor; 21 | import org.springframework.core.env.ConfigurableEnvironment; 22 | 23 | /** 24 | * 25 | * @author Oleg Zhurakousky 26 | * 27 | * @since 3.2 28 | * 29 | */ 30 | class RabbitDeployerEnvironmentPostProcessor implements EnvironmentPostProcessor { 31 | 32 | @Override 33 | public void postProcessEnvironment(ConfigurableEnvironment environment, 34 | SpringApplication application) { 35 | if (!environment.containsProperty("spring.cloud.function.rsocket.enabled")) { 36 | environment.getSystemProperties().putIfAbsent("spring.cloud.function.rsocket.enabled", "false"); 37 | } 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /binders/rabbit-binder/spring-cloud-stream-binder-rabbit/src/main/resources/META-INF/spring.binders: -------------------------------------------------------------------------------- 1 | rabbit:\ 2 | org.springframework.cloud.stream.binder.rabbit.config.RabbitBinderConfiguration 3 | -------------------------------------------------------------------------------- /binders/rabbit-binder/spring-cloud-stream-binder-rabbit/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.env.EnvironmentPostProcessor:\ 2 | org.springframework.cloud.stream.binder.rabbit.deployer.RabbitDeployerEnvironmentPostProcessor 3 | -------------------------------------------------------------------------------- /binders/rabbit-binder/spring-cloud-stream-binder-rabbit/src/main/resources/META-INF/spring/aot.factories: -------------------------------------------------------------------------------- 1 | org.springframework.aot.hint.RuntimeHintsRegistrar=org.springframework.cloud.stream.binder.rabbit.aot.RabbitBinderRuntimeHints 2 | -------------------------------------------------------------------------------- /binders/rabbit-binder/spring-cloud-stream-binder-rabbit/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | org.springframework.cloud.stream.binder.rabbit.config.ExtendedBindingHandlerMappingsProviderConfiguration 2 | org.springframework.cloud.stream.binder.rabbit.config.MessageConverterHelperConfiguration 3 | -------------------------------------------------------------------------------- /binders/rabbit-binder/spring-cloud-stream-binder-rabbit/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=DEBUG, stdout 2 | 3 | # standard logging including calling site 4 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 5 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %40.40c:%4L - %m%n 7 | 8 | log4j.category.org.springframework.cloud.binder.rabbit=DEBUG 9 | -------------------------------------------------------------------------------- /binders/rabbit-binder/spring-cloud-stream-binder-rabbit/src/test/resources/rabbit-multi-binder-observation.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | function: 4 | definition: testListener 5 | stream: 6 | output-bindings: test 7 | bindings: 8 | test-out-0: 9 | binder: rabbit 10 | destination: test 11 | group: test 12 | testListener-in-0: 13 | binder: rabbit 14 | destination: test 15 | group: test 16 | binders: 17 | rabbit: 18 | type: rabbit 19 | environment: 20 | spring: 21 | cloud: 22 | stream: 23 | rabbit: 24 | binder: 25 | enableObservation: true 26 | logging: 27 | pattern: 28 | level: "%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]" 29 | 30 | management: 31 | tracing: 32 | sampling: 33 | probability: 1 34 | 35 | -------------------------------------------------------------------------------- /binders/rabbit-binder/src/checkstyle/checkstyle-suppressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /bom/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | indent_style = tab 8 | indent_size = 4 9 | end_of_line = lf 10 | insert_final_newline = true 11 | 12 | [*.yml] 13 | indent_style = space 14 | indent_size = 2 15 | -------------------------------------------------------------------------------- /bom/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | #* 3 | *# 4 | .#* 5 | .classpath 6 | .project 7 | .settings 8 | .springBeans 9 | .gradle 10 | build 11 | bin 12 | target/ 13 | .idea 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .factorypath 18 | *.versionsBackup 19 | *.DS_Store 20 | -------------------------------------------------------------------------------- /bom/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "spring-cloud-stream-docs/kafka"] 2 | path = spring-cloud-stream-docs/kafka 3 | url = https://github.com/spring-cloud/spring-cloud-stream-binder-kafka.git 4 | [submodule "spring-cloud-stream-docs/rabbit"] 5 | path = spring-cloud-stream-docs/rabbit 6 | url = https://github.com/spring-cloud/spring-cloud-stream-binder-rabbit.git 7 | [submodule "spring-cloud-stream-docs/core"] 8 | path = spring-cloud-stream-docs/core 9 | url = https://github.com/spring-cloud/spring-cloud-stream.git 10 | -------------------------------------------------------------------------------- /bom/.mvn/jvm.config: -------------------------------------------------------------------------------- 1 | -Xmx1024m -XX:CICompilerCount=1 -XX:TieredStopAtLevel=1 -Djava.security.egd=file:/dev/./urandom -------------------------------------------------------------------------------- /bom/.mvn/maven.config: -------------------------------------------------------------------------------- 1 | -DaltSnapshotDeploymentRepository=repo.spring.io::default::https://repo.spring.io/libs-snapshot-local -P spring 2 | -------------------------------------------------------------------------------- /bom/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/bom/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /bom/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip -------------------------------------------------------------------------------- /bom/.springformat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/bom/.springformat -------------------------------------------------------------------------------- /bom/README.adoc: -------------------------------------------------------------------------------- 1 | == What is this? 2 | 3 | This is the repository for the Spring Cloud Stream Release Train. 4 | 5 | It contains projects for maintaining the following components: 6 | 7 | * the curated dependencies list of the release train, i.e. `spring-cloud-stream-dependencies` 8 | * the aggregated documentation of the release train; 9 | 10 | == Release Train Contents 11 | 12 | The release train contains: 13 | 14 | * the Spring Cloud Stream core; 15 | * supported binder implementations; 16 | 17 | === Binder implementations 18 | 19 | The following binder implementations are currently available: 20 | 21 | * *Kafka* https://github.com/spring-cloud/spring-cloud-stream-binder-kafka 22 | * *RabbitMQ* https://github.com/spring-cloud/spring-cloud-stream-binder-rabbit 23 | 24 | == Contributing 25 | 26 | We love contributions. 27 | Follow this https://github.com/spring-cloud/spring-cloud-commons#contributing[link] for more information on how to contribute. 28 | 29 | == Code of Conduct 30 | This project adheres to the Contributor Covenant https://github.com/spring-cloud/spring-cloud-stream/blob/master/CODE_OF_CONDUCT.adoc[code of conduct]. By participating, you are expected to uphold this code. Please report unacceptable behavior to spring-code-of-conduct@pivotal.io. 31 | -------------------------------------------------------------------------------- /buildCore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$#" -eq 1 ]; then 4 | ARGVALUE=$1 5 | if [[ $ARGVALUE == *"skipTest"* ]]; then 6 | echo "Skippping Tests" 7 | ./mvnw clean install -f core/pom.xml -DskipTests 8 | elif [[ $ARGVALUE == *"disable.checks"* ]]; then 9 | echo "Skippping checkstyle checks" 10 | ./mvnw clean install -f core/pom.xml -Ddisable.checks=true 11 | fi 12 | else 13 | ./mvnw clean install -f core/pom.xml 14 | fi 15 | -------------------------------------------------------------------------------- /buildDependencies.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./mvnw clean install -f bom/pom.xml 4 | -------------------------------------------------------------------------------- /buildKafkaBinder.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$#" -eq 1 ]; then 4 | ARGVALUE=$1 5 | if [[ $ARGVALUE == *"skipTest"* ]]; then 6 | echo "Skippping Tests" 7 | ./mvnw clean install -f binders/kafka-binder/pom.xml -DskipTests 8 | elif [[ $ARGVALUE == *"disable.checks"* ]]; then 9 | echo "Skippping checkstyle checks" 10 | ./mvnw clean install -f binders/kafka-binder/pom.xml -Ddisable.checks=true 11 | fi 12 | else 13 | ./mvnw clean install -f binders/kafka-binder/pom.xml 14 | fi 15 | -------------------------------------------------------------------------------- /buildPulsarBinder.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$#" -eq 1 ]; then 4 | ARGVALUE=$1 5 | if [[ $ARGVALUE == *"skipTest"* ]]; then 6 | echo "Skippping Tests" 7 | ./mvnw clean install -f binders/pulsar-binder/pom.xml -DskipTests 8 | elif [[ $ARGVALUE == *"disable.checks"* ]]; then 9 | echo "Skippping checkstyle checks" 10 | ./mvnw clean install -f binders/pulsar-binder/pom.xml -Ddisable.checks=true 11 | fi 12 | else 13 | ./mvnw clean install -f binders/pulsar-binder/pom.xml 14 | fi 15 | -------------------------------------------------------------------------------- /buildRabbitBinder.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$#" -eq 1 ]; then 4 | ARGVALUE=$1 5 | if [[ $ARGVALUE == *"skipTest"* ]]; then 6 | echo "Skippping Tests" 7 | ./mvnw clean install -f binders/rabbit-binder/pom.xml -DskipTests 8 | elif [[ $ARGVALUE == *"disable.checks"* ]]; then 9 | echo "Skippping checkstyle checks" 10 | ./mvnw clean install -f binders/rabbit-binder/pom.xml -Ddisable.checks=true 11 | fi 12 | else 13 | ./mvnw clean install -f binders/rabbit-binder/pom.xml 14 | fi 15 | -------------------------------------------------------------------------------- /buildSchemaRegistry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$#" -eq 1 ]; then 4 | ARGVALUE=$1 5 | if [[ $ARGVALUE == *"skipTest"* ]]; then 6 | echo "Skippping Tests" 7 | ./mvnw clean install -f schema-registry/pom.xml -DskipTests 8 | elif [[ $ARGVALUE == *"disable.checks"* ]]; then 9 | echo "Skippping checkstyle checks" 10 | ./mvnw clean install -f schema-registry/pom.xml -Ddisable.checks=true 11 | fi 12 | else 13 | ./mvnw clean install -f schema-registry/pom.xml 14 | fi 15 | -------------------------------------------------------------------------------- /core/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | spring-cloud-stream-core 5 | 4.3.1-SNAPSHOT 6 | core 7 | Core Spring Cloud Stream 8 | pom 9 | 10 | 11 | org.springframework.cloud 12 | spring-cloud-stream-parent 13 | 4.3.1-SNAPSHOT 14 | .. 15 | 16 | 17 | 18 | spring-cloud-stream 19 | spring-cloud-stream-test-binder 20 | spring-cloud-stream-integration-tests 21 | spring-cloud-stream-test-support 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /core/spring-cloud-stream-integration-tests/src/test/java/org/springframework/cloud/stream/utils/IntegrationTestsMockBinderConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.utils; 18 | 19 | import org.mockito.Mockito; 20 | 21 | import org.springframework.cloud.stream.binder.Binder; 22 | import org.springframework.context.annotation.Bean; 23 | import org.springframework.context.annotation.Configuration; 24 | 25 | /** 26 | * @author Marius Bogoevici 27 | */ 28 | @Configuration 29 | public class IntegrationTestsMockBinderConfiguration { 30 | 31 | @Bean 32 | public Binder binder() { 33 | return Mockito.mock(Binder.class, 34 | Mockito.withSettings().defaultAnswer(Mockito.RETURNS_MOCKS)); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /core/spring-cloud-stream-integration-tests/src/test/kotlin/org/springframework/cloud/stream/kotlin/KotlinTestConfiguration.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.cloud.stream.kotlin 17 | 18 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration 19 | import org.springframework.cloud.function.context.PollableBean 20 | import org.springframework.context.annotation.Configuration 21 | import reactor.core.publisher.Flux 22 | 23 | @Configuration 24 | @EnableAutoConfiguration 25 | open class KotlinTestConfiguration { 26 | 27 | @PollableBean // it doesn't work with Kotlin lambda 28 | open fun produceNames(): () -> Flux = { 29 | Flux.just( 30 | "Ricky", 31 | "Julien", 32 | "Bubbles" 33 | ) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/spring-cloud-stream-integration-tests/src/test/resources/binder1/META-INF/spring.binders: -------------------------------------------------------------------------------- 1 | integration1:\ 2 | org.springframework.cloud.stream.binder.test.TestChannelBinderConfiguration 3 | integration2:\ 4 | org.springframework.cloud.stream.binder.test.TestChannelBinderConfiguration 5 | -------------------------------------------------------------------------------- /core/spring-cloud-stream-test-binder/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | spring-cloud-stream-test-binder 8 | jar 9 | spring-cloud-stream-test-binder 10 | Spring Cloud Stream Test Binder 11 | 12 | 13 | org.springframework.cloud 14 | spring-cloud-stream-core 15 | 4.3.1-SNAPSHOT 16 | 17 | 18 | 19 | 20 | org.springframework.cloud 21 | spring-cloud-stream 22 | 23 | 24 | org.springframework.boot 25 | spring-boot-starter-test 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /core/spring-cloud-stream-test-support/.jdk8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/core/spring-cloud-stream-test-support/.jdk8 -------------------------------------------------------------------------------- /core/spring-cloud-stream-test-support/src/main/java/org/springframework/cloud/stream/binder/PartitionTestSupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | import org.springframework.messaging.Message; 20 | 21 | /** 22 | * @author Gary Russell 23 | */ 24 | public class PartitionTestSupport 25 | implements PartitionKeyExtractorStrategy, PartitionSelectorStrategy { 26 | 27 | @Override 28 | public int selectPartition(Object key, int divisor) { 29 | return key.hashCode() % divisor; 30 | } 31 | 32 | @Override 33 | public Object extractKey(Message message) { 34 | return message.getPayload(); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /core/spring-cloud-stream-test-support/src/main/java/org/springframework/cloud/stream/binder/Spy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | /** 20 | * Represents an out-of-band connection to the underlying middleware, so that tests can 21 | * check that some messages actually do (or do not) transit through it. 22 | * 23 | * @author Eric Bottard 24 | */ 25 | public interface Spy { 26 | 27 | Object receive(boolean expectNull) throws Exception; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /core/spring-cloud-stream-test-support/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.env.EnvironmentPostProcessor=\ 2 | org.springframework.cloud.stream.binder.BinderTestEnvironmentPostProcessor 3 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/.jdk8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/core/spring-cloud-stream/.jdk8 -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2016 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | /** 20 | * Exception thrown to indicate a binder error (most likely a configuration error). 21 | * 22 | * @author Gary Russell 23 | * @author Marius Bogoevici 24 | */ 25 | @SuppressWarnings("serial") 26 | public class BinderException extends RuntimeException { 27 | 28 | public BinderException(String message) { 29 | super(message); 30 | } 31 | 32 | public BinderException(String message, Throwable cause) { 33 | super(message, cause); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | /** 20 | * @author Marius Bogoevici 21 | */ 22 | public interface BinderFactory { 23 | 24 | /** 25 | * Returns the binder instance associated with the given configuration name. Instance 26 | * caching is a requirement, and implementations must return the same instance on 27 | * subsequent invocations with the same arguments. 28 | * @param the primary binding type 29 | * @param configurationName the name of a binder configuration 30 | * @param bindableType binding target type 31 | * @return the binder instance 32 | */ 33 | Binder getBinder( 34 | String configurationName, Class bindableType); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderSpecificPropertiesProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | /** 20 | * @author Oleg Zhurakousky 21 | * @since 2.1 22 | * 23 | */ 24 | public interface BinderSpecificPropertiesProvider { 25 | 26 | Object getConsumer(); 27 | 28 | Object getProducer(); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderTypeRegistry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | import java.util.Map; 20 | 21 | /** 22 | * A registry of {@link BinderType}s, indexed by name. A {@link BinderTypeRegistry} bean 23 | * is created automatically based on information found in the 24 | * {@literal META-INF/spring.binders} files provided by binder implementors. 25 | * 26 | * @author Marius Bogoevici 27 | */ 28 | public interface BinderTypeRegistry { 29 | 30 | BinderType get(String name); 31 | 32 | Map getAll(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BinderWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | /** 20 | * Holds information about the binder and channel. 21 | * 22 | * @author Omer Celik 23 | */ 24 | public record BinderWrapper(Binder binder, String destinationName, String cacheKey) { 25 | } 26 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BindingCleaner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | import java.util.List; 20 | import java.util.Map; 21 | 22 | /** 23 | * Interface for implementations that perform cleanup for binders. 24 | * 25 | * @author Gary Russell 26 | * @since 1.2 27 | */ 28 | public interface BindingCleaner { 29 | 30 | /** 31 | * Clean up all resources for the supplied stream/job. 32 | * @param entity the stream or job; may be terminated with a simple wild card '*', in 33 | * which case all streams with names starting with the characters before the '*' will 34 | * be cleaned. 35 | * @param isJob true if the entity is a job. 36 | * @return a map of lists of resources removed. 37 | */ 38 | Map> clean(String entity, boolean isJob); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/BindingCreatedEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | import org.springframework.context.ApplicationEvent; 20 | 21 | /** 22 | * ApplicationEvent fired whenever the the Binding is created. 23 | * 24 | * @author Oleg Zhurakousky 25 | * @since 2.0 26 | * 27 | * #see AbstractMessageChannelBinder 28 | */ 29 | @SuppressWarnings("serial") 30 | public class BindingCreatedEvent extends ApplicationEvent { 31 | 32 | public BindingCreatedEvent(Binding source) { 33 | super(source); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/DefaultBinderTypeRegistry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | import java.util.Collections; 20 | import java.util.HashMap; 21 | import java.util.Map; 22 | 23 | /** 24 | * Default implementation of a {@link BinderTypeRegistry}. 25 | * 26 | * @author Marius Bogoevici 27 | */ 28 | public class DefaultBinderTypeRegistry implements BinderTypeRegistry { 29 | 30 | private final Map binderTypes; 31 | 32 | public DefaultBinderTypeRegistry(Map binderTypes) { 33 | this.binderTypes = Collections.unmodifiableMap(new HashMap<>(binderTypes)); 34 | } 35 | 36 | @Override 37 | public BinderType get(String name) { 38 | return this.binderTypes.get(name); 39 | } 40 | 41 | @Override 42 | public Map getAll() { 43 | return this.binderTypes; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/DirectHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | import org.springframework.messaging.Message; 20 | import org.springframework.messaging.MessageChannel; 21 | import org.springframework.messaging.MessageHandler; 22 | import org.springframework.messaging.MessagingException; 23 | 24 | /** 25 | * @author Marius Bogoevici 26 | */ 27 | public class DirectHandler implements MessageHandler { 28 | 29 | private final MessageChannel outputChannel; 30 | 31 | public DirectHandler(MessageChannel outputChannel) { 32 | this.outputChannel = outputChannel; 33 | } 34 | 35 | @Override 36 | public void handleMessage(Message message) throws MessagingException { 37 | this.outputChannel.send(message); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/ExtendedConsumerProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | /** 20 | * Extension of {@link ConsumerProperties} to be used with an 21 | * {@link ExtendedPropertiesBinder}. 22 | * 23 | * @param extension type 24 | * @author Marius Bogoevici 25 | */ 26 | public class ExtendedConsumerProperties extends ConsumerProperties { 27 | 28 | private T extension; 29 | 30 | public ExtendedConsumerProperties(T extension) { 31 | this.extension = extension; 32 | } 33 | 34 | public T getExtension() { 35 | return this.extension; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/ExtendedProducerProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | /** 20 | * @param extension type 21 | * @author Marius Bogoevici 22 | */ 23 | public class ExtendedProducerProperties extends ProducerProperties { 24 | 25 | private T extension; 26 | 27 | public ExtendedProducerProperties(T extension) { 28 | this.extension = extension; 29 | } 30 | 31 | public T getExtension() { 32 | return this.extension; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/ExtendedPropertiesBinder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | /** 20 | * Extension of {@link Binder} that takes {@link ExtendedConsumerProperties} and 21 | * {@link ExtendedProducerProperties} as arguments. In addition to supporting binding 22 | * operations, it allows the binder to provide values for the additional properties it 23 | * expects on the bindings. 24 | * 25 | * @param binder type 26 | * @param consumer type 27 | * @param

producer type 28 | * @author Marius Bogoevici 29 | */ 30 | public interface ExtendedPropertiesBinder 31 | extends Binder, ExtendedProducerProperties

>, 32 | ExtendedBindingProperties { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/HeaderMode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | /** 20 | * @author Marius Bogoevici 21 | * @author Gary Russell 22 | */ 23 | public enum HeaderMode { 24 | 25 | /** 26 | * No headers. 27 | */ 28 | none, 29 | 30 | /** 31 | * Native headers. 32 | */ 33 | headers, 34 | 35 | /** 36 | * Headers embedded in payload - e.g. kafka < 0.11 37 | */ 38 | embeddedHeaders 39 | 40 | } 41 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/LastSubscriberAwareChannel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | import org.springframework.messaging.SubscribableChannel; 20 | 21 | /** 22 | * A channel that can ensure a {@code LastSubscriberMessageHandler} is always the last 23 | * subscriber. 24 | * 25 | * @author Gary Russell 26 | * @since 1.3 27 | * 28 | */ 29 | interface LastSubscriberAwareChannel extends SubscribableChannel { 30 | 31 | /** 32 | * Return the current subscribers. 33 | * @return the subscribers. 34 | */ 35 | int subscribers(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/LastSubscriberMessageHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | import org.springframework.messaging.MessageHandler; 20 | 21 | /** 22 | * A marker interface designating a subscriber that must be the last. 23 | * 24 | * @author Gary Russell 25 | * @since 1.3 26 | * 27 | */ 28 | public interface LastSubscriberMessageHandler extends MessageHandler { 29 | 30 | } 31 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/PartitionKeyExtractorStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | import org.springframework.messaging.Message; 20 | 21 | /** 22 | * Strategy for extracting a partition key from a Message. 23 | * 24 | * @author Gary Russell 25 | */ 26 | public interface PartitionKeyExtractorStrategy { 27 | 28 | Object extractKey(Message message); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/PartitionSelectorStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | /** 20 | * Strategy for determining the partition to which a message should be sent. 21 | * 22 | * @author Gary Russell 23 | */ 24 | public interface PartitionSelectorStrategy { 25 | 26 | /** 27 | * Determine the partition based on a key. The partitionCount is 1 greater than the 28 | * maximum value of a valid partition. Typical implementations will return 29 | * {@code someValue % partitionCount}. The caller will apply that same modulo 30 | * operation (as well as enforcing absolute value) if the value exceeds partitionCount 31 | * - 1. 32 | * @param key the key 33 | * @param partitionCount the number of partitions 34 | * @return the partition 35 | */ 36 | int selectPartition(Object key, int partitionCount); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binder/PollableMessageSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binder; 18 | 19 | import org.springframework.messaging.MessageHandler; 20 | 21 | /** 22 | * A {@link PollableSource} that calls a {@link MessageHandler} with a 23 | * {@link org.springframework.messaging.Message}. 24 | * 25 | * @author Gary Russell 26 | * @since 2.0 27 | * 28 | */ 29 | public interface PollableMessageSource extends PollableSource { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binding/BoundTargetHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2024 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binding; 18 | 19 | /** 20 | * Holds information about the binding targets exposed by the interface proxy, as well 21 | * as their status. 22 | * 23 | * Refactored from {@link BindableProxyFactory}. 24 | * 25 | * @author Original authors in {@link BindableProxyFactory} 26 | * @author Soby Chacko 27 | * @author Omer Celik 28 | * @since 3.0.0 29 | */ 30 | public record BoundTargetHolder(Object boundTarget, boolean bindable) { 31 | } 32 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binding/MessageChannelAndSourceConfigurer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binding; 18 | 19 | import org.springframework.cloud.stream.binder.PollableMessageSource; 20 | 21 | /** 22 | * Configurer for {@link PollableMessageSource}. 23 | * 24 | * @author Gary Russell 25 | * @since 2.0 26 | * 27 | */ 28 | public interface MessageChannelAndSourceConfigurer extends MessageChannelConfigurer { 29 | 30 | /** 31 | * Configure the provided message source binding. 32 | * @param binding the binding. 33 | * @param name the name. 34 | */ 35 | void configurePolledMessageSource(PollableMessageSource binding, String name); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/binding/SupportedBindableFeatures.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2022 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.binding; 18 | 19 | /** 20 | * Internal abstraction for the supported bindable features. 21 | * 22 | * @author Soby Chacko 23 | * @since 4.0.0 24 | */ 25 | public class SupportedBindableFeatures { 26 | 27 | private boolean pollable; 28 | 29 | private boolean reactive; 30 | 31 | public void setPollable(boolean pollable) { 32 | this.pollable = pollable; 33 | } 34 | 35 | public void setReactive(boolean reactive) { 36 | this.reactive = reactive; 37 | } 38 | 39 | public boolean isPollable() { 40 | return pollable; 41 | } 42 | 43 | public boolean isReactive() { 44 | return reactive; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/converter/ConversionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.converter; 18 | 19 | /** 20 | * Exception thrown when an error is encountered during message conversion. 21 | * 22 | * @author David Turanski 23 | */ 24 | @SuppressWarnings("serial") 25 | public class ConversionException extends RuntimeException { 26 | 27 | public ConversionException(String message) { 28 | super(message); 29 | } 30 | 31 | public ConversionException(String message, Throwable t) { 32 | super(message, t); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/converter/CustomMimeTypeConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2018 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.converter; 18 | 19 | import org.springframework.core.convert.converter.Converter; 20 | import org.springframework.util.MimeType; 21 | 22 | /** 23 | * A custom converter for {@link MimeType} that accepts a plain java class name as a 24 | * shorthand for {@code application/x-java-object;type=the.qualified.ClassName}. 25 | * 26 | * @author Eric Bottard 27 | * @author David Turanski 28 | */ 29 | public class CustomMimeTypeConverter implements Converter { 30 | 31 | @Override 32 | public MimeType convert(String source) { 33 | if (!source.contains("/")) { 34 | return MimeType.valueOf("application/x-java-object;type=" + source); 35 | } 36 | return MimeType.valueOf(source); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/function/StreamFunctionConfigurationProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2023 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.function; 18 | 19 | import java.util.HashMap; 20 | import java.util.Map; 21 | 22 | import org.springframework.boot.context.properties.ConfigurationProperties; 23 | 24 | /** 25 | * @author Oleg Zhurakousky 26 | * @author Soby Chacko 27 | * @since 4.0.2 28 | */ 29 | @ConfigurationProperties("spring.cloud.stream.function") 30 | public class StreamFunctionConfigurationProperties { 31 | private Map bindings = new HashMap<>(); 32 | 33 | public Map getBindings() { 34 | return this.bindings; 35 | } 36 | 37 | public void setBindings(Map bindings) { 38 | this.bindings = bindings; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/provisioning/ConsumerDestination.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.provisioning; 18 | 19 | import org.springframework.cloud.stream.binder.ConsumerProperties; 20 | 21 | /** 22 | * Represents a ConsumerDestination that provides the information about the destination 23 | * that is physically provisioned through 24 | * {@link ProvisioningProvider#provisionConsumerDestination(String, String, ConsumerProperties)}. 25 | * 26 | * @author Soby Chacko 27 | * @since 1.2 28 | */ 29 | public interface ConsumerDestination { 30 | 31 | /** 32 | * Provides the destination name. 33 | * @return destination name 34 | */ 35 | String getName(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/resources/META-INF/shared.beans: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.amqp.ConnectionFactoryCustomizer 2 | org.springframework.boot.autoconfigure.kafka.KafkaConnectionDetails 3 | org.springframework.boot.autoconfigure.kafka.StreamsBuilderFactoryBeanCustomizer 4 | org.springframework.cloud.stream.config.SpelExpressionConverterConfiguration$SpelConverter 5 | org.springframework.cloud.stream.config.ListenerContainerCustomizer 6 | org.springframework.cloud.stream.binder.kafka.ListenerContainerWithDlqAndRetryCustomizer 7 | org.springframework.cloud.stream.binder.kafka.support.ConsumerConfigCustomizer 8 | org.springframework.cloud.stream.binder.kafka.support.ProducerConfigCustomizer 9 | org.springframework.cloud.stream.binder.kafka.provisioning.AdminClientConfigCustomizer 10 | org.springframework.kafka.config.KafkaStreamsCustomizer 11 | org.springframework.rabbit.stream.listener.ConsumerCustomizer 12 | org.springframework.amqp.core.DeclarableCustomizer 13 | org.springframework.cloud.stream.config.ProducerMessageHandlerCustomizer 14 | org.springframework.cloud.stream.binder.test.InputDestination 15 | org.springframework.cloud.stream.binder.test.OutputDestination 16 | org.springframework.cloud.stream.config.BindingHandlerAdvise 17 | io.micrometer.observation.ObservationRegistry 18 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.env.EnvironmentPostProcessor:\ 2 | org.springframework.cloud.stream.function.RoutingFunctionEnvironmentPostProcessor,\ 3 | org.springframework.cloud.stream.config.VersionExtractor,\ 4 | org.springframework.cloud.stream.config.PollerConfigEnvironmentPostProcessor 5 | org.springframework.context.ApplicationContextInitializer:\ 6 | org.springframework.cloud.stream.function.PollableSourceInitializer 7 | 8 | 9 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/resources/META-INF/spring/aot.factories: -------------------------------------------------------------------------------- 1 | org.springframework.aot.hint.RuntimeHintsRegistrar=org.springframework.cloud.stream.aot.StreamRuntimeHints 2 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | org.springframework.cloud.stream.config.BindersHealthIndicatorAutoConfiguration 2 | org.springframework.cloud.stream.config.ChannelsEndpointAutoConfiguration 3 | org.springframework.cloud.stream.config.BindingsEndpointAutoConfiguration 4 | org.springframework.cloud.stream.config.BindingServiceConfiguration 5 | org.springframework.cloud.stream.function.FunctionConfiguration 6 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | . ____ _ __ _ _ 2 | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ 3 | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ 4 | \\/ ___)| |_)| | | | | || (_| | ) ) ) ) 5 | ' |____| .__|_| |_|_| |_\__, | / / / / 6 | =========|_|==============|___/=/_/_/_/ 7 | 8 | :: Spring Boot :: v${spring-boot.version} 9 | :: Spring Cloud Stream :: v${spring-cloud-stream.version} 10 | :: Spring Cloud Function :: v${spring-cloud-function.version} -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/partitioning/CustomPartitionKeyExtractorClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.partitioning; 18 | 19 | import org.springframework.cloud.stream.binder.PartitionKeyExtractorStrategy; 20 | import org.springframework.messaging.Message; 21 | 22 | /** 23 | * @author Ilayaperumal Gopinathan 24 | */ 25 | public class CustomPartitionKeyExtractorClass implements PartitionKeyExtractorStrategy { 26 | 27 | @Override 28 | public String extractKey(Message message) { 29 | return (String) message.getHeaders().get("key"); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/partitioning/CustomPartitionSelectorClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.partitioning; 18 | 19 | import org.springframework.cloud.stream.binder.PartitionSelectorStrategy; 20 | 21 | /** 22 | * @author Ilayaperumal Gopinathan 23 | */ 24 | public class CustomPartitionSelectorClass implements PartitionSelectorStrategy { 25 | 26 | @Override 27 | public int selectPartition(Object key, int partitionCount) { 28 | return Integer.valueOf((String) key); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/utils/FooBindingProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.utils; 18 | 19 | import org.springframework.cloud.stream.binder.BinderSpecificPropertiesProvider; 20 | 21 | /** 22 | * @author Soby Chacko 23 | */ 24 | public class FooBindingProperties implements BinderSpecificPropertiesProvider { 25 | 26 | private FooProducerProperties producer = new FooProducerProperties(); 27 | 28 | private FooConsumerProperties consumer = new FooConsumerProperties(); 29 | 30 | public FooProducerProperties getProducer() { 31 | return this.producer; 32 | } 33 | 34 | public void setProducer(FooProducerProperties producer) { 35 | this.producer = producer; 36 | } 37 | 38 | public FooConsumerProperties getConsumer() { 39 | return this.consumer; 40 | } 41 | 42 | public void setConsumer(FooConsumerProperties consumer) { 43 | this.consumer = consumer; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/utils/FooConsumerProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.utils; 18 | 19 | /** 20 | * @author Soby Chacko 21 | */ 22 | public class FooConsumerProperties { 23 | 24 | String extendedProperty; 25 | 26 | public String getExtendedProperty() { 27 | return this.extendedProperty; 28 | } 29 | 30 | public void setExtendedProperty(String extendedProperty) { 31 | this.extendedProperty = extendedProperty; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/utils/FooProducerProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.utils; 18 | 19 | /** 20 | * @author Soby Chacko 21 | */ 22 | public class FooProducerProperties { 23 | 24 | String extendedProperty; 25 | 26 | public String getExtendedProperty() { 27 | return this.extendedProperty; 28 | } 29 | 30 | public void setExtendedProperty(String extendedProperty) { 31 | this.extendedProperty = extendedProperty; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/java/org/springframework/cloud/stream/utils/MockBinderConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.utils; 18 | 19 | import org.mockito.Mockito; 20 | 21 | import org.springframework.cloud.stream.binder.Binder; 22 | import org.springframework.context.annotation.Bean; 23 | import org.springframework.context.annotation.Configuration; 24 | 25 | /** 26 | * @author Marius Bogoevici 27 | */ 28 | @Configuration 29 | public class MockBinderConfiguration { 30 | 31 | @Bean 32 | public Binder binder() { 33 | return Mockito.mock(Binder.class, 34 | Mockito.withSettings().defaultAnswer(Mockito.RETURNS_MOCKS)); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/resources/META-INF/spring.binders: -------------------------------------------------------------------------------- 1 | mock:\ 2 | org.springframework.cloud.stream.utils.MockBinderConfiguration 3 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | expression: a.b 2 | numberExpression: 5 3 | booleanExpression: true 4 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/resources/binder-aot-test/application.yml: -------------------------------------------------------------------------------- 1 | spring.cloud: 2 | function: 3 | definition: fooSource;fooSink 4 | stream: 5 | default-binder: mockBinder1 6 | binders: 7 | mockBinder1: 8 | type: mock 9 | environment: 10 | foo: bar1 11 | mockBinder2: 12 | type: mock 13 | environment: 14 | foo: bar2 15 | bindings: 16 | fooSource-out-0: 17 | destination: fooSink-in-0 18 | binder: mockBinder2 19 | fooSink-in-0: 20 | destination: fooSource-out-0 21 | binder: mockBinder2 22 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/resources/binder1/META-INF/spring.binders: -------------------------------------------------------------------------------- 1 | binder1=org.springframework.cloud.stream.binder.stub1.StubBinder1Configuration 2 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/resources/binder2/META-INF/spring.binders: -------------------------------------------------------------------------------- 1 | binder2:\ 2 | org.springframework.cloud.stream.binder.stub2.StubBinder2ConfigurationA,\ 3 | org.springframework.cloud.stream.binder.stub2.StubBinder2ConfigurationB 4 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/resources/org/springframework/cloud/stream/binder/arbitrary-binding-test.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.stream.bindings.process1-in-0.destination=someQueue.0 2 | spring.cloud.stream.bindings.process1-out-0.destination=someQueue.1 3 | spring.cloud.stream.bindings.process2-in-0.destination=someQueue.2 4 | spring.cloud.stream.bindings.process2-out-0.destination=someQueue.3 5 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/resources/org/springframework/cloud/stream/binder/cloud-function-test.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.stream.function.producerProperties.useNativeEncoding:true 2 | spring.cloud.stream.function.consumerProperties.maxAttempts:5 3 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/resources/org/springframework/cloud/stream/binder/custom-partitioned-producer-test.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.stream.bindings.output.destination=partOut 2 | spring.cloud.stream.bindings.output.producer.partitionCount=3 3 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/resources/org/springframework/cloud/stream/binder/partitioned-consumer-test.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.stream.bindings.sink-in-0.destination=partIn 2 | spring.cloud.stream.bindings.sink-in-0.consumer.partitioned=true 3 | spring.cloud.stream.instanceCount=2 4 | spring.cloud.stream.instanceIndex=0 5 | 6 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/resources/org/springframework/cloud/stream/binder/partitioned-producer-test.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.stream.bindings.output.destination=partOut 2 | spring.cloud.stream.bindings.output.producer.partitionKeyExpression=payload 3 | spring.cloud.stream.bindings.output.producer.partitionCount=3 4 | 5 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/resources/org/springframework/cloud/stream/binder/processor-binding-test.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.stream.bindings.input.destination=testtock.0 2 | spring.cloud.stream.bindings.output.destination=testtock.1 3 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/resources/org/springframework/cloud/stream/binder/sink-binding-test.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.stream.bindings.input.destination=testtock 2 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/src/test/resources/org/springframework/cloud/stream/binder/source-binding-test.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.stream.bindings.output.destination=testtock 2 | -------------------------------------------------------------------------------- /core/spring-cloud-stream/work.txt: -------------------------------------------------------------------------------- 1 | - MetersPublisherBinding uses Output. Need to rework -------------------------------------------------------------------------------- /docs/.jdk8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/.jdk8 -------------------------------------------------------------------------------- /docs/antora-playbook.yml: -------------------------------------------------------------------------------- 1 | antora: 2 | extensions: 3 | - require: '@springio/antora-extensions' 4 | root_component_name: 'cloud-stream' 5 | site: 6 | title: Spring Cloud Stream 7 | url: https://docs.spring.io/spring-cloud-stream/reference/ 8 | content: 9 | sources: 10 | - url: ./.. 11 | branches: HEAD 12 | start_path: docs 13 | worktrees: true 14 | asciidoc: 15 | attributes: 16 | page-stackoverflow-url: https://stackoverflow.com/tags/spring-cloud 17 | page-pagination: '' 18 | hide-uri-scheme: '@' 19 | tabs-sync-option: '@' 20 | chomp: 'all' 21 | extensions: 22 | - '@asciidoctor/tabs' 23 | - '@springio/asciidoctor-extensions' 24 | sourcemap: true 25 | urls: 26 | latest_version_segment: '' 27 | runtime: 28 | log: 29 | failure_level: warn 30 | format: pretty 31 | ui: 32 | bundle: 33 | url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.15/ui-bundle.zip 34 | -------------------------------------------------------------------------------- /docs/antora.yml: -------------------------------------------------------------------------------- 1 | name: cloud-stream 2 | version: true 3 | title: spring-cloud-stream 4 | nav: 5 | - modules/ROOT/nav.adoc 6 | ext: 7 | collector: 8 | run: 9 | command: ./mvnw --no-transfer-progress -B process-resources -Pdocs -pl docs -Dantora-maven-plugin.phase=none -Dgenerate-docs.phase=none -Dgenerate-readme.phase=none -Dgenerate-cloud-resources.phase=none -Dmaven-dependency-plugin-for-docs.phase=none -Dmaven-dependency-plugin-for-docs-classes.phase=none -DskipTests 10 | local: true 11 | scan: 12 | dir: ./target/classes/antora-resources/ 13 | -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/SCSt-groups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/modules/ROOT/assets/images/SCSt-groups.png -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/SCSt-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/modules/ROOT/assets/images/SCSt-overview.png -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/SCSt-partitioning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/modules/ROOT/assets/images/SCSt-partitioning.png -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/SCSt-sensors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/modules/ROOT/assets/images/SCSt-sensors.png -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/SCSt-with-binder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/modules/ROOT/assets/images/SCSt-with-binder.png -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/custom_vs_global_error_channels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/modules/ROOT/assets/images/custom_vs_global_error_channels.png -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/part-bindings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/modules/ROOT/assets/images/part-bindings.png -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/part-exchange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/modules/ROOT/assets/images/part-exchange.png -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/part-queues.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/modules/ROOT/assets/images/part-queues.png -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/producers-consumers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/modules/ROOT/assets/images/producers-consumers.png -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/redis-binder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/modules/ROOT/assets/images/redis-binder.png -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/registration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/modules/ROOT/assets/images/registration.png -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/schema_reading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/modules/ROOT/assets/images/schema_reading.png -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/schema_resolution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/modules/ROOT/assets/images/schema_resolution.png -------------------------------------------------------------------------------- /docs/modules/ROOT/assets/images/spring-initializr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/modules/ROOT/assets/images/spring-initializr.png -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/README.adoc: -------------------------------------------------------------------------------- 1 | :jdkversion: 17 2 | :github-tag: master 3 | :github-repo: spring-cloud/spring-cloud-stream 4 | 5 | :github-raw: https://raw.githubusercontent.com/{github-repo}/{github-tag} 6 | :github-code: https://github.com/{github-repo}/tree/{github-tag} 7 | 8 | image::https://circleci.com/gh/spring-cloud/spring-cloud-stream.svg?style=svg["CircleCI", link="https://circleci.com/gh/spring-cloud/spring-cloud-stream"] 9 | image::https://codecov.io/gh/spring-cloud/spring-cloud-stream/branch/{github-tag}/graph/badge.svg["codecov", link="https://codecov.io/gh/spring-cloud/spring-cloud-stream"] 10 | 11 | // ====================================================================================== 12 | 13 | [[introduction]] 14 | == Introduction 15 | 16 | 17 | [[resources]] 18 | == Resources 19 | 20 | For more information, please visit the https://spring.io/projects/spring-cloud-stream[project website]. 21 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/binders.adoc: -------------------------------------------------------------------------------- 1 | 2 | [[binders]] 3 | == Binder Implementations 4 | :page-section-summary-toc: 1 5 | 6 | The following binder implementations are available: 7 | 8 | * https://cloud.spring.io/spring-cloud-stream-binder-rabbit/[RabbitMQ] 9 | * https://cloud.spring.io/spring-cloud-stream-binder-kafka/[Apache Kafka] 10 | * https://github.com/spring-cloud/spring-cloud-stream-binder-aws-kinesis[Amazon Kinesis] 11 | * https://github.com/spring-cloud/spring-cloud-gcp/tree/master/spring-cloud-gcp-pubsub-stream-binder[Google PubSub _(partner maintained)_] 12 | * https://github.com/SolaceProducts/solace-spring-cloud/tree/master/solace-spring-cloud-starters/solace-spring-cloud-stream-starter#spring-cloud-stream-binder-for-solace-pubsub[Solace PubSub+ _(partner maintained)_] 13 | * https://aka.ms/spring/docs#spring-cloud-stream-binder-for-azure-event-hubs[Azure Event Hubs _(partner maintained)_] 14 | * https://aka.ms/spring/docs#spring-cloud-stream-binder-for-azure-service-bus[Azure Service Bus Binder _(partner maintained)_] 15 | * https://github.com/alibaba/spring-cloud-alibaba/wiki/RocketMQ-en[Apache RocketMQ _(partner maintained)_] 16 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/configprops.adoc: -------------------------------------------------------------------------------- 1 | [[configuration-properties]] 2 | = Configuration Properties 3 | 4 | Below you can find a list of configuration properties. 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-binder/admin-client-config-cust.adoc: -------------------------------------------------------------------------------- 1 | [[admin-client-config-customization]] 2 | = Customizing AdminClient Configuration 3 | 4 | As with consumer and producer config customization above, applications can also customize the configuration for admin clients by providing an `AdminClientConfigCustomizer`. 5 | AdminClientConfigCustomizer's configure method provides access to the admin client properties, using which you can define further customization. 6 | Binder's Kafka topic provisioner gives the highest precedence for the properties given through this customizer. 7 | Here is an example of providing this customizer bean. 8 | 9 | ``` 10 | @Bean 11 | public AdminClientConfigCustomizer adminClientConfigCustomizer() { 12 | return props -> { 13 | props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SASL_SSL"); 14 | }; 15 | } 16 | ``` 17 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-binder/cons-prod-config-cust.adoc: -------------------------------------------------------------------------------- 1 | [[consumer-producer-config-customizer]] 2 | = Customizing Consumer and Producer configuration 3 | 4 | If you want advanced customization of consumer and producer configuration that is used for creating `ConsumerFactory` and `ProducerFactory` in Kafka, 5 | you can implement the following customizers. 6 | 7 | * ConsumerConfigCustomizer 8 | * ProducerConfigCustomizer 9 | 10 | Both of these interfaces provide a way to configure the config map used for consumer and producer properties. 11 | For example, if you want to gain access to a bean that is defined at the application level, you can inject that in the implementation of the `configure` method. 12 | When the binder discovers that these customizers are available as beans, it will invoke the `configure` method right before creating the consumer and producer factories. 13 | 14 | Both of these interfaces also provide access to both the binding and destination names so that they can be accessed while customizing producer and consumer properties. 15 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-binder/error-channels.adoc: -------------------------------------------------------------------------------- 1 | [[kafka-error-channels]] 2 | = Error Channels 3 | 4 | Starting with version 1.3, the binder unconditionally sends exceptions to an error channel for each consumer destination and can also be configured to send async producer send failures to an error channel. 5 | See xref:spring-cloud-stream/overview-error-handling.adoc[this section on error handling] for more information. 6 | 7 | The payload of the `ErrorMessage` for a send failure is a `KafkaSendFailureException` with properties: 8 | 9 | * `failedMessage`: The Spring Messaging `Message` that failed to be sent. 10 | * `record`: The raw `ProducerRecord` that was created from the `failedMessage` 11 | 12 | There is no automatic handling of producer exceptions (such as sending to a xref:kafka/kafka-binder/dlq.adoc[dead letter topic]). 13 | You can consume these exceptions with your own Spring Integration flow. 14 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-binder/manual-ack.adoc: -------------------------------------------------------------------------------- 1 | = Manual Acknowledgement 2 | 3 | This example illustrates how one may manually acknowledge offsets in a consumer application. 4 | 5 | This example requires that `spring.cloud.stream.kafka.bindings.input.consumer.ackMode` be set to `MANUAL`. 6 | Use the corresponding input channel name for your example. 7 | 8 | [source] 9 | ---- 10 | @SpringBootApplication 11 | public class ManuallyAcknowdledgingConsumer { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(ManuallyAcknowdledgingConsumer.class, args); 15 | } 16 | 17 | @Bean 18 | public Consumer> process() { 19 | return message -> { 20 | Acknowledgment acknowledgment = message.getHeaders().get(KafkaHeaders.ACKNOWLEDGMENT, Acknowledgment.class); 21 | if (acknowledgment != null) { 22 | System.out.println("Acknowledgment provided"); 23 | acknowledgment.acknowledge(); 24 | } 25 | }; 26 | } 27 | ---- 28 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-binder/metrics.adoc: -------------------------------------------------------------------------------- 1 | [[kafka-metrics]] 2 | = Kafka Metrics 3 | 4 | Kafka binder module exposes the following metrics: 5 | 6 | `spring.cloud.stream.binder.kafka.offset`: This metric indicates how many messages have not been yet consumed from a given binder's topic by a given consumer group. 7 | The metrics provided are based on the Micrometer library. 8 | The binder creates the `KafkaBinderMetrics` bean if Micrometer is on the classpath and no other such beans provided by the application. 9 | The metric contains the consumer group information, topic and the actual lag in committed offset from the latest offset on the topic. 10 | This metric is particularly useful for providing auto-scaling feedback to a PaaS platform. 11 | 12 | The metric collection behaviour can be configured by setting properties in the `spring.cloud.stream.kafka.binder.metrics` namespace, 13 | refer to the <> for more information. 14 | 15 | You can exclude `KafkaBinderMetrics` from creating the necessary infrastructure like consumers and then reporting the metrics by providing the following component in the application. 16 | 17 | ``` 18 | @Component 19 | class NoOpBindingMeters { 20 | NoOpBindingMeters(MeterRegistry registry) { 21 | registry.config().meterFilter( 22 | MeterFilter.denyNameStartsWith(KafkaBinderMetrics.OFFSET_LAG_METRIC_NAME)); 23 | } 24 | } 25 | ``` 26 | 27 | More details on how to suppress meters selectively can be found https://micrometer.io/docs/concepts#_meter_filters[here]. 28 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-binder/overview.adoc: -------------------------------------------------------------------------------- 1 | = Overview 2 | 3 | The following image shows a simplified diagram of how the Apache Kafka binder operates: 4 | 5 | // .Kafka Binder 6 | // image::{github-raw}/docs/src/main/asciidoc/images/kafka-binder.png[width=300,scaledwidth="50%"] 7 | 8 | The Apache Kafka Binder implementation maps each destination to an Apache Kafka topic. 9 | The consumer group maps directly to the same Apache Kafka concept. 10 | Partitioning also maps directly to Apache Kafka partitions as well. 11 | 12 | The binder currently uses the Apache Kafka `kafka-clients` version `3.1.0`. 13 | This client can communicate with older brokers (see the Kafka documentation), but certain features may not be available. 14 | For example, with versions earlier than 0.11.x.x, native headers are not supported. 15 | Also, 0.11.x.x does not support the `autoAddPartitions` property. 16 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-binder/pause_resume.adoc: -------------------------------------------------------------------------------- 1 | [[pause-resume]] 2 | = Pausing and Resuming the Consumer 3 | 4 | If you wish to suspend consumption but not cause a partition rebalance, you can pause and resume the consumer. 5 | This is facilitated by managing the binding lifecycle as shown in **Binding visualization and control** in the Spring Cloud Stream documentation, using `State.PAUSED` and `State.RESUMED`. 6 | 7 | To resume, you can use an `ApplicationListener` (or `@EventListener` method) to receive `ListenerContainerIdleEvent` instances. 8 | The frequency at which events are published is controlled by the `idleEventInterval` property. 9 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-binder/tombstone.adoc: -------------------------------------------------------------------------------- 1 | [[kafka-tombstones]] 2 | = Tombstone Records 3 | 4 | When using compacted topics, a record with a `null` value (also called a tombstone record) represents the deletion of a key. 5 | To receive such messages in a Spring Cloud Stream function, you can use the following strategy. 6 | 7 | ==== 8 | [source, java] 9 | ---- 10 | @Bean 11 | public Function, String> myFunction() { 12 | return value -> { 13 | Object v = value.getPayload(); 14 | String className = v.getClass().getName(); 15 | if (className.isEqualTo("org.springframework.kafka.support.KafkaNull")) { 16 | // this is a tombstone record 17 | } 18 | else { 19 | // continue with processing 20 | } 21 | }; 22 | } 23 | ---- 24 | ==== 25 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-binder/usage.adoc: -------------------------------------------------------------------------------- 1 | = Usage 2 | 3 | To use Apache Kafka binder, you need to add `spring-cloud-stream-binder-kafka` as a dependency to your Spring Cloud Stream application, as shown in the following example for Maven: 4 | 5 | [source,xml] 6 | ---- 7 | 8 | org.springframework.cloud 9 | spring-cloud-stream-binder-kafka 10 | 11 | ---- 12 | 13 | Alternatively, you can also use the Spring Cloud Stream Kafka Starter, as shown in the following example for Maven: 14 | 15 | [source,xml] 16 | ---- 17 | 18 | org.springframework.cloud 19 | spring-cloud-starter-stream-kafka 20 | 21 | ---- 22 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-reactive-binder/concurrency.adoc: -------------------------------------------------------------------------------- 1 | [[concurrency]] 2 | = Concurrency 3 | 4 | When using reactive functions with the reactive Kafka binder, if you set concurrency on the consumer binding, then the binder creates as many dedicated `KafkaReceiver` objects as provided by the concurrency value. 5 | In other words, this creates multiple reactive streams with separate `Flux` implementations. 6 | This could be useful when you are consuming records from a partitioned topic. 7 | 8 | For example, assume that the incoming topic has at least three partitions. 9 | Then you can set the following property. 10 | 11 | ``` 12 | spring.cloud.stream.bindings.lowercase-in-0.consumer.concurrency=3 13 | ``` 14 | 15 | That will create three dedicated `KafkaReceiver` objects that generate three separate `Flux` implementations and then stream them to the handler method. 16 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-reactive-binder/health_indicator.adoc: -------------------------------------------------------------------------------- 1 | [[reactor-kafka-binder-health-indicator]] 2 | = Reactor Kafka Binder Health Indicator 3 | 4 | Reactor Kafka binder provides a `HealthIndicator` implementation that will be used when invoking the Spring Boot Actuator `health` endpoint. 5 | When Spring Boot actuator dependency is on the classpath, the Reactor Kafka binder can be enabled with a binder health indicator. 6 | This health indicator provides information about the status of the binder based application, i.e. if it is currently `UP` or `DOWN`, the topics in usage by the application, and the various details about the message producer components that the binder uses internally. 7 | 8 | 9 | The Reactor Kafka Binder Health Indicator is registered with the key `reactorKafka` internally by the framework. 10 | Therefore, it can be queried programmatically as shown below. 11 | 12 | [source, java] 13 | ---- 14 | CompositeHealthContributor compositeHealthContributor = context 15 | .getBean("bindersHealthContributor", CompositeHealthContributor.class); 16 | ReactorKafkaBinderHealthIndicator healthIndicator = (ReactorKafkaBinderHealthIndicator) compositeHealthContributor.getContributor("reactorKafka"); 17 | Health health = healthIndicator.health(); 18 | ---- 19 | 20 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-reactive-binder/multiplex.adoc: -------------------------------------------------------------------------------- 1 | [[multiplex]] 2 | = Multiplex 3 | 4 | Starting with version 4.0.3, the common consumer property `multiplex` is now supported by the reactive binder, where a single binding can consume from multiple topics. 5 | When `false` (default), a separate binding is created for each topic specified in a comma-delimited list in the common `destination` property. 6 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-reactive-binder/overview.adoc: -------------------------------------------------------------------------------- 1 | [[reactive-kafka-binder]] 2 | = Overview 3 | 4 | NOTE: As of Spring Cloud Stream version 4.3.0, the reactive Kafka binder is deprecated and will be completely removed in a future release. See the related updates in https://spring.io/blog/2025/05/20/reactor-kafka-discontinued[Reactor Kafka Discontinued Blog Post]. Please continue to use the regular message channel based Kafka binder with reactive types. Keep in mind that the applications will need to handle the various reactive use cases explicitly using the reactor programming model and support from the Project Reactor directly. 5 | 6 | Kafka binder ecosystem in Spring Cloud Stream provides a dedicated reactive binder based on the https://projectreactor.io/docs/kafka/release/reference/[Reactor Kafka] project. 7 | This reactive Kafka binder enables full end-to-end reactive capabilities such as backpressure, reactive streams, etc. in applications based on Apache Kafka. 8 | When your Spring Cloud Stream Kafka application is written using reactive types (`Flux`, `Mono` etc.), it is recommended to use this reactive Kafka binder instead of the regular message channel based Kafka binder. 9 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-reactive-binder/pattern.adoc: -------------------------------------------------------------------------------- 1 | [[destination-is-pattern]] 2 | = Destination is Pattern 3 | 4 | Starting with version 4.0.3, the `destination-is-pattern` Kafka binding consumer property is now supported. 5 | The receiver options are configured with a regex `Pattern`, allowing the binding to consume from any topic that matches the pattern. 6 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-reactive-binder/sender_result.adoc: -------------------------------------------------------------------------------- 1 | [[sender-result-channel]] 2 | = Sender Result Channel 3 | 4 | Starting with version 4.0.3, you can configure the `resultMetadataChannel` to receive `SenderResult` s to determine success/failure of sends. 5 | 6 | The `SenderResult` contains `correlationMetadata` to allow you to correlate results with sends; it also contains `RecordMetadata`, which indicates the `TopicPartition` and offset of the sent record. 7 | 8 | The `resultMetadataChannel` **must** be a `FluxMessageChannel` instance. 9 | 10 | Here is an example of how to use this feature, with correlation metadata of type `Integer`: 11 | 12 | [source, java] 13 | ---- 14 | @Bean 15 | FluxMessageChannel sendResults() { 16 | return new FluxMessageChannel(); 17 | } 18 | 19 | @ServiceActivator(inputChannel = "sendResults") 20 | void handleResults(SenderResult result) { 21 | if (result.exception() != null) { 22 | failureFor(result); 23 | } 24 | else { 25 | successFor(result); 26 | } 27 | } 28 | ---- 29 | 30 | To set the correlation metadata on an output record, set the `CORRELATION_ID` header: 31 | 32 | [source, java] 33 | ---- 34 | streamBridge.send("words1", MessageBuilder.withPayload("foobar") 35 | .setCorrelationId(42) 36 | .build()); 37 | ---- 38 | 39 | When using the feature with a `Function`, the function output type must be a `Message` with the correlation id header set to the desired value. 40 | 41 | Metadata should be unique, at least for the duration of the send. 42 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-reactive-binder/usage.adoc: -------------------------------------------------------------------------------- 1 | [[maven-coordinates]] 2 | = Maven Coordinates 3 | 4 | Following are the maven coordinates for the reactive Kafka binder. 5 | 6 | ``` 7 | 8 | org.springframework.cloud 9 | spring-cloud-stream-binder-kafka-reactive 10 | 11 | ``` 12 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-streams-binder/accessing-metrics.adoc: -------------------------------------------------------------------------------- 1 | [[accessing-kafka-streams-metrics]] 2 | = Accessing Kafka Streams Metrics 3 | :page-section-summary-toc: 1 4 | 5 | Spring Cloud Stream Kafka Streams binder provides Kafka Streams metrics which can be exported through a Micrometer `MeterRegistry`. 6 | 7 | For Spring Boot version 2.2.x, the metrics support is provided through a custom Micrometer metrics implementation by the binder. 8 | For Spring Boot version 2.3.x, the Kafka Streams metrics support is provided natively through Micrometer. 9 | 10 | When accessing metrics through the Boot actuator endpoint, make sure to add `metrics` to the property `management.endpoints.web.exposure.include`. 11 | Then you can access `/actuator/metrics` to get a list of all the available metrics, which then can be individually accessed through the same URI (`/actuator/metrics/`). 12 | 13 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-streams-binder/overview.adoc: -------------------------------------------------------------------------------- 1 | [[overview]] 2 | = Overview 3 | :page-section-summary-toc: 1 4 | 5 | Spring Cloud Stream includes a binder implementation designed explicitly for https://kafka.apache.org/documentation/streams/[Apache Kafka Streams] binding. 6 | With this native integration, a Spring Cloud Stream "processor" application can directly use the 7 | https://kafka.apache.org/documentation/streams/developer-guide[Apache Kafka Streams] APIs in the core business logic. 8 | 9 | Kafka Streams binder implementation builds on the foundations provided by the https://docs.spring.io/spring-kafka/reference/html/#kafka-streams[Spring for Apache Kafka] project. 10 | 11 | Kafka Streams binder provides binding capabilities for the three major types in Kafka Streams - `KStream`, `KTable` and `GlobalKTable`. 12 | 13 | Kafka Streams applications typically follow a model in which the records are read from an inbound topic, apply business logic, and then write the transformed records to an outbound topic. 14 | Alternatively, a Processor application with no outbound destination can be defined as well. 15 | 16 | In the following sections, we are going to look at the details of Spring Cloud Stream's integration with Kafka Streams. 17 | 18 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-streams-binder/state-cleanup.adoc: -------------------------------------------------------------------------------- 1 | [[state-cleanup]] 2 | = State Cleanup 3 | :page-section-summary-toc: 1 4 | 5 | By default, no local state is cleaned up when the binding is stopped. 6 | This is the same behavior effective from Spring Kafka version 2.7. 7 | See https://docs.spring.io/spring-kafka/reference/html/#streams-config[Spring Kafka documentation] for more details. 8 | To modify this behavior simply add a single `CleanupConfig` `@Bean` (configured to clean up on start, stop, or neither) to the application context; the bean will be detected and wired into the factory bean. 9 | 10 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-streams-binder/timestamp-extractor.adoc: -------------------------------------------------------------------------------- 1 | [[timestamp-extractor]] 2 | = Timestamp extractor 3 | 4 | Kafka Streams allows you to control the processing of the consumer records based on various notions of timestamp. 5 | By default, Kafka Streams extracts the timestamp metadata embedded in the consumer record. 6 | You can change this default behavior by providing a different `TimestampExtractor` implementation per input binding. 7 | Here are some details on how that can be done. 8 | 9 | ``` 10 | @Bean 11 | public Function, 12 | Function, 13 | Function, KStream>>> process() { 14 | return orderStream -> 15 | customers -> 16 | products -> orderStream; 17 | } 18 | 19 | @Bean 20 | public TimestampExtractor timestampExtractor() { 21 | return new WallclockTimestampExtractor(); 22 | } 23 | ``` 24 | 25 | Then you set the above `TimestampExtractor` bean name per consumer binding. 26 | 27 | ``` 28 | spring.cloud.stream.kafka.streams.bindings.process-in-0.consumer.timestampExtractorBeanName=timestampExtractor 29 | spring.cloud.stream.kafka.streams.bindings.process-in-1.consumer.timestampExtractorBeanName=timestampExtractor 30 | spring.cloud.stream.kafka.streams.bindings.process-in-2.consumer.timestampExtractorBeanName=timestampExtractor" 31 | ``` 32 | 33 | If you skip an input consumer binding for setting a custom timestamp extractor, that consumer will use the default settings. 34 | 35 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-streams-binder/topology-visualization.adoc: -------------------------------------------------------------------------------- 1 | [[kafka-streams-topology-visualization]] 2 | = Kafka Streams topology visualization 3 | :page-section-summary-toc: 1 4 | 5 | Kafka Streams binder provides the following actuator endpoints for retrieving the topology description using which you can visualize the topology using external tools. 6 | 7 | `/actuator/kafkastreamstopology` 8 | 9 | `/actuator/kafkastreamstopology/` 10 | 11 | You need to include the actuator and web dependencies from Spring Boot to access these endpoints. 12 | Further, you also need to add `kafkastreamstopology` to `management.endpoints.web.exposure.include` property. 13 | By default, the `kafkastreamstopology` endpoint is disabled. 14 | 15 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-streams-binder/usage.adoc: -------------------------------------------------------------------------------- 1 | [[usage]] 2 | = Usage 3 | :page-section-summary-toc: 1 4 | 5 | For using the Kafka Streams binder, you just need to add it to your Spring Cloud Stream application, using the following maven coordinates: 6 | 7 | [source,xml] 8 | ---- 9 | 10 | org.springframework.cloud 11 | spring-cloud-stream-binder-kafka-streams 12 | 13 | ---- 14 | 15 | A quick way to bootstrap a new project for Kafka Streams binder is to use http://start.spring.io[Spring Initializr] and then select "Cloud Streams" and "Spring for Kafka Streams" as shown below 16 | 17 | // image::{github-raw}/docs/src/main/asciidoc/images/spring-initializr-kafka-streams.png[width=800,scaledwidth="75%",align="center"] 18 | 19 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/kafka/kafka-streams.adoc: -------------------------------------------------------------------------------- 1 | :nofooter: 2 | :sectlinks: true 3 | 4 | [[spring-cloud-stream-binder-kafka-streams-reference]] 5 | = Spring Cloud Stream Kafka Streams Binder Reference Guide 6 | 7 | xref:kafka/kafka-streams-binder/usage.adoc[Reference Guide] 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/pulsar/spring-cloud-stream-binder-pulsar.adoc: -------------------------------------------------------------------------------- 1 | :nofooter: 2 | :sectlinks: true 3 | 4 | [[spring-cloud-stream-binder-pulsar-reference]] 5 | = Spring Cloud Stream Pulsar Binder Reference Guide 6 | :page-section-summary-toc: 1 7 | Soby Chacko; Chris Bono; Alexander Preuß; Jay Bryant; Christophe Bornet 8 | :doctype: book 9 | :source-highlighter: prettify 10 | :numbered: 11 | :icons: font 12 | :hide-uri-scheme: 13 | :sc-ext: java 14 | 15 | // ====================================================================================== 16 | 17 | // *{project-version}* 18 | 19 | xref:pulsar/pulsar_binder.adoc[Reference Guide] 20 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/rabbit/rabbit_overview/advanced-binding-configuration.adoc: -------------------------------------------------------------------------------- 1 | [[advanced-configuration]] 2 | = Advanced Configuration 3 | :page-section-summary-toc: 1 4 | 5 | From time to time, the RabbitMQ team add new features that are enabled by setting some argument when declaring, for example, a queue. 6 | Generally, such features are enabled in the binder by adding appropriate properties, but this may not be immediately available in a current version. 7 | Starting with version 3.0.1, you can now add `DeclarableCustomizer` bean(s) to the application context to modify a `Declarable` (`Queue`, `Exchange` or `Binding`) just before the declaration is performed. 8 | This allows you to add arguments that are not currently directly supported by the binder. 9 | 10 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/rabbit/rabbit_overview/advanced-listener-container-configuration.adoc: -------------------------------------------------------------------------------- 1 | [[advanced-listener-container-configuration]] 2 | = Advanced Listener Container Configuration 3 | :page-section-summary-toc: 1 4 | 5 | To set listener container properties that are not exposed as binder or binding properties, add a single bean of type `ListenerContainerCustomizer` to the application context. 6 | The binder and binding properties will be set and then the customizer will be called. 7 | The customizer (`configure()` method) is provided with the queue name as well as the consumer group as arguments. 8 | 9 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/rabbit/rabbit_overview/health-indicator.adoc: -------------------------------------------------------------------------------- 1 | [[rabbit-binder-health-indicator]] 2 | = Rabbit Binder Health Indicator 3 | 4 | The health indicator for Rabbit binder delegates to the one provided from Spring Boot. 5 | For more information on this, see https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#actuator.endpoints.health.auto-configured-health-indicators[this]. 6 | 7 | You can disable this health indicator at the binder level by using the property - `management.health.binders.enabled` and set this to `false`. 8 | In the case of multi-binder environments, this has to be set on the binder's environment properties. 9 | 10 | When the health indicator is disabled, you should see something like the below in the health actuator endpoint: 11 | 12 | ``` 13 | "rabbit": { 14 | "status": "UNKNOWN" 15 | } 16 | ``` 17 | 18 | At the Spring Boot level, if you want to disable the Rabbit health indicator, you need to use the property `management.health.rabbit.enabled` and set to `false`. 19 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/spring-cloud-stream/application-communication.adoc: -------------------------------------------------------------------------------- 1 | [[inter-application-communication]] 2 | = Inter-Application Communication 3 | :page-section-summary-toc: 1 4 | 5 | Spring Cloud Stream enables communication between applications. Inter-application communication is a complex issue spanning several concerns, as described in the following topics: 6 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/spring-cloud-stream/binder-configuration-properties.adoc: -------------------------------------------------------------------------------- 1 | [[binder-configuration-properties]] 2 | = Binder Configuration Properties 3 | 4 | The following properties are available when customizing binder configurations. These properties exposed via `org.springframework.cloud.stream.config.BinderProperties` 5 | 6 | They must be prefixed with `spring.cloud.stream.binders.`. 7 | 8 | type:: 9 | The binder type. 10 | It typically references one of the binders found on the classpath -- in particular, a key in a `META-INF/spring.binders` file. 11 | + 12 | By default, it has the same value as the configuration name. 13 | inheritEnvironment:: 14 | Whether the configuration inherits the environment of the application itself. 15 | + 16 | Default: `true`. 17 | environment:: 18 | Root for a set of properties that can be used to customize the environment of the binder. 19 | When this property is set, the context in which the binder is being created is not a child of the application context. 20 | This setting allows for complete separation between the binder components and the application components. 21 | + 22 | Default: `empty`. 23 | defaultCandidate:: 24 | Whether the binder configuration is a candidate for being considered a default binder or can be used only when explicitly referenced. 25 | This setting allows adding binder configurations without interfering with the default processing. 26 | + 27 | Default: `true`. 28 | 29 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/spring-cloud-stream/binder-detection.adoc: -------------------------------------------------------------------------------- 1 | [[binder-detection]] 2 | = Binder Detection 3 | :page-section-summary-toc: 1 4 | 5 | Spring Cloud Stream relies on implementations of the Binder SPI to perform the task of connecting (binding) user code to message brokers. 6 | Each Binder implementation typically connects to one type of messaging system. 7 | 8 | [[classpath-detection]] 9 | == Classpath Detection 10 | 11 | By default, Spring Cloud Stream relies on Spring Boot's auto-configuration to configure the binding process. 12 | If a single Binder implementation is found on the classpath, Spring Cloud Stream automatically uses it. 13 | For example, a Spring Cloud Stream project that aims to bind only to RabbitMQ can add the following dependency: 14 | 15 | [source,xml] 16 | ---- 17 | 18 | org.springframework.cloud 19 | spring-cloud-stream-binder-rabbit 20 | 21 | ---- 22 | 23 | For the specific Maven coordinates of other binder dependencies, see the documentation of that binder implementation. 24 | 25 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/spring-cloud-stream/binding-names.adoc: -------------------------------------------------------------------------------- 1 | [[binding-names]] 2 | = Binding and Binding names 3 | 4 | Binding is an abstraction that represents a bridge between sources and targets exposed by the binder and user code, 5 | This abstraction has a name and while we try to do our best to limit configuration required to run spring-cloud-stream applications, 6 | being aware of such name(s) is necessary for cases where additional per-binding configuration is required. 7 | 8 | Throughout this manual you will see examples of configuration properties such as `spring.cloud.stream.bindings.input.destination=myQueue`. 9 | The `input` segment in this property name is what we refer to as _binding name_ and it could derive via several mechanisms. 10 | The following sub-sections will describe the naming conventions and configuration elements used by spring-cloud-stream to control binding names. 11 | 12 | NOTE: If your binding name has special characters, such as the `.` character, you need to surround the binding key with brackets (`[]`) and then wrap it in qoutes. 13 | For example `spring.cloud.stream.bindings."[my.output.binding.key]".destination`. 14 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/spring-cloud-stream/consumer-groups.adoc: -------------------------------------------------------------------------------- 1 | [[consumer-groups]] 2 | = Consumer Groups 3 | :page-section-summary-toc: 1 4 | 5 | While the publish-subscribe model makes it easy to connect applications through shared topics, the ability to scale up by creating multiple instances of a given application is equally important. 6 | When doing so, different instances of an application are placed in a competing consumer relationship, where only one of the instances is expected to handle a given message. 7 | 8 | Spring Cloud Stream models this behavior through the concept of a consumer group. 9 | (Spring Cloud Stream consumer groups are similar to and inspired by Kafka consumer groups.) 10 | Each consumer binding can use the `spring.cloud.stream.bindings..group` property to specify a group name. 11 | For the consumers shown in the following figure, this property would be set as `spring.cloud.stream.bindings..group=hdfsWrite` or `spring.cloud.stream.bindings..group=average`. 12 | 13 | .Spring Cloud Stream Consumer Groups 14 | image::SCSt-groups.png[width=800,scaledwidth="75%",align="center"] 15 | 16 | All groups that subscribe to a given destination receive a copy of published data, but only one member of each group receives a given message from that destination. 17 | By default, when a group is not specified, Spring Cloud Stream assigns the application to an anonymous and independent single-member consumer group that is in a publish-subscribe relationship with all other consumer groups. 18 | 19 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/spring-cloud-stream/content-type.adoc: -------------------------------------------------------------------------------- 1 | [[content_type_management]] 2 | = Content Type Negotiation 3 | 4 | Data transformation is one of the core features of any message-driven microservice architecture. Given that, in Spring Cloud Stream, such data 5 | is represented as a Spring `Message`, a message may have to be transformed to a desired shape or size before reaching its destination. This is required for two reasons: 6 | 7 | . To convert the contents of the incoming message to match the signature of the application-provided handler. 8 | 9 | . To convert the contents of the outgoing message to the wire format. 10 | 11 | The wire format is typically `byte[]` (that is true for the Kafka and Rabbit binders), but it is governed by the binder implementation. 12 | 13 | In Spring Cloud Stream, message transformation is accomplished with an `org.springframework.messaging.converter.MessageConverter`. 14 | 15 | NOTE: As a supplement to the details to follow, you may also want to read the following https://spring.io/blog/2018/02/26/spring-cloud-stream-2-0-content-type-negotiation-and-transformation[blog post]. 16 | 17 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/spring-cloud-stream/destination-binders.adoc: -------------------------------------------------------------------------------- 1 | [[destination-binders]] 2 | = Destination Binders 3 | :page-section-summary-toc: 1 4 | 5 | Destination Binders are extension components of Spring Cloud Stream responsible for providing the necessary configuration and implementation to facilitate 6 | integration with external messaging systems. 7 | This integration is responsible for connectivity, delegation, and routing of messages to and from producers and consumers, data type conversion, 8 | invocation of the user code, and more. 9 | 10 | Binders handle a lot of the boiler plate responsibilities that would otherwise fall on your shoulders. However, to accomplish that, the binder still needs 11 | some help in the form of minimalistic yet required set of instructions from the user, which typically come in the form of some type of _binding_ configuration. 12 | 13 | While it is out of scope of this section to discuss all of the available binder and binding configuration options (the rest of the manual covers them extensively), 14 | _Binding_ as a concept, does require special attention. The next section discusses it in detail. 15 | 16 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/spring-cloud-stream/multiple-binders.adoc: -------------------------------------------------------------------------------- 1 | [[multiple-binders]] 2 | = Multiple Binders on the Classpath 3 | :page-section-summary-toc: 1 4 | 5 | When multiple binders are present on the classpath, the application must indicate which binder is to be used for each destination binding. 6 | Each binder configuration contains a `META-INF/spring.binders` file, which is a simple properties file, as shown in the following example: 7 | 8 | [source] 9 | ---- 10 | rabbit:\ 11 | org.springframework.cloud.stream.binder.rabbit.config.RabbitServiceAutoConfiguration 12 | ---- 13 | 14 | Similar files exist for the other provided binder implementations (such as Kafka), and custom binder implementations are expected to provide them as well. 15 | The key represents an identifying name for the binder implementation, whereas the value is a comma-separated list of configuration classes that each contain one and only one bean definition of type `org.springframework.cloud.stream.binder.Binder`. 16 | 17 | Binder selection can either be performed globally, using the `spring.cloud.stream.defaultBinder` property (for example, `spring.cloud.stream.defaultBinder=rabbit`) or individually, by configuring the binder on each binding. 18 | For instance, a processor application (that has bindings named `input` and `output` for read and write respectively) that reads from Kafka and writes to RabbitMQ can specify the following configuration: 19 | 20 | [source] 21 | ---- 22 | spring.cloud.stream.bindings.input.binder=kafka 23 | spring.cloud.stream.bindings.output.binder=rabbit 24 | ---- 25 | 26 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/spring-cloud-stream/overview-application-model.adoc: -------------------------------------------------------------------------------- 1 | [[spring-cloud-stream-overview-application-model]] 2 | = Application Model 3 | :page-section-summary-toc: 1 4 | 5 | A Spring Cloud Stream application consists of a middleware-neutral core. 6 | The application communicates with the outside world by establishing _bindings_ between destinations 7 | exposed by the external brokers and input/output arguments in your code. Broker specific details 8 | necessary to establish bindings are handled by middleware-specific _Binder_ implementations. 9 | 10 | .Spring Cloud Stream Application 11 | image::SCSt-with-binder.png[width=800,scaledwidth="75%",align="center"] 12 | 13 | [[fat-jar]] 14 | == Fat JAR 15 | 16 | Spring Cloud Stream applications can be run in stand-alone mode from your IDE for testing. 17 | To run a Spring Cloud Stream application in production, you can create an executable (or "`fat`") JAR by using the standard Spring Boot tooling provided for Maven or Gradle. See the https://docs.spring.io/spring-boot/docs/current/reference/html/howto-build.html#howto-create-an-executable-jar-with-maven[Spring Boot Reference Guide] for more details. 18 | 19 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/spring-cloud-stream/overview-connecting-multiple-application-instances.adoc: -------------------------------------------------------------------------------- 1 | [[spring-cloud-stream-overview-connecting-multiple-application-instances]] 2 | = Connecting Multiple Application Instances 3 | :page-section-summary-toc: 1 4 | 5 | While Spring Cloud Stream makes it easy for individual Spring Boot applications to connect to messaging systems, the typical scenario for Spring Cloud Stream is the creation of multi-application pipelines, where microservice applications send data to each other. 6 | You can achieve this scenario by correlating the input and output destinations of "`adjacent`" applications. 7 | 8 | Suppose a design calls for the Time Source application to send data to the Log Sink application. You could use a common destination named `ticktock` for bindings within both applications. 9 | 10 | Time Source (that has the binding named `output`) would set the following property: 11 | 12 | ---- 13 | spring.cloud.stream.bindings.output.destination=ticktock 14 | ---- 15 | 16 | Log Sink (that has the binding named `input`) would set the following property: 17 | 18 | ---- 19 | spring.cloud.stream.bindings.input.destination=ticktock 20 | ---- 21 | 22 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/spring-cloud-stream/overview-instance-index-instance-count.adoc: -------------------------------------------------------------------------------- 1 | [[spring-cloud-stream-overview-instance-index-instance-count]] 2 | = Instance Index and Instance Count 3 | :page-section-summary-toc: 1 4 | 5 | When scaling up Spring Cloud Stream applications, each instance can receive information about how many other instances of the same application exist and what its own instance index is. 6 | Spring Cloud Stream does this through the `spring.cloud.stream.instanceCount` and `spring.cloud.stream.instanceIndex` properties. 7 | For example, if there are three instances of a HDFS sink application, all three instances have `spring.cloud.stream.instanceCount` set to `3`, and the individual applications have `spring.cloud.stream.instanceIndex` set to `0`, `1`, and `2`, respectively. 8 | 9 | When Spring Cloud Stream applications are deployed through Spring Cloud Data Flow, these properties are configured automatically; when Spring Cloud Stream applications are launched independently, these properties must be set correctly. 10 | By default, `spring.cloud.stream.instanceCount` is `1`, and `spring.cloud.stream.instanceIndex` is `0`. 11 | 12 | In a scaled-up scenario, correct configuration of these two properties is important for addressing partitioning behavior (see below) in general, and the two properties are always required by certain binders (for example, the Kafka binder) in order to ensure that data are split correctly across multiple consumer instances. 13 | 14 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/spring-cloud-stream/programming-model.adoc: -------------------------------------------------------------------------------- 1 | [[programming-model]] 2 | = Programming Model 3 | 4 | To understand the programming model, you should be familiar with the following core concepts: 5 | 6 | * *Destination Binders:* Components responsible to provide integration with the external messaging systems. 7 | * *Bindings:* Bridge between the external messaging systems and application provided _Producers_ and _Consumers_ of messages (created by the Destination Binders). 8 | * *Message:* The canonical data structure used by producers and consumers to communicate with Destination Binders (and thus other applications via external messaging systems). 9 | 10 | image::SCSt-overview.png[width=800,scaledwidth="75%",align="center"] 11 | 12 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/spring-cloud-stream/samples.adoc: -------------------------------------------------------------------------------- 1 | [[samples]] 2 | = Samples 3 | 4 | For Spring Cloud Stream samples, see the https://github.com/spring-cloud/spring-cloud-stream-samples[spring-cloud-stream-samples] repository on GitHub. 5 | -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "antora": "3.2.0-alpha.4", 4 | "@antora/atlas-extension": "1.0.0-alpha.2", 5 | "@antora/collector-extension": "1.0.0-alpha.3", 6 | "@asciidoctor/tabs": "1.0.0-beta.6", 7 | "@springio/antora-extensions": "1.11.1", 8 | "@springio/asciidoctor-extensions": "1.0.0-alpha.10" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs/src/main/antora/resources/antora-resources/antora.yml: -------------------------------------------------------------------------------- 1 | version: @antora-component.version@ 2 | prerelease: @antora-component.prerelease@ 3 | 4 | #asciidoc: 5 | # attributes: 6 | # attribute-missing: 'warn' 7 | # chomp: 'all' 8 | # project-root: @maven.multiModuleProjectDirectory@ 9 | # github-repo: @docs.main@ 10 | # github-raw: https://raw.githubusercontent.com/spring-cloud/@docs.main@/@github-tag@ 11 | # github-code: https://github.com/spring-cloud/@docs.main@/tree/@github-tag@ 12 | # github-issues: https://github.com/spring-cloud/@docs.main@/issues/ 13 | # github-wiki: https://github.com/spring-cloud/@docs.main@/wiki 14 | # spring-cloud-version: @project.version@ 15 | # github-tag: @github-tag@ 16 | # version-type: @version-type@ 17 | # docs-url: https://docs.spring.io/@docs.main@/docs/@project.version@ 18 | # raw-docs-url: https://raw.githubusercontent.com/spring-cloud/@docs.main@/@github-tag@ 19 | # project-version: @project.version@ 20 | # project-name: @docs.main@ 21 | -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/SCSt-groups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/src/main/asciidoc/images/SCSt-groups.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/SCSt-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/src/main/asciidoc/images/SCSt-overview.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/SCSt-partitioning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/src/main/asciidoc/images/SCSt-partitioning.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/SCSt-sensors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/src/main/asciidoc/images/SCSt-sensors.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/SCSt-with-binder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/src/main/asciidoc/images/SCSt-with-binder.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/custom_vs_global_error_channels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/src/main/asciidoc/images/custom_vs_global_error_channels.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/producers-consumers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/src/main/asciidoc/images/producers-consumers.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/redis-binder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/src/main/asciidoc/images/redis-binder.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/registration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/src/main/asciidoc/images/registration.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/schema_reading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/src/main/asciidoc/images/schema_reading.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/schema_resolution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/src/main/asciidoc/images/schema_resolution.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/images/spring-initializr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/src/main/asciidoc/images/spring-initializr.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/kafka/images/kafka-binder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/src/main/asciidoc/kafka/images/kafka-binder.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/kafka/images/kafka-streams-initializr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/src/main/asciidoc/kafka/images/kafka-streams-initializr.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/kafka/images/spring-initializr-kafka-streams.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/src/main/asciidoc/kafka/images/spring-initializr-kafka-streams.png -------------------------------------------------------------------------------- /docs/src/main/asciidoc/rabbit/images/rabbit-binder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/docs/src/main/asciidoc/rabbit/images/rabbit-binder.png -------------------------------------------------------------------------------- /docs/src/main/ruby/generate_readme.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | base_dir = File.join(File.dirname(__FILE__),'../../..') 4 | src_dir = File.join(base_dir, "/src/main/asciidoc") 5 | require 'asciidoctor' 6 | require 'optparse' 7 | 8 | options = {} 9 | file = "#{src_dir}/README.adoc" 10 | 11 | OptionParser.new do |o| 12 | o.on('-o OUTPUT_FILE', 'Output file (default is stdout)') { |file| options[:to_file] = file unless file=='-' } 13 | o.on('-h', '--help') { puts o; exit } 14 | o.parse! 15 | end 16 | 17 | file = ARGV[0] if ARGV.length>0 18 | 19 | # Copied from https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/scripts/asciidoc-coalescer.rb 20 | doc = Asciidoctor.load_file file, safe: :unsafe, header_only: true, attributes: options[:attributes] 21 | header_attr_names = (doc.instance_variable_get :@attributes_modified).to_a 22 | header_attr_names.each {|k| doc.attributes[%(#{k}!)] = '' unless doc.attr? k } 23 | attrs = doc.attributes 24 | attrs['allow-uri-read'] = true 25 | puts attrs 26 | 27 | out = "// Do not edit this file (e.g. go instead to src/main/asciidoc)\n\n" 28 | doc = Asciidoctor.load_file file, safe: :unsafe, parse: false, attributes: attrs 29 | out << doc.reader.read 30 | 31 | unless options[:to_file] 32 | puts out 33 | else 34 | File.open(options[:to_file],'w+') do |file| 35 | file.write(out) 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/.jdk8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/schema-registry/spring-cloud-stream-schema-registry-client/.jdk8 -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/main/java/org/springframework/cloud/stream/schema/registry/SchemaNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.schema.registry; 18 | 19 | /** 20 | * @author Vinicius Carvalho 21 | */ 22 | public class SchemaNotFoundException extends RuntimeException { 23 | 24 | public SchemaNotFoundException(String message) { 25 | super(message); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/main/java/org/springframework/cloud/stream/schema/registry/SchemaRegistrationResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.schema.registry; 18 | 19 | /** 20 | * @author Marius Bogoevici 21 | */ 22 | public class SchemaRegistrationResponse { 23 | 24 | private int id; 25 | 26 | private SchemaReference schemaReference; 27 | 28 | public int getId() { 29 | return this.id; 30 | } 31 | 32 | public void setId(int id) { 33 | this.id = id; 34 | } 35 | 36 | public SchemaReference getSchemaReference() { 37 | return this.schemaReference; 38 | } 39 | 40 | public void setSchemaReference(SchemaReference schemaReference) { 41 | this.schemaReference = schemaReference; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/main/java/org/springframework/cloud/stream/schema/registry/avro/DefaultSubjectNamingStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.schema.registry.avro; 18 | 19 | import org.apache.avro.Schema; 20 | 21 | import org.springframework.util.StringUtils; 22 | 23 | /** 24 | * @author David Kalosi 25 | */ 26 | public class DefaultSubjectNamingStrategy implements SubjectNamingStrategy { 27 | 28 | @Override 29 | public String toSubject(String subjectNamePrefix, Schema schema) { 30 | return StringUtils.hasText(subjectNamePrefix) ? 31 | subjectNamePrefix + "-" + schema.getName().toLowerCase() : 32 | schema.getName().toLowerCase(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/main/java/org/springframework/cloud/stream/schema/registry/avro/QualifiedSubjectNamingStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.schema.registry.avro; 18 | 19 | import org.apache.avro.Schema; 20 | 21 | import org.springframework.util.StringUtils; 22 | 23 | /** 24 | * @author José A. Íñigo 25 | * @since 2.2.0 26 | */ 27 | public class QualifiedSubjectNamingStrategy implements SubjectNamingStrategy { 28 | 29 | @Override 30 | public String toSubject(String subjectNamePrefix, Schema schema) { 31 | return StringUtils.hasText(subjectNamePrefix) ? 32 | subjectNamePrefix + "-" + schema.getFullName().toLowerCase() : 33 | schema.getFullName().toLowerCase(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/main/java/org/springframework/cloud/stream/schema/registry/avro/SubjectNamingStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2017 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.schema.registry.avro; 18 | 19 | import org.apache.avro.Schema; 20 | 21 | /** 22 | * Provides function towards naming schema registry subjects for Avro files. 23 | * 24 | * @author David Kalosi 25 | */ 26 | public interface SubjectNamingStrategy { 27 | 28 | /** 29 | * Takes the Avro schema on input and returns the generated subject under which the 30 | * schema should be registered. 31 | * @param subjectNamePrefix optional subject name prefix 32 | * @param schema schema to register 33 | * @return subject name 34 | */ 35 | String toSubject(String subjectNamePrefix, Schema schema); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/main/java/org/springframework/cloud/stream/schema/registry/avro/SubjectPrefixOnlyNamingStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2020 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.schema.registry.avro; 18 | 19 | import org.apache.avro.Schema; 20 | 21 | /** 22 | * @author Christian Tzolov 23 | */ 24 | public class SubjectPrefixOnlyNamingStrategy implements SubjectNamingStrategy { 25 | 26 | @Override 27 | public String toSubject(String subjectNamePrefix, Schema schema) { 28 | return subjectNamePrefix; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | org.springframework.cloud.stream.schema.registry.avro.AvroMessageConverterAutoConfiguration 2 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/test/resources/schemas/Command.avsc: -------------------------------------------------------------------------------- 1 | { 2 | "namespace":"example.avro", 3 | "name":"Command", 4 | "type":"record", 5 | "fields":[ 6 | { 7 | "name":"type", 8 | "type":"string" 9 | }, 10 | { 11 | "name":"correlationId", 12 | "type":"string" 13 | }, 14 | { 15 | "name":"payload", 16 | "type":["Sms", "Email", "PushNotification"] 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/test/resources/schemas/imports/Email.avsc: -------------------------------------------------------------------------------- 1 | { 2 | "namespace":"example.avro", 3 | "name": "Email", 4 | "type": "record", 5 | "fields":[ 6 | { 7 | "name":"addressTo", 8 | "type":"string" 9 | }, 10 | { 11 | "name":"title", 12 | "type":"string" 13 | }, 14 | { 15 | "name":"text", 16 | "type":"string" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/test/resources/schemas/imports/PushNotification.avsc: -------------------------------------------------------------------------------- 1 | { 2 | "namespace":"example.avro", 3 | "name": "PushNotification", 4 | "type": "record", 5 | "fields":[ 6 | { 7 | "name":"arn", 8 | "type":"string" 9 | }, 10 | { 11 | "name":"text", 12 | "type":"string" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/test/resources/schemas/imports/Sms.avsc: -------------------------------------------------------------------------------- 1 | { 2 | "namespace":"example.avro", 3 | "name": "Sms", 4 | "type": "record", 5 | "fields":[ 6 | { 7 | "name":"phoneNumber", 8 | "type":"string" 9 | },{ 10 | "name":"text", 11 | "type":"string" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/test/resources/schemas/status.avsc: -------------------------------------------------------------------------------- 1 | { 2 | "namespace":"org.springframework.cloud.stream.samples", 3 | "name": "Status", 4 | "type" : "record", 5 | "fields": [ 6 | {"name": "id", "type": "string"}, 7 | {"name": "text", "type": "string"}, 8 | {"name": "timestamp", "type": "long"} 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/test/resources/schemas/user.avsc: -------------------------------------------------------------------------------- 1 | {"namespace": "example.avro", 2 | "type": "record", 3 | "name": "User", 4 | "fields": [ 5 | {"name": "name", "type": "string"}, 6 | {"name": "favoriteNumber", "type": ["int", "null"]}, 7 | {"name": "favoriteColor", "type": ["string", "null"]} 8 | 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/test/resources/schemas/user1_multiple_records.schema: -------------------------------------------------------------------------------- 1 | [ 2 | {"namespace": "org.springframework.cloud.stream.schema.avro", 3 | "type": "record", 4 | "name": "User1", 5 | "fields": [ 6 | {"name": "name", "type": "string"}, 7 | {"name": "favoriteNumber", "type": ["int", "null"]}, 8 | {"name": "favoriteColor", "type": ["string", "null"]} 9 | 10 | ] 11 | }, 12 | {"namespace": "org.springframework.cloud.stream.schema.avro.v2", 13 | "type": "record", 14 | "name": "User1", 15 | "fields": [ 16 | {"name": "name", "type": "string"}, 17 | {"name": "favoriteNumber", "type": ["int", "null"]}, 18 | {"name": "favoriteColor", "type": ["string", "null"]}, 19 | {"name": "favoritePlace", "type": ["string","null"], "default" : "NYC"} 20 | ] 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/test/resources/schemas/user1_v1.schema: -------------------------------------------------------------------------------- 1 | {"namespace": "org.springframework.cloud.schema.avro", 2 | "type": "record", 3 | "name": "User1", 4 | "fields": [ 5 | {"name": "name", "type": "string"}, 6 | {"name": "favoriteNumber", "type": ["int", "null"]}, 7 | {"name": "favoriteColor", "type": ["string", "null"]} 8 | 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/test/resources/schemas/user1_v2.schema: -------------------------------------------------------------------------------- 1 | {"namespace": "org.springframework.cloud.schema.avro.v2", 2 | "type": "record", 3 | "name": "User1", 4 | "fields": [ 5 | {"name": "name", "type": "string"}, 6 | {"name": "favoriteNumber", "type": ["int", "null"]}, 7 | {"name": "favoriteColor", "type": ["string", "null"]}, 8 | {"name": "favoritePlace", "type": ["string","null"], "default" : "NYC"} 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/test/resources/schemas/user_v2.avsc: -------------------------------------------------------------------------------- 1 | {"namespace": "example.avro.v2", 2 | "type": "record", 3 | "name": "User", 4 | "fields": [ 5 | {"name": "name", "type": "string"}, 6 | {"name": "favoriteNumber", "type": ["int", "null"]}, 7 | {"name": "favoriteColor", "type": ["string", "null"]}, 8 | {"name": "favoritePlace", "type": ["string","null"], "default" : "NYC"} 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/test/resources/schemas/users_v1.schema: -------------------------------------------------------------------------------- 1 | {"namespace": "example.avro", 2 | "type": "record", 3 | "name": "User", 4 | "fields": [ 5 | {"name": "name", "type": "string"}, 6 | {"name": "favoriteNumber", "type": ["int", "null"]}, 7 | {"name": "favoriteColor", "type": ["string", "null"]} 8 | 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-client/src/test/resources/schemas/users_v2.schema: -------------------------------------------------------------------------------- 1 | {"namespace": "example.avro", 2 | "type": "record", 3 | "name": "User", 4 | "fields": [ 5 | {"name": "name", "type": "string"}, 6 | {"name": "favoriteNumber", "type": ["int", "null"]}, 7 | {"name": "favoriteColor", "type": ["string", "null"]}, 8 | {"name": "favoritePlace", "type": ["string","null"], "default" : "NYC"} 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-core/.jdk8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/schema-registry/spring-cloud-stream-schema-registry-core/.jdk8 -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-core/src/main/java/org/springframework/cloud/stream/schema/registry/EnableSchemaRegistryServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.schema.registry; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | import org.springframework.cloud.stream.schema.registry.config.SchemaServerConfiguration; 26 | import org.springframework.context.annotation.Import; 27 | 28 | /** 29 | * Enables the schema registry server enpoints. 30 | * 31 | * @author Vinicius Carvalho 32 | */ 33 | @Target(ElementType.TYPE) 34 | @Retention(RetentionPolicy.RUNTIME) 35 | @Documented 36 | @Import(SchemaServerConfiguration.class) 37 | public @interface EnableSchemaRegistryServer { 38 | 39 | } 40 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-core/src/main/java/org/springframework/cloud/stream/schema/registry/model/Compatibility.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.schema.registry.model; 18 | 19 | /** 20 | * @author Vinicius Carvalho 21 | */ 22 | public enum Compatibility { 23 | 24 | /** 25 | * Backward compatibiltity. 26 | */ 27 | BACKWARD, 28 | 29 | /** 30 | * Forward compatibility. 31 | */ 32 | FORWARD, 33 | 34 | /** 35 | * Full compatibility. 36 | */ 37 | FULL, 38 | 39 | /** 40 | * Lack of compatibility. 41 | */ 42 | INCOMPATIBLE; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-core/src/main/java/org/springframework/cloud/stream/schema/registry/repository/SchemaRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.schema.registry.repository; 18 | 19 | import java.util.List; 20 | 21 | import org.springframework.cloud.stream.schema.registry.model.Schema; 22 | import org.springframework.data.repository.CrudRepository; 23 | import org.springframework.transaction.annotation.Transactional; 24 | 25 | /** 26 | * @author Vinicius Carvalho 27 | */ 28 | public interface SchemaRepository extends CrudRepository { 29 | 30 | @Transactional 31 | List findBySubjectAndFormatOrderByVersion(String subject, String format); 32 | 33 | @Transactional 34 | Schema findOneBySubjectAndFormatAndVersion(String subject, String format, Integer version); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-core/src/main/java/org/springframework/cloud/stream/schema/registry/support/InvalidSchemaException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.schema.registry.support; 18 | 19 | /** 20 | * @author Vinicius Carvalho 21 | */ 22 | public class InvalidSchemaException extends RuntimeException { 23 | 24 | public InvalidSchemaException(String message) { 25 | super(message); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-core/src/main/java/org/springframework/cloud/stream/schema/registry/support/SchemaDeletionNotAllowedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.schema.registry.support; 18 | 19 | /** 20 | * @author Ilayaperumal Gopinathan 21 | */ 22 | public class SchemaDeletionNotAllowedException extends RuntimeException { 23 | 24 | public SchemaDeletionNotAllowedException(String message) { 25 | super(message); 26 | } 27 | 28 | public SchemaDeletionNotAllowedException() { 29 | super("Schema Deletion Not Allowed"); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-core/src/main/java/org/springframework/cloud/stream/schema/registry/support/SchemaNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.schema.registry.support; 18 | 19 | /** 20 | * @author Vinicius Carvalho 21 | */ 22 | public class SchemaNotFoundException extends RuntimeException { 23 | 24 | public SchemaNotFoundException(String message) { 25 | super(message); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-core/src/main/java/org/springframework/cloud/stream/schema/registry/support/UnsupportedFormatException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.schema.registry.support; 18 | 19 | /** 20 | * @author Vinicius Carvalho 21 | */ 22 | public class UnsupportedFormatException extends RuntimeException { 23 | 24 | public UnsupportedFormatException(String message) { 25 | super(message); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-core/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: SchemaRegistryServer 4 | server: 5 | port: 8990 6 | 7 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-core/src/test/java/org/springframework/cloud/stream/schema/registry/entityScanning/domain/TestEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.schema.registry.entityScanning.domain; 18 | 19 | import jakarta.persistence.Column; 20 | import jakarta.persistence.Entity; 21 | import jakarta.persistence.Id; 22 | 23 | /** 24 | * @author Marius Bogoevici 25 | */ 26 | @Entity 27 | public class TestEntity { 28 | 29 | @Id 30 | private long id; 31 | 32 | @Column(name = "name") 33 | private String name; 34 | 35 | public long getId() { 36 | return this.id; 37 | } 38 | 39 | public void setId(long id) { 40 | this.id = id; 41 | } 42 | 43 | public String getName() { 44 | return this.name; 45 | } 46 | 47 | public void setName(String name) { 48 | this.name = name; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-server/.jdk8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-cloud/spring-cloud-stream/a23dc7fe0a4782875060825f3e12c6030373c431/schema-registry/spring-cloud-stream-schema-registry-server/.jdk8 -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-server/src/main/java/org/springframework/cloud/stream/schema/registry/server/SchemaRegistryServerApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2019 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.cloud.stream.schema.registry.server; 18 | 19 | import org.springframework.boot.SpringApplication; 20 | import org.springframework.boot.autoconfigure.SpringBootApplication; 21 | import org.springframework.cloud.stream.schema.registry.EnableSchemaRegistryServer; 22 | 23 | /** 24 | * @author Vinicius Carvalho 25 | */ 26 | // @checkstyle:off 27 | @SpringBootApplication 28 | @EnableSchemaRegistryServer 29 | public class SchemaRegistryServerApplication { 30 | 31 | public static void main(String[] args) { 32 | SpringApplication.run(SchemaRegistryServerApplication.class, args); 33 | } 34 | 35 | } 36 | // @checkstyle:on 37 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-server/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-server/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: SchemaRegistryServer 4 | server: 5 | port: 8990 6 | 7 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-server/src/test/resources/avro_user_definition_schema_v1.json: -------------------------------------------------------------------------------- 1 | { 2 | "namespace": "example.avro", 3 | "type": "record", 4 | "name": "User", 5 | "fields": [ 6 | { 7 | "name": "name", 8 | "type": "string" 9 | }, 10 | { 11 | "name": "favorite_number", 12 | "type": [ 13 | "int", 14 | "null" 15 | ] 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-server/src/test/resources/avro_user_definition_schema_v2.json: -------------------------------------------------------------------------------- 1 | { 2 | "namespace": "example.avro", 3 | "type": "record", 4 | "name": "User", 5 | "fields": [ 6 | { 7 | "name": "name", 8 | "type": "string" 9 | }, 10 | { 11 | "name": "favorite_number", 12 | "type": [ 13 | "int", 14 | "null" 15 | ] 16 | }, 17 | { 18 | "name": "favorite_color", 19 | "type": [ 20 | "string", 21 | "null" 22 | ] 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /schema-registry/spring-cloud-stream-schema-registry-server/src/test/resources/invalid_schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "record", 3 | "name": "SuperType", 4 | "namespace": "some.namespace", 5 | "fields": [ 6 | { 7 | "name": "field", 8 | "type": "SomeType" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /tools/kafka/docker-compose/control-center-ui.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | # Runs a Confluent Control Center UI instance on 'http://localhost:9021'. 4 | # 5 | # Pre-requisites: The brokers are already running. 6 | 7 | services: 8 | 9 | control-center: 10 | image: confluentinc/cp-enterprise-control-center:7.5.0 11 | hostname: control-center 12 | container_name: control-center 13 | depends_on: 14 | - broker1 15 | - broker2 16 | - broker3 17 | ports: 18 | - "9021:9021" 19 | environment: 20 | CONTROL_CENTER_BOOTSTRAP_SERVERS: 'broker1:29091,broker2:29092,broker3:29093' 21 | #CONTROL_CENTER_CONNECT_CONNECT-DEFAULT_CLUSTER: 'connect:8083' 22 | #CONTROL_CENTER_KSQL_KSQLDB1_URL: "http://ksqldb-server:8088" 23 | #CONTROL_CENTER_KSQL_KSQLDB1_ADVERTISED_URL: "http://localhost:8088" 24 | CONTROL_CENTER_SCHEMA_REGISTRY_URL: "http://schema-registry:8081" 25 | CONTROL_CENTER_REPLICATION_FACTOR: 1 26 | CONTROL_CENTER_INTERNAL_TOPICS_PARTITIONS: 1 27 | CONTROL_CENTER_MONITORING_INTERCEPTOR_TOPIC_PARTITIONS: 1 28 | CONFLUENT_METRICS_TOPIC_REPLICATION: 1 29 | PORT: 9021 30 | -------------------------------------------------------------------------------- /tools/kafka/docker-compose/kraft.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | 5 | kafka: 6 | image: apache/kafka:latest 7 | container_name: kafka 8 | hostname: kafka 9 | ports: 10 | - "9092:9092" 11 | - "9101:9101" 12 | environment: 13 | KAFKA_NODE_ID: 1 14 | KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT_DOCKER:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT' 15 | KAFKA_LISTENERS: 'PLAINTEXT_DOCKER://kafka:29092,CONTROLLER://kafka:29093,PLAINTEXT_HOST://0.0.0.0:9092' 16 | KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT_DOCKER://kafka:29092,PLAINTEXT_HOST://localhost:9092' 17 | KAFKA_NUM_PARTITIONS: 10 18 | KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 19 | KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true' 20 | KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0 21 | KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 22 | KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 23 | KAFKA_JMX_PORT: 9101 24 | KAFKA_JMX_HOSTNAME: localhost 25 | KAFKA_PROCESS_ROLES: 'broker,controller' 26 | KAFKA_CONTROLLER_QUORUM_VOTERS: '1@kafka:29093' 27 | KAFKA_INTER_BROKER_LISTENER_NAME: 'PLAINTEXT_DOCKER' 28 | KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER' 29 | KAFKA_LOG_DIRS: '/tmp/kraft-combined-logs' 30 | -------------------------------------------------------------------------------- /tools/kafka/docker-compose/schema-registry.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | # Runs a Confluent Schema Registry instance on 'http://localhost:8081'. 4 | # 5 | # Pre-requisites: The brokers are already running. 6 | 7 | services: 8 | schema-registry: 9 | image: confluentinc/cp-schema-registry:7.5.0 10 | hostname: schema-registry 11 | container_name: schema-registry 12 | depends_on: 13 | - broker1 14 | - broker2 15 | - broker3 16 | ports: 17 | - "8081:8081" 18 | environment: 19 | SCHEMA_REGISTRY_HOST_NAME: schema-registry 20 | SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: 'broker1:29091,broker2:29092,broker3:29093' 21 | SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8081 22 | SCHEMA_REGISTRY_LOG4J_ROOT_LOGLEVEL: WARN 23 | -------------------------------------------------------------------------------- /tools/rabbitmq/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | rabbitmq: 4 | image: rabbitmq:management 5 | ports: 6 | - 5672:5672 7 | - 15672:15672 8 | 9 | --------------------------------------------------------------------------------