Commit Graph

881 Commits

Author SHA1 Message Date
Oleg Zhurakousky
09f4c8118f GH-1228 Type resolvers cleanup
- moved OriginalContentTypeResolver to avro module
- removed StringConvertingContentTypeResolver as it is no longer referenced anywhere
- deprecated KryoMessageConverter

Resolves #1228
2018-02-17 16:35:21 -05:00
Oleg Zhurakousky
82cb15b709 GH-1065 Polished POMs to pull boot managed rx version
Resolves #1065
2018-02-17 08:29:06 -05:00
Oleg Zhurakousky
f263746420 GH-1214 Fixed ClassUtils check for Servlet API
Resolves #1214
2018-02-17 07:42:42 -05:00
Oleg Zhurakousky
746dbc1bd3 GH-1219 Fixed channel instrumentation in BinderAwareChannelResolver
- added support for instrumenting dynamic channels with global interceptors
- added test

Resolves #1219
Resolves #1227
2018-02-17 07:30:01 -05:00
jmaxwell
275c212d47 1217 Disable Pretty Print
Resolves #1224
2018-02-14 13:44:38 -05:00
Oleg Zhurakousky
21d1dbea83 Polishing DefaultSchemaRegistryClient
- made RestTemplate final
- removed setter

Resolves #1222 #1223
2018-02-14 10:40:10 -05:00
jmaxwell
c2b3194fb9 1222 DefaultSchemaRegistryClient should accept a custom RestTemplate.
Added protected accessors to allow subclasses access to RestTemplate and endpoint fields.
2018-02-14 10:21:17 -05:00
Oleg Zhurakousky
d8a9471012 Polishing AvroSchemaRegistry stuff
- removed deprecated constructor from AvroSchemaRegistryClientMessageConverter
- fixed test
- formatting

Resolves #1221 #1218
2018-02-14 10:15:17 -05:00
jmaxwell
f5d625e9de 1218 Inconsistent use of AvroSchemaRegistryClientMessageConverter.AVRO_FORMAT 2018-02-14 09:50:53 -05:00
jmaxwell
a160cd7ea8 1215 CachingCachingRegistryClient stores data by wrong keys resulting in fetch operations always missing.
Resolves #1216
2018-02-13 20:37:42 -05:00
Oleg Zhurakousky
0463f7939d GH-1175 Removed dependency on spring-boot-starter-web
- Removed spring-boot-starter-web dependency from the core
- Polished AggregateApplicationBuilder to ensure it thriows meaningful exception when web is enabled but 'spring-boot-starter-web' is not on the classpath
- fixed Aggregator tests to defualt to no-web
- added spring-boot-starter-web to schema projects

Resolves #1175
2018-02-09 10:39:52 -05:00
Oleg Zhurakousky
0332d16c48 GH-1210 Fixed AbstractReplyProducingMessageHandler post processing
- addNotPropagatedHeaders(..) is now moved to simple ApplicationListener listening for ContextRefreshedEvent

Resolves #1210
2018-02-08 17:36:57 -06:00
Oleg Zhurakousky
6a95154302 GH-1209 upgraded to Reactor Bismuth.SR5
Resolves #1209
2018-02-06 10:44:22 -06:00
Soby Chacko
2124955281 Update spring-cloud-tools parent version 2018-02-06 07:34:54 -05:00
Soby Chacko
bac85f1a5b Back to 2.0.0.BUILD-SNAPSHOT 2018-02-05 13:54:26 -05:00
Soby Chacko
5a62215514 Update for 2.0.0.M4 Release 2018-02-05 13:30:40 -05:00
Oleg Zhurakousky
1211a273f6 Added support for framework provided converter to DefaultPollableMessageSource
- Merged SmartJsonMessageConverter with ApplicationJsonMessageMarshallingConverter
- Fixed Tests
- Fixed SpringIntegrationChannelBinder to enforce byte[] payload type for polling delegate
- Other minor polishings

Resolves #1197
2018-02-04 13:26:06 -05:00
Gary Russell
57f56dc6f5 Pollable Consumer Payload Conversion
- support payload conversion for polled consumers

Cache Types
2018-02-04 13:21:19 -05:00
Oleg Zhurakousky
ee06a605d9 addressed PR comments 2018-02-03 07:33:27 -05:00
Oleg Zhurakousky
9672a5b4df Fixed double conversion issue
- removed custom conversion from In/Out interceptors delegating everything to the available  MessageConverters
- added initial version of content-type TCK to validate various content-type conversion scenarious
- added initial content-type conversion matrix to the WIKI https://github.com/spring-cloud/spring-cloud-stream/wiki/Content-type-conversion-matrix

Resolves #1130
Resolves #1071
2018-02-03 07:33:27 -05:00
Oleg Zhurakousky
f4fb7c124b GH-1208 Added javadoc to Bind*Properties
Resolves #1208
2018-02-03 07:29:42 -05:00
jmaxwell
6a23cf95f5 1202 Inconsistent use of this.prefix in AvroSchemaRegistryClientMessageConverter.resolveSchemaForWriting
Resolves #1202
Resolves #1203
2018-02-01 08:37:13 -06:00
Gary Russell
b26a9819ee GH-1193: Fix Late Binding
LateBinding fields must be volatile for the test to be sure
to get the value (they should be volatile anyway).
2018-01-24 15:32:30 -05:00
Gary Russell
d0c7684ad6 GH-1193: Increase late binding test timeouts 2018-01-24 15:09:19 -05:00
Gary Russell
100e7fd8cd GH-1193: Fix test race condition
Fixes https://github.com/spring-cloud/spring-cloud-stream/issues/1193
2018-01-24 13:36:26 -05:00
Gary Russell
b12480c487 GH-1191: Add test support for pollable sources 2018-01-24 13:01:25 -05:00
Oleg Zhurakousky
d5bfddc7fc polishing
Resolves #1190
2018-01-24 09:58:29 -05:00
Gary Russell
cef7f0b70c GH-1186: Polled Consumer Documentation
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/1186
2018-01-24 09:55:51 -05:00
Gary Russell
e040cf02b4 Pollable Consumer : Start Source if Lifecycle
When binding a `MessageSource`, start it if it implements `Lifecycle`.

Resolves #1189
2018-01-23 13:48:45 -05:00
Soby Chacko
c1749ca866 New abstraction for StreamListener method setup invoker.
StreamListenerMethodSetupOrchestrator is an API hook that allows
downstram binder implementations or applications to inject custom
strategies to alter the default StreamListener adapter method invocations.

This PR primarily focuses on allowing customizations on the oubound side.
For the inbound, StreamListenerMethodSetupOrchestrator interface provides
a default implementation.

Corresponding refactoring in StreamListenerAnnotationBeanPostProcessor.
By default StreamListenerAnnotationBeanPostProcessor will use the current
strategies used for invoking the StreamListener adapters. If beans are provided
for orchestration, they take precedence however.

Test changes.

Further polishing in StreamListenerAnnotationBeanPostProcessor.

Resolves #1177
Resolves #1179
2018-01-18 11:59:43 -05:00
Oleg Zhurakousky
9ef1181f7a Merge pull request #1184 from garyrussell/docFix
Various Doc Fixes
2018-01-16 15:45:45 -05:00
Gary Russell
cb25d7d369 Various Doc Fixes
- missing `}` in one code snippet caused syntax-highlighting problems in asciidoc-aware editors such as atom
- use spaces, not tabs for code snippets
- Change markdown to asciidoc for one snippet
2018-01-16 15:34:44 -05:00
Oleg Zhurakousky
00748985d6 Support @Beans for Partitioning Properties
Fixed support for partition properties to be Spring configured

- Fixed support for 'partitionKeyExtractor' and 'partitionSelector' to be Spring configured
- Added new producer properties 'partitionKeyExtractorName' and 'partitionSelectorName'
- Deprecated 'partitionKeyExtractorClass' and 'partitionSelectorClass' properties
- Removed InitilaizingBean from MessageConverterConfigurer
- Updated documentation
- Added additional tests
- Removed PartitionedProducerTest  as redundant
- Fixed unrelated to this effort BinderPropertiesTests due to recent Boot changes

polishing
2018-01-16 15:24:16 -05:00
Oleg Zhurakousky
b3d5c4f518 Simplified contentType negotiation
In preparation to contentType TCK, simplified InboundContentTypeConvertingInterceptor's logic
2018-01-15 14:49:24 -05:00
Gary Russell
7267661d2e GH-1174: Add Pollable Consumer
Resolves: https://github.com/spring-cloud/spring-cloud-stream/issues/1174

Introduce `PollableMessageSource` for polled consumers.

The `@Input` annotation can now be applied to interface methods returning
`PollableMessageSource` and binders that can support polled consumers
will wire up an implementation `DefaultPollableMessageSource` which can
then be `poll()`ed.

The `poll()` method takes a `MessageHandler` callback to handle any message
returned by the poll; the method returns true if a message was found and
handled, false otherwise.

By default, acknowledging the message is deferred until the message handler
returns but that auto-acknowledging can be disabled if the user wishes to
defer the acknowledgment until later. Refer to the Spring Integration
documentation for more information (internally, a `MessageSourcePollingTemplate`
is used, which performs the ack/nack when the handler exits).

Usage:

```java
public interface PolledConsumer extends Processor {

	@Input("pollableSource")
	PollableMessageSource pollableSource();

}
```

and

```java
@Bean
public ApplicationRunner runner(PollableMessageSource pollableSource) {
	return args -> pollableSource.poll(message -> {
		System.out.println("Polled payload: " + message.getPayload());
	});
}
```

Polishing

Fix test; add support to test binder.

Add error channel handling and retry

More polishing driven by Rabbit implementation

- can't use the MessageSourcePollingTemplate within retry since it will fetch more messages
- populate the retry context with data for the error message strategy

Polishing - PR Comments

Fix NPE.

Revert finally in DefaultPollableMessageSource

Catch Throwable - JUnit throws Errors

Change method name to reflect it's only used for polled consumers.

Fix errors when no retry

Remove stack trace print

Fix error message strategy context with no retry

Add separate error MessageHandler for polled consumers.

Resolves #1174
Resolves #1176
2018-01-13 11:44:04 -05:00
Artem Bilan
8513e80c2a Replace propAccessorInjector with the SpelPAReg
After changing the `propertyAccessorInjector` `BeanPostProcessor`
just to a simple `InitializingBean` there is no guarantee which bean
will be accessed from the autowire phase.
There are some cases like `@PostConstruct` on the `@Configuration`
wich may be called before this new `propertyAccessorInjector` bean
and we end up with `EvaluationContext` not supplied with additional
`PropertyAccessors`

* For proper `IntegrationEvaluationContextFactoryBean` initialization
add `SpelPropertyAccessorRegistrar` for custom `PA` configuration
* Remove `propertyAccessorInjector` bean altogether
* Resolve deprecation in the `BindingServiceConfiguration`
* Modify `SpelExpressionConverterConfigurationTests` to confirm that
even `@PostConstruct` on `@Configuration` works as expected

Resolves #1178
2018-01-11 20:32:00 -05:00
Oleg Zhurakousky
b0356bdea9 1123 made CompositeMessageChannelConfigurer conditional
Annotated CompositeMessageChannelConfigurer wih @ConditionalOnMissingBean to allow it to be overriden

Resolves #1123
2018-01-10 22:30:45 -05:00
Oleg Zhurakousky
a8dfb2f833 GH-1135 Fixed argument resolvers consistency
- added SI provided argumentResolvers to MessageHandlerMethodFactory configuration to ensure that StreamListener annotated methods are consistent with equivalent SI config annotations (e.g., ServiceActivator)

Resolves #1135
2018-01-04 20:58:35 -05:00
Oleg Zhurakousky
71c295ef09 Removed PostProcessorConfiguration from BindingServiceConfiguration
- substituted BPPs for InitializingBeans removing the possibility of early initialization.

Resolves #1172
2018-01-04 13:53:56 -05:00
Oleg Zhurakousky
c76c29f249 Aligned StreamEmitterAnnotationBeanPostProcessor with StreamListenerAnnotationBeanPostProcessor
. . .as part of the effort to fix early initialization of beans inside BeanPostProcessors.

Resolves #1157
2018-01-03 21:46:40 -05:00
Oleg Zhurakousky
87bf2734e7 polishing BinderAwareRouterBeanPostProcessor
- removed BeanPostProcessor from BinderAwareRouterBeanPostProcessor
- simplified BinderAwareRouterBeanPostProcessor configuration in BindingServiceConfiguration

Resolves #1171
Resolves #1170
2018-01-03 21:07:35 -05:00
Artem Bilan
502bddd4e9 GH-1170: Fix early BeanFactory initialization
Fixes: spring-cloud/spring-cloud-stream#1170

The `messageHandlerHeaderPropagationBeanPostProcessor` causes early
`BeanFactory` initialization via its `SpringIntegrationProperties`
dependency.
This triggers an initialization all the `@ConfigurationProperties`
infrastructure in Spring Boot, when we might not have all the necessary
beans, e.g. `Converter` for some configuration property

* Eliminate the "early `BeanFactory` initialization syndrome" through
the `SmartInitializingSingleton`

**Cherry-pick to 1.3.x**
2018-01-03 14:07:30 -05:00
Artem Bilan
7d2e3a3815 Fix AbstractBinderTests to populate properties
Some tests in `AbstractBinderTests` are rely on the partition header,
but that one can be populated only by the `PartitionInterceptor`.
To allow it we need to provide appropriate producer properties, like
`partitionKeyExpression`.

* Populate test-based `ProducerProperties` to the
`createBindableChannel()` where `PartitionInterceptor` is populated
* Fix `checkstyle.xml` static imports rule for Mockito-2.x as the
current base line

Fix for the proper `BindingProperties` usage
2017-12-21 18:49:41 -05:00
Artem Bilan
6d22d039dd GH-1159 Extract EmbeddedHeaders first on consumer
Fixes: spring-cloud/spring-cloud-stream#1159

* Extract `EmbeddedHeadersChannelInterceptor` class for better navigation
* Use only one shared instance of this interceptor since it is stateless
* Add this `EmbeddedHeadersChannelInterceptor` in the position `0` to
extract embedded headers first

The fix confirmed by Kafka and Kinesis binders
2017-12-21 17:40:16 -05:00
Oleg Zhurakousky
80fee48b4a 1146 Fixed early initialization in StreamListenerAnnotationBeanPostProcessor
Removed autowiring from StreamListenerAnnotationBeanPostProcessor in favor of late-binding callbacks
Fixed tests

Resolves #1146
2017-12-13 11:14:45 -05:00
Oleg Zhurakousky
f59c85842b General cleanup of StreamListenerAnnotationBeanPostProcessor
- Removed BeanFactoryAware dependency
- Simplified `isDeclarativeMethodParameter` and related operations
2017-12-12 14:37:36 -05:00
Oleg Zhurakousky
7489c382ce General cleanup
- Deprecated BindableAdapter in favor of providing default operations in Bindable
- Removed 'postProcessBeforeInitialization(..)' from 'BinderAwareRouterBeanPostProcessor' as it is no longer required
2017-11-28 22:32:39 -05:00
Oleg Zhurakousky
7b5bb2f463 StreamListenerAnnotationBeanPostProcessor refactoring/polishing
Continue the work started in f53ff9585a
- simplified 'isDeclarativeMethodParameter(..) operation of StreamListenerAnnotationBeanPostProcessor
- aligned MessageChannelToInputFluxParameterAdapter and MessageChannelToInputObservableParameterAdapter around the actual Message
2017-11-28 14:58:15 -05:00
Oleg Zhurakousky
593b8c38ca Fixed ClassLoader discovery logic in BinderFactoryConfiguration 2017-11-28 10:07:07 -05:00
Oleg Zhurakousky
f53ff9585a 1146 Initial fix for eager initialization in StreamListenerAnnotationBPP
- Removed dependency and callbacks to 'BeanFactoryUtils.beansOfTypeIncludingAncestors' in
    StreamListenerAnnotationBeanPostProcessor in favor of more appropriate and lazy DI
    mechanism provided by Spring.
  - Polishing
2017-11-27 22:26:32 -05:00