Resolves https://github.com/spring-projects/spring-integration-kafka/issues/184
Polishing - changes in core
Pause/Resume; Add integration tests
Synchronize all consumer operations on the consumer, to support noAutoAck()
Polishing - PR Comments
More polishing
Major rework - see commit comment
- only fetch one record at a time (warn log and seek if max.poll.records incorrect)
- when an application has multiple outstanding records,
- track records; apply commits in the right order, deferring if necessary
- when requeued, mark later offsets as rolled back to prevent commits
- Support transactions
- start/end transactions
- provide access to the producer
Fix transaction synchronization
- if there is an existing Kafka transaction, participate in it
- if not, bind a new transactional resource to the thread - allows a KafkaTemplate to
participate by utilizing the producer factory message header
- if there is an existing non-kafka transaction, sync the kafka transaction with it
Check for KafkaMessageHeaders when building the message.
Polishing - PR Comments
Simplify AckInfo
Remove internal transaction support - the user can start a transacion before calling receive
and send offsets to the transaction using a KafkaTemplate.
Polishing
* Simple polishing according IDEA warnings
* Upgrade to Gradle 4.4.1
* Some upgrades and dependencies polishing
Resolves https://github.com/spring-projects/spring-integration-kafka/issues/172
Use `ErrorMessageStrategy` to build an error message in the event of a failure.
Update to SI 4.3.12.
Polishing - PR Comments - Use standard outputChannel (if configured) for success.
Polishing - PR Comments
Javadoc Polishing
* Polishing `@since` in JavaDocs
* Upgrade to Checkstyle 8.1, SI-5.0.B-S
* Adjust `RequireThis` rule and fix vulnerabilities
# Conflicts:
# build.gradle
# src/test/java/org/springframework/integration/kafka/outbound/KafkaProducerMessageHandlerTests.java
- bind input message, raw record to retry context
- support recover without retry (recover after a single shot)
Change RecoveryCallback from <Void> to <Object>
Actually <? extends Object> for backwards compatibility.
Changes needed for the latest updates to Spring Integration
Now that the 4.3.10.BS artifacts are in artifactory.
Suppress Deprecation Warnings
checkstyle and PR Comments
Javadocs and TL.remove()
Fix Attributes Logic
Polishing - PR Comments - Enhanced error message for conversion errors.
Make errorChannel and retryTemplate mutually exclusive
Fix TL.remove with retry.
* Polishing `build.gradle` before merging
Fix TL.remove with retry.
Remove mavenLocal()
Conflicts:
build.gradle
src/main/java/org/springframework/integration/kafka/inbound/KafkaMessageDrivenChannelAdapter.java
* Use `KafkaHeaders.RAW_DATA`
* Use `ErrorMesage` directly
* Adapt DSL test to use `ErrorMessageSendingRecoverer`
* Add ability to specify `id` for `MessageListenerContainer` and
`KafkaTemplate` beans configured internally and exposed as beans
by the DSL
checkstyle
Fixesspring-projects/spring-integration-kafka#158
Fixing build - replaced a call to removed API in spring-kafka project
Support for timestamp expression in SI schema and SI DSL
* Polishing according PR comments
* Upgrade all the dependencies
* Upgrade to Gradle 3.1 (experimental)
* Make Java 8 as minimal
* Decrease test logging level to `warn`
* Document Java DSL support and some other polishing in the `README.adoc`
Listener changes require a bump of the s-i-k version.
This is an initial commit - we will add support for new features (such as batch
payloads in future commits).
Polishing
* Upgrade to SI-4.3.x
* Use `Assert.instanceOf()`
Even if target ``partitionId` value has to be `Integer`, we want to be able to configure the attribute via property-placeholder or Bean initialization SpEL
* Change `partition-id` XSD type from `integer` -> `string`
* Ensure that fix is correct with the test-case
Fixes: GH-125 (https://github.com/spring-projects/spring-integration-kafka/issues/125)
* Add `sync` mode for the `KafkaProducerMessageHandler` (`false` by default) to wait for result from the send `Future`
* Add `sendTimeout` do not block `Future.get()` forever
* Provide test-case based on the `MockProducer` to complete the record with an exception and verify that the `sync` mode works well
* Some dependencies upgrade
Wrap `Future.get()` `TimeoutException` into `MessageTimeoutException`
Fix whitespace after comma
Fixes GH-124 (https://github.com/spring-projects/spring-integration-kafka/issues/124)
* Add `RecordFilterStrategy`, `ackDiscarded`, `retryTemplate`, `RecoveryCallback` and `filterInRetry` options into `KafkaMessageDrivenChannelAdapter`
* Wrap an internal `IntegrationMessageListener` into `FilteringAcknowledgingMessageListenerAdapter` and/or `RetryingAcknowledgingMessageListenerAdapter`
if those options are provided.
* The `filterInRetry` flag provides a logic to identify the wrapping order for those adapters.
Change `ContainerProperties` instance usage in the test-case from original to an internal in the `KafkaMessageListenerContainer`
That meets changes for the https://github.com/spring-projects/spring-kafka/issues/154
Fixes: GH-115 (https://github.com/spring-projects/spring-integration-kafka/issues/115)
* Use the `MessagingMessageListenerAdapter` with its `MessageConverter` capabilities
directly from the `KafkaMessageDrivenChannelAdapter` instead of the custom headers logic.
* Remove redundant properties in favor of `MessageConverter` injection
* Provide parser and `KafkaMessageDrivenChannelAdapter` tests to ensure that `MessageConverter` injection works properly
* Remove unnecessary testing POJOs
Since the latest Spring Kafka introduces `RECEIVED_` headers on the receiving adapter,
we don't have clashes any more with the `kafka_topic`, `kafka_partition` headers on the producing adapter
Since we are in the `2.0` code line it is safe to just remove the `enableHeaderRouting` even if it is a breaking change.
Doc Polishing
JIRA: https://jira.spring.io/browse/INTEXT-220
Add `WindowingOffsetManagerTests`
Rework `WindowingOffsetManager` to be "resettable" on `flush()`.
* `flush()` `WindowingOffsetManager` on each `getOffset()`, `resetOffsets()` and `deleteOffset()`.
Exactly for the `RingBufferProcessor` processor completion to allow to have the access to "real" offset with those operations over `delegate`.
* Since Reactor's `Stream` isn't restartable create an new instance recursively from the `onComplete()`
JIRA: https://jira.spring.io/browse/INTEXT-216
Having the default value for the `NamedComponent` contract (`beanName`)
doesn't allow us to override (generate) the unique bean name for the component.
Clean up `KafkaProducerContext.beanName` to `null` by default.
**Cherry-pick to 1.3.x**
Fixes https://github.com/spring-projects/spring-integration-kafka/issues/70
* Refactor the message listener container to finish tasks on broker connection failure
and spawn new ones whenever a new broker is discovered;
* Add an explicit disconnect operation on the ConnectionFactory to release the connection
on failure;
* Other improvements and test refactorings;
Optimize the fetch logic
Add test for recognizing new brokers
Formatting
Formatting and refactoring
Test improvements, polishing
Prevent the KafkaMessageListenerContainer from blocking during shutdown
If the RingBufferProcessor used by the KafkaMessageListenerContainer blocks during
processing, it may be prevented from handling the onConsume() notfication which is
the shutdown indicator. Thus, the stopping of the component may be effectively
delayed.
To solve this, the processing task of the RingBufferProcessor is wrapped in a
cancelable task that is managed by one of the container components, and canceled
on shutdown, allowing for the interruption of the processing thread. Subsequently,
all messages cached by the ringbuffer are discarded, without being processed or
acknowdledged.
Additionally, an option for acknowledging processed messages on success only is
added. This allows the component to run continuously and advance even in the case
of sporadic errors, but to resume from the last successfully processed message.
Polishing
JIRA: https://jira.spring.io/browse/INTEXT-206
The previous logic in the `ConcurrentMessageListenerDispatcher` create exactly `consumers`
number of `QueueingMessageListenerInvoker`, although we use only the `partitions.size()`.
Fix the logic to the `this.consumers = Math.min(partitions.size(), consumers);` to create maximum
consumers according to the partitions count.