Commit Graph

128 Commits

Author SHA1 Message Date
Matt Benson
9119e794c8 simplify KafkaMessageChannelBinder ctor call 2016-05-06 12:51:23 -04:00
Matt Benson
5b05637cd4 add missing accessors for configuration properties' array members 2016-05-05 10:16:43 -05:00
Marius Bogoevici
02ee8d4d88 GH-509: Rework Topic Autoconfiguration
Fixes #509

- prevent autoconfiguration from reducing the existing partition count and/or replication factor

Split `autoConfigureTopics` in two separate settings, one for `autoCreateTopics`
and one for `autoAddPartitions` (to existing topics)

Renamed `defaultMinPartitionCount` to just `minPartitionCount` on the Kafka binder
2016-05-04 15:32:11 -04:00
Marius Bogoevici
8d5bf66c7f GH-504: AutoConfiguration of Kafka Topics
Add a flag for controlling topic autoconfiguration by the Kafka binder

Fixes #504

- introduces a new binder setting `autoConfigureTopics` that allows the user to disable the automatic creation of topics by the binder

Additional tests for partitioning

Adding missing documentation for `replicationFactor`
2016-05-03 10:08:16 -04:00
Marius Bogoevici
1d6ab21067 Use the binder minPartitionCount property for consumers
Fixes #495

Currently, `minPartitionCount` is available both as a binder default and as a consumer property.
It would be simpler if it only was a binder setting (seeing as it has effect only as a default).
2016-05-03 12:04:08 +05:30
Marius Bogoevici
fa42b62074 Add retry and DLQ support for the Kafka binder
Fixes #498

- Honour the retry settings from ConsumerProperties;
- Add an additional  `enableDlq` option in KafkaConsumerProperties that enables forwarding failed messages to a DLQ topic.
2016-04-29 12:27:54 -04:00
bamboo
450350f995 [artifactory-release] Next development version 2016-04-26 22:35:07 +00:00
bamboo
f11414230f [artifactory-release] Release version 1.0.0.RC3 2016-04-26 22:35:07 +00:00
Marius Bogoevici
0bd7899a77 Kafka Binder uses a fixed-size daemon thread pool
Fix #500

- Initialize a fixed-size ExecutorService of the size of the concurrency setting of the binder
- Clean up the ExecutorService on unbind
- Remove unused `spyOn` support
2016-04-26 16:33:27 -04:00
Marius Bogoevici
6227e24e5d Exclude log4j as a Kafka binder dependency
Fixes #480
2016-04-18 13:13:40 -04:00
Ilayaperumal Gopinathan
ca101ba9e9 Use commons-logging
This resolves #490
2016-04-18 10:56:32 -04:00
Ilayaperumal Gopinathan
c815420305 Cleanup todo items
This resolves #485
2016-04-15 15:08:53 -04:00
Marius Bogoevici
147a0cb0bc Add checkstyle support
Fixes #481

Execute checkstyle validation at build time.
Add minimal set of rules.
Ensure that existing code conforms to the rules.
2016-04-15 10:44:37 +05:30
Marius Bogoevici
e18cff39a6 Make sure that raw tests exercise raw mode 2016-04-07 12:13:00 -04:00
bamboo
f9330f1117 [artifactory-release] Next development version 2016-04-07 13:25:26 +00:00
bamboo
727434b732 [artifactory-release] Release version 1.0.0.RC2 2016-04-07 13:25:26 +00:00
Ilayaperumal Gopinathan
502d275b41 Move message header mode as a generic property
- Both the producer and consumer properties have `HeaderMode`
 - Handle the case of embeddedHeaders and raw for both the Sending/ReceivingHandlers in Redis binder

This resolves #408

Move message values extraction to superclass
2016-04-06 15:53:12 -04:00
Ilayaperumal Gopinathan
1730021547 Add basic validation for producer/consumer properties
This resolves #425

Address review comments

 - Update AssertTrue conditional logic
 - Modify the message

Changes after rebase

 - Changes after extendedProperties addition
2016-04-04 20:39:43 -04:00
Ilayaperumal Gopinathan
6c442b7421 Fix compiler warnings
This resolves #467
2016-04-04 20:20:45 -04:00
Ilayaperumal Gopinathan
853e340a35 Remove unused Rabbit binder properties 2016-03-30 14:36:50 +05:30
Marius Bogoevici
ba371ab67a Eliminate Duplicate RabbitMQ Configuration Options
Fixes #447

Some Rabbit MQ configuration properties duplicate options already found in Spring Boot.
2016-03-24 14:12:18 -04:00
Ilayaperumal Gopinathan
6a125b601b Remove ConnectionFactorySettings configuration class
This resolves #386
2016-03-24 10:38:45 -04:00
bamboo
a9e432645d [artifactory-release] Next development version 2016-03-22 01:27:46 +00:00
bamboo
70a6abbc61 [artifactory-release] Release version 1.0.0.RC1 2016-03-22 01:27:46 +00:00
Marius Bogoevici
f681e2ce91 Setting version to 1.0.0.BUILD-SNAPSHOT 2016-03-21 21:11:25 -04:00
bamboo
98de668170 [artifactory-release] Next development version 2016-03-22 00:44:17 +00:00
bamboo
13daf68697 [artifactory-release] Release version 1.0.0.RC1 2016-03-22 00:44:17 +00:00
Marius Bogoevici
cadfd48a1f Adds support for extended binding properties
* Add parameterized ExtendedConsumerProperties and ExtendedProducerProperties;
* Added ExtendedPropertiesBinder with the ability of managing per-binding property extensions and interacting the core service;
* Add extensions for Kafka and Rabbit

Addressing PR comments

Changed binder-specific binding prefix to `spring.cloud.stream.binderType.bindings`

Removing kafka-binder.properties
2016-03-21 18:00:35 -04:00
Gary Russell
fa035296f2 GH-439: Add 'transacted' to Rabbit Producer Props
Fixes #439
Resolves #401
2016-03-17 18:01:35 -04:00
Mark Fisher
2b397b45a7 Moving the Redis Binder out to its own repo
removed redis starter
2016-03-17 15:26:07 -04:00
Marius Bogoevici
af733faf18 Correct Rabbit defaults for headers 2016-03-17 01:58:45 -04:00
Marius Bogoevici
9b0c4bd627 Typesafe consumer and producer configurations
- Change the Binder interface to support ConsumerProperties/ProducerProperties beans and subclasses
- Binders can subclass the property beans to add new supported properties that will be automatically populated
- Spring Cloud Stream will  infer the target type and populate the beans from the environment based on a `spring.cloud.stream.bindings..<bindingName>` prefix
- Remove binder defaults and retain only general binder configurations

TODO: a) decide on instanceIndex/partitionIndex alignment (we do not need both)
b) support `defaultProducer`/`defaultConsumer` properties
c) add leniency control on binding (fail/ignore for unknown properties)
d) add a `requiredProperties` configuration for consumer/producer properties to finely tune the mandatory properties expected to be supported by a bound application

Changes made during review:

- Add support for consumer and producer defaults
- Remove partitionIndex, keeping only instanceIndex
- Fix default properties for Kafka binder
- Move batching properties to Rabbit only
2016-03-15 15:38:30 -04:00
Ilayaperumal Gopinathan
6bbf688d63 Preserve contentType when de-serializing messages from non-SCSt app
- When deserialising the message, replace `contentType` with the `originalContentType` only if the `originalContentType` isn't null which means the original content type was set by the producer before serialising.
 - Add and fix tests

This resolves #404
2016-03-09 17:53:25 +01:00
Ilayaperumal Gopinathan
4d8fa19a3a Support text/* contentType sent by non-SCSt applications
- When deserializing the payload at the consumer endpoint, the non-byte stream payload type requires to use `String` object when the underlying message content-type is of any `text` type contentType (text/plain, text/xml and text/html).
 - This fix is only needed to support any non-SCSt applications that will have the 'text/*` contentType of the message that is being deserialized
 - Add test

This resolves #403
2016-03-07 11:51:25 +05:30
Ilayaperumal Gopinathan
6acb825ad5 Remove XD references in SCSt code base 2016-03-04 15:04:53 -05:00
Ilayaperumal Gopinathan
7021d2195d Set string value for originalContentType in message header
- Since the `originalContentType` header is preserved across the wire while the serialization/de-serialization processes take place using the deduced `contentType`,
it is convenient to set the `String` value of the `originalContentType` instead of setting the actual `MimeType` object in the header.
 - Once the `de-serialization` has taken place, the deduced `contentType` is always replaced with the `originalContentType` as the `contentType` in the message header and this preserved contentType can be resolved to its corresponding MimeType using `ContentTypeResolver` anytime. Hence, using the `String` object for `originalContentType` doesn't do any harm.

 - Fix the issue while setting the deduced contentType based on the `payload` when the `originalContentType` is `application/json`
   - Currently, the contentType is set to `text/plain` which seems incorrect
 - Also, add the `application/json` contentType to return `String` object during de-serialization process.

This resolves #383

Use `text/plain` contentType when the payload is of type `String`

  - This is for the intermediate contentType that is used for serialization/de-serialization
2016-03-04 11:39:30 -05:00
Ilayaperumal Gopinathan
41a24a13e6 Remove unused binder headers
- Remove `binderReplyChannel`, `replyTo` and `binderHistory` headers
2016-03-03 13:07:12 -05:00
Mark Fisher
2bc59a184a AbstractBinder's afterPropertiesSet() is now final
- subclasses should implement the new onInit() method instead of overriding
- avoids the potential for a NPE in case an overriding subclass did not call the superclass method
2016-03-02 13:29:49 -05:00
Ilayaperumal Gopinathan
69e484163c Move spring-cloud-stream tuple
- The `spring-cloud-stream-tuple` is now split into `spring-tuple`, `spring-integration-tuple` along with `spring-batch-tuple`
  - Update dependencies to use the new ones

This resolves #326
2016-02-26 17:12:49 -05:00
Ilayaperumal Gopinathan
4dfd217db6 Maven configuration simplification
- Move kafka related dependencies from parent `dependencyManagement` to `kafka` binder project
 - Remove duplicate properties
 - Fix typo

This resolves #353
2016-02-25 12:44:27 -05:00
Patrick Peralta
d34aafb87b Partition handling refactoring
Moved partition calculation from AbstractBinder to
its own class PartitionHandler.

Updated per review feedback

Refactored bean creation
Added synchronization around bean creation
2016-02-24 16:42:51 -05:00
Ilayaperumal Gopinathan
047a3f8d4f Support sync producer option in Kafka binder
- Add a binding property `spring.cloud.stream.bindings.<outputChannelName>.syncProducer`
   When set to `true`, the Kafka producer metadata is set to use `sync` producer
 - Update DefaultPropertiesAccessor for Kafka to use the `syncProducer` property
 - Add test

This resolves #343

Move syncProducer as a binder level property

 - Add a property `syncProducer` in Kafka Binder configuration properties (prefix: spring.cloud.stream.binder.kafka)
  - Set Kafka ProducerMeatadata `sync` based on the value set in this property
 - Update test
2016-02-23 00:23:18 -05:00
Marius Bogoevici
2fa9cda89c Durability Configuration and Default Groups
Resolves #317

Remove the `durable` binder configuration property
Make subscriber groups durable by default
Introduce `requiredGroups` property
Kafka groups (non-anonymous) now start by default at EARLIEST, which is more appropriate for new stream consumers

Addressing PR comments
2016-02-22 17:33:18 -05:00
Mark Fisher
1b1ac1c07b use correct name for Redis consumer Binding 2016-02-22 17:14:38 -05:00
Marius Bogoevici
6c880726b8 Binder API simplification
Resolves #330

- removes `unbind` from the binder and moves it to the `Binding` instance itself;
- `Binding` is now an interface with a default implementation provided by SCS
- Removed all methods from Binder except for unbind()
- Removed old and unused code
- Removed circular reference between default Binder and Binding implementations
- Removed Binder type
2016-02-22 14:21:03 -05:00
Marius Bogoevici
73b4b6fb3e Fix race condition in multi-destination test 2016-02-19 17:10:08 -05:00
Marius Bogoevici
b1b0e960d7 Corrections for health indicator
Ensure that try-catch is applied around connecting to Zookeeper as well
Register topics in use for consumer
2016-02-19 16:49:54 -05:00
Ilayaperumal Gopinathan
0fb431db3a Add Kafka binder health indicator
- Health indicator fetches broker addresses using ZK configuration and matches it with the leaders of the paritions being used in the binder

This resolves #297

Use Set instead of List to store error messages per broker

Exception handling when connecting to ZK

Add ZK connect/session timeout values as configuration properties

 - Set it in the Kafka binder so that the same can be used for health indicator as well

Rename ZK properties and move them to binder configuration properties
2016-02-19 14:19:39 -05:00
Soby Chacko
76c64e3763 Allow binding to multiple input destinations
More integration tests in AbstractBinderTests
Use embedded Kafka in the tests
2016-02-17 19:11:00 +05:30
Ilayaperumal Gopinathan
71b26b0ed3 Remove unused kafka binder properties 2016-02-15 12:53:57 +05:30