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`
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