Commit Graph

1033 Commits

Author SHA1 Message Date
durigon
7450686cfe Refactor String#replaceAll
If we repeatedly call String#replaceAll, we internally repeatedly call the regular expression pattern compilation every time as following:
```java
    public String replaceAll(String regex, String replacement) {
        return Pattern.compile(regex).matcher(this).replaceAll(replacement);
    }
```
The modifications are to keep the compiled pattern.
Therefore, compiling a relatively expensive regular expression pattern does not have to be done every time.

Resolves #1486
2018-09-19 14:44:49 +02:00
Oleg Zhurakousky
72ee2fae5d GH-1485 polishing, cleanup and deprecation removal
Resolves #1485
2018-09-19 11:28:23 +02:00
Oleg Zhurakousky
1f3b6ed344 GH-1484 common strategy for extended binding properties
Resolves #1484
2018-09-19 10:41:32 +02:00
Oleg Zhurakousky
c8e9306bc8 polishing
Resolves #1477
2018-09-18 18:53:18 +02:00
Soby Chacko
07b5a691d4 Support extended default properties
Currenlty, we only support default properties for core producer/consumer (spring.cloud.stream.default.producer|consumer...).
These changes add support for configuring default properties for extended producer and consumer properties.

For example, if the binder type is foo, then this allows the applications to configure default properties across
multiple producer or consumer bindings in the form of spring.cloud.stream.foo.default.producer|consumer.property.

The default prefixes for the extended properties are dictated by the respective binder implementations.

Resolves #1360

Manual merging for Map in MergableProperties

Handling values with defaults in extended producer/consumer properties
2018-09-18 18:52:46 +02:00
Oleg Zhurakousky
056898b2ca GH-1457 Added initilal additional-spring-configuration-metadata.json
Resolves #1457
2018-09-13 15:44:06 +02:00
Oleg Zhurakousky
fc8227e42b GH-1460 polishing
Added use of CollectionUtils

Resolves #1468
2018-09-10 17:42:40 +02:00
Gary Russell
de6aa8986b GH-1460: Configurable Exceptions for Retry
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/1460
2018-09-10 16:44:56 +02:00
Gary Russell
d7e88a3a9c GH-1459: Pollable Consumer and Requeue
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/1459

Add a mechanism to cause a requeue of the current message.

Polishing - PR Comments - simpler logic, no configuration needed.

Polishing

Resolves #1467
2018-09-10 16:28:42 +02:00
Oleg Zhurakousky
e4a82107d8 GH-1465 Polishing function support for channel binder
Removed BinderFunctionSupport in favor of private method (at least for now)
Removed 'context.getBean()` from IntegrationFlowFunctionSupport in favor of propper DI

Resolves #1465
2018-09-09 14:36:19 +02:00
David Turanski
c3fdbb93dc GH-1465 Added Function support to channel binder
Move IntegrationFlowFunctionSupport injection to AbstractBinder

Add function support in TestSupportBinder and fix *FunctionsSupportTests

Use BeanPostProcessor and revert TestSupportBinder

Clean up

Set errorChannel in afterPropertiesSet

Refactor IntegrationFlowFunctionSupportWiring

Close context

Revert context.close()
2018-09-09 14:36:19 +02:00
d.kanehira
268b0197ff Simplify code 2018-09-08 02:00:28 +09:00
Alberto Rios
d71cffda55 Updating links in doc for binders
Resolves #1463
2018-09-04 18:11:52 +02:00
Gary Russell
7147a1f901 KBGH-435: Use transactional producer config
See https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/435

Allow binder implementations to override the `useNativeEncoding` producer property.

Resolves #1464
2018-09-04 18:10:17 +02:00
David Turanski
ec19db27b4 Make IntegrationFlowFunctionSupport public again 2018-08-29 10:10:00 -04:00
Oleg Zhurakousky
b7a7470e92 GH-1458 added support for MessageingGateway to Source
Added support for wiring MessagingGateway as Source to provide the same function support as for the Supplier

Resolves #1458
2018-08-29 07:33:56 -05:00
Oleg Zhurakousky
93959dd9f0 Polished testSourceFromSupplier
to demonstrate the default poller configuration
2018-08-29 06:45:24 -05:00
Soby Chacko
20a443081b Next update version: 2.1.0.BUILD-SNAPSHOT 2018-08-28 10:12:14 -04:00
Soby Chacko
7ce25617d2 2.1.0.M2 Release 2018-08-28 09:49:25 -04:00
Oleg Zhurakousky
1008edbe0d GH-1446 Added Spring Cloud Function documentation
Resolves #1446
2018-08-28 06:42:25 -05:00
Gary Russell
eceeb9c168 GH-1454: Fix NonNullApi Violation
Fixes https://github.com/spring-cloud/spring-cloud-stream/issues/1454
Resolves #1455
2018-08-28 04:55:57 -05:00
Oleg Zhurakousky
83f791a07a Added support for Function binding
Added support for binding Suppliers, Function and Consumers as message producers and handlers for apps annotated with EnableBinding
Changed '.name' property to '.definition'

Resolves #1445
2018-08-28 04:48:38 -05:00
Oleg Zhurakousky
716f90c1ab interim 2018-08-27 16:40:40 +02:00
Oleg Zhurakousky
2caf460265 Revert "GH-1450 Fixed lifecycle issue with BindingServiceConfiguration"
This reverts commit d92c748517.
2018-08-25 15:55:16 +02:00
Oleg Zhurakousky
d92c748517 GH-1450 Fixed lifecycle issue with BindingServiceConfiguration
Resolves #1450
2018-08-21 21:46:49 +02:00
Oleg Zhurakousky
25a3591bfd Added support for type-less Message to FunctionInvoker 2018-08-21 20:25:47 +02:00
Oleg Zhurakousky
ab5b40066d GH-1441 Aded initial support for Functions and Consumers
Resolves #1441
2018-08-21 15:23:37 +02:00
Oleg Zhurakousky
c73f311a12 Polished error handling in FunctionInvoker 2018-08-20 20:19:14 +02:00
David Turanski
0fc9d09baf Added FunctionCatalogWrapper for better error handling
Resolves #1449
Resolves #1447
2018-08-20 19:41:44 +02:00
Oleg Zhurakousky
6b1d584c6c GH-1440: Add support for Supplier as Source
Resolves spring-cloud/spring-cloud-stream#1440

Added initial support and configuration to create Source apps by simply
providing a Supplier bean while also benefiting from composition
provided by SCF

Refactored/renamed some of the  new classes/methods

addressed PR comments

* Polishing code style and fix typos
2018-08-17 12:53:28 -04:00
Oleg Zhurakousky
dcd5259041 GH-1443 Upgraded reactor to Californium-M1
Resolves #1443
2018-08-16 13:54:06 +02:00
Oleg Zhurakousky
93785a1213 Reduced visibility of ContentTypeConfiguration
Resolves #1442
2018-08-16 13:36:54 +02:00
Artem Bilan
5c618930fa Revert ContentTypeConfiguration changes
After fixing https://jira.spring.io/browse/INT-4517 we don't need
a hack in the `ContentTypeConfiguration` about removal of the
`IntegrationContextUtils.ARGUMENT_RESOLVER_MESSAGE_CONVERTER_BEAN_NAME`
`BeanDefinition` and registering our own later
* Provide some code polishing for the `ContentTypeConfiguration`
removing some redundant code and providing consistency with
components it uses
* Add `ElementType.PARAMETER` target for the `StreamMessageConverter`
annotation to let the list of appropriate converters to be inject
via method parameters in the `@Bean` definition
* Tentative use SI `5.1.0.BUILD-SNAPSHOT` until Spring Boot 2.1 M2
2018-08-15 15:18:09 -04:00
Oleg Zhurakousky
844ff3230e minor polishing due to recent change in SCF GH-199 2018-08-15 20:26:59 +02:00
Artem Bilan
c8bd515e71 Fix Checkstyle violation in FunctionSupportTests 2018-08-15 12:46:45 -04:00
Oleg Zhurakousky
7a9628506d GH-1437 Added initial components to support SCF
Resolves spring-cloud/spring-cloud-stream#1437
Resolves spring-cloud/spring-cloud-stream#1438

Added initial set of supporting classes, tests and configuration
to support integration of Spring Cloud Function with the current
set of streaming binders.
This commit primarily addresses the Source aspect of such integration

addressed PR comments

* Polishing some code style
* Fix typos
2018-08-15 12:31:46 -04:00
Oleg Zhurakousky
15f9da86d4 Deprecated BinderFactoryConfiguration
added deprecation message
removed unused reference
updated javadoc in BinderTypeRegistry

Resolves #1430
Resolves #1434
2018-08-14 14:04:17 +02:00
Soby Chacko
c85660fba2 Spring Boot 2.1 upgrade
* Removed MockBinderRegistryConfiguration
* Move necessary beans from `BindingServiceConfiguration` which is now auto configurable into
  `BinderFactoryConfiguration` that is invoked by `EnableBinding` in order to avoid certain
  cyclic dependency issues. The beans moved are binding target factories of type
  `MessageSourceBindingTargetFactory` and `SubscribableChannelBindingTargetFactory` and their dependencies.
  As a side effect, `ContentTypeConfiguration` is also brought back at the `EnableBinding` level through
  `BinderFactoryConfiguration`.
* Restore `ServerController`  bean in SchemaServerConfiguation as the removal of it
  earlier introduced  some connectivity issues with the schema registry server.
* Update copyrights
2018-08-14 13:42:02 +02:00
Artem Bilan
776fe5da77 Fix aggregated application behavior
* After moving some bunch of beans from the `@EnableBinding` to the
auto-configuration for proper conditional lifecycle we need to be sure
that all those support beans are registered for each child context as
it was before after parsing imports on the `@EnableBinding`.
This way add `search = SearchStrategy.CURRENT` for all the conditions
in the `BindingServiceConfiguration`
* Fix `TestSupportBinderConfiguration` to rely only on the `Binder`
instance created once in the parent level.
This way when we use an aggregated application, only the parent context
creates for us a `TestSupportBinder` and all the child contexts reuse it.
* Register `BinderFactory` only once in parent ctx
2018-08-10 11:37:14 -04:00
Soby Chacko
ae445e73ac Spring Boot 2.1 upgrade related changes
* Instead of redefining `BinderTypeRegistry` as a bean in several tests, properly use spring.binders
  to define mock binders and then choose a default binder in tests in case of multiple binders in
  same spring.binders file.
* Remove `BindingServiceConfiguration` in `EnableBinding` and introduce it as a proper
  Spring Boot autoconfiguration class. Added `BindingServiceConfiguration` to spring.factories.
* Move `BinderFactory` bean into `BindingServiceConfiguration` and add `ConditionalOnMissingBean`
  on it so that downstream users can define new `BinderFactory` beans as part of autoconfiguration.
* Remove `ConditionalOnMissingBean` from the `BinderTypeRegistry` bean in `BinderFactoryConfiguration`
  as we don't expect this bean to be overridden.
* Remove previously added property `spring.main.allow-bean-definition-overriding` in several tests.
* Since web/actuator is optional now, remove unncecessarily setting server.port to `0` in tests
* Ensure that `BindersHealthIndicatorAutoConfiguration` is autoconfigured after `BindingServiceConfiguration`
  so that it has a `BinderFactory` available.
* Remove redefining `ServerController` bean in `SchemaServerConfiguration` as this is already created through
  component scanning and causing the bean overriding exceptions.
* Tests cleanup and polishing.

Resolves #1429, #1430
2018-08-10 11:27:11 -04:00
Soby Chacko
85b34be733 Spring Boot 2.1 - further updates
Update more tests with bean overriding errors where they try to override the `BinderTypeRegistry` bean.
This is not very common in end user applications unless they are trying to define a new binder type.
If that is indeed the case, then they have to set `spring.main.allow-bean-definition-overriding` to `true`.

Remove where we define the bean `integrationArgumentResolverMessageConverter` in `ContentTypeConfiguration`
as this causes a conflict with the same bean from Spring Integration and thus causing bean overriding exception.
Insted of creating this through `@Bean`, manually register the bean after removing it from `BeanDefinitionRegistry`.
2018-08-07 17:24:42 -04:00
Soby Chacko
cb105ab0ec Upgrade Spring Cloud Build to 2.1.0
This upgrades to Spring Boot 2.1.0
Fix tests where the beans need to get overridden
Minor cleaning up
Polishing

Resolves #1426
2018-08-07 19:47:13 +02:00
Gary Russell
fa1b6257d5 KGH-309: Allow override of partition count
See: https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/309

Provide binders with access to the output channel so it can override the
partition count on the `PartitioningInterceptor` if it detects that the
actual partition count is different to that configured in the producer properties.

Resolves #1421
2018-07-25 20:02:16 +02:00
Soby Chacko
daccfb5e58 Properties propagation in custom environment
Currently when the binder configuration provide properties in a custom environment,
Spring Cloud Stream does not include any beans from the outer context.
This change will ensure that in such cases, the binder context will have access
to the outer context as a non-parent bean.

Resolves #1420
Resolves #1423
2018-07-25 16:29:53 +02:00
Oleg Zhurakousky
3bfe1775af GH-1418 Fixed binding visualization bug
Resolves #1418
2018-07-17 18:43:18 +02:00
Oleg Zhurakousky
f7ba212b82 GH-1417 Fixed default contentType in doc
Resolves #1417
2018-07-16 09:23:49 +02:00
Oleg Zhurakousky
1f5f8da787 Added SpelExpressionConverterConfiguration to BindingServiceConfiguration 2018-07-10 16:37:02 +02:00
Oleg Zhurakousky
37ecae4ab7 GH-1412 Ensured SpelExpressionConverterConfiguration present in multi-binder
Ensured that SpelExpressionConverterConfiguration is always present in the AC regardless of single or multi-binder application configuration
Polishing

Resolves #1412
2018-07-09 19:54:55 -04:00
Soby Chacko
66cfdffad9 Autoconfigure optimization
Add spring-boot-autoconfigure-processor to spring-cloud-stream
and spring-cloud-stream-reactive modules for auto configuration optimization.

Resolves #1410
Resolves #1411
2018-07-06 12:44:55 +02:00
Oleg Zhurakousky
eea20befc3 GH-1405 added RetryTemplate qualifier (#1406)
* GH-1405 added RetryTemplate qualifier

Added @StreamRetryTemplate qualifier annotation
Resolves #1405

* GH-1405 renamed field to >
2018-07-03 13:44:28 -04:00