Also remove test for bad partition in DSL tests - the send now gives an error
about the topic not being present in metadata instead of "not in range".
Use sync for publishing in DSL tests, to fail fast.
* GH-212: Add ConsumerSeekAware impl to Inbounds
Fixesspring-projects/spring-integration-kafka#212
**Cherry-pick to 3.0.x**
* GH-212: Add ConsumerSeekAware impl to Inbounds
Fixesspring-projects/spring-integration-kafka#212
* Introduce a new `IntegrationKafkaHeaders.CONSUMER_SEEK_CALLBACK`
header to be populated to messages for sending to the channel
* Populate that header from the `KafkaInboundGateway` and
`KafkaMessageDrivenChannelAdapter` into the message from the
`seekCallBack` property if `ListenerContainer` is single-threaded or
from the `ThreadLocal<ConsumerSeekAware.ConsumerSeekCallback>` otherwise;
and only if newly introduced `setAdditionalHeaders` is `true`
* Populate `seekCallBack` property or `ThreadLocal<?>` from the
`registerSeekCallback()` implementation from the internal listeners
* Add `setOnPartitionsAssignedSeekCallback(BiConsumer)` and
`setOnIdleSeekCallback(BiConsumer)` options to react for the appropriate
event from the underlying container and perform appropriate seek management
* Add new options to the DSL classes and cover them with tests, including
check for new `IntegrationKafkaHeaders.CONSUMER_SEEK_CALLBACK` header
**Cherry-pick to 3.0.x**
* Address PR comments: remove unnecessary API
* *Polishing `setOnPartitionsAssignedSeekCallback()` JavaDocs
*Close producers in the `KafkaProducerMessageHandlerTests`
Fixes https://github.com/spring-projects/spring-integration-kafka/issues/204
When an external container is provided to the DSL, register it as a bean
if it is not already a bean.
Polishing id from PR comments; add gateway support too.
* Polishing JavaDocs and omissions in the test-case
The debug log indicates that the reply was successfully sent but never
received. My working theory is that the reply consumer got the reply
during the `poll()` to force the subscription.
Start the consumers before the replies are sent.
I will also add code to `KafkaEmbedded` to seek to beginning all topics
if necessary.
* Remove volatile from running flag
As running is always accessed through `KafkaMessageSource` monitor use existing `synchronized` to guard access to it.
Also move setting `running=true` from consumerMonitor in `createConsumer()` method to `doReceive()` as it's guarded by needed lock
* Extract common stopping consumer logic
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`