Skip to content

Detect that a send() operation is being performed when no transaction exists #646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
garyrussell opened this issue Apr 13, 2018 · 0 comments · Fixed by #647
Closed

Detect that a send() operation is being performed when no transaction exists #646

garyrussell opened this issue Apr 13, 2018 · 0 comments · Fixed by #647
Assignees
Milestone

Comments

@garyrussell
Copy link
Contributor

It causes an uncommitted transactional producer to be returned to the cache.

See #645

@garyrussell garyrussell added this to the 2.1.6 milestone Apr 13, 2018
@garyrussell garyrussell self-assigned this Apr 13, 2018
garyrussell added a commit to garyrussell/spring-kafka that referenced this issue Apr 13, 2018
Resolves spring-projects#646

- add protection to the transactional producer cache to avoid multiple cache inserts
- detect (and reject) an illegal call to `template.send()` when there is no existing transaction
- from the send callback remove the `ThreadLocal` check (will always be null) and only close the producer if it's not transactional
- remove autoFlush from template tests
garyrussell added a commit to garyrussell/spring-kafka that referenced this issue Apr 13, 2018
Resolves spring-projects#646

- add protection to the transactional producer cache to avoid multiple cache inserts
- detect (and reject) an illegal call to `template.send()` when there is no existing transaction
- from the send callback remove the `ThreadLocal` check (will always be null) and only close the producer if it's not transactional
- remove autoFlush from template tests
- add try/catch around `abortTransaction()`
garyrussell added a commit to garyrussell/spring-kafka that referenced this issue Apr 13, 2018
Resolves spring-projects#646

- add protection to the transactional producer cache to avoid multiple cache inserts
- add try/catch around `abortTransaction()`
- detect (and reject) an illegal call to `template.send()` when there is no existing transaction
- from the send callback remove the `ThreadLocal` check (will always be null) and only close the producer if it's not transactional
- remove autoFlush from template tests
artembilan pushed a commit that referenced this issue Apr 13, 2018
Resolves #646

- add protection to the transactional producer cache to avoid multiple cache inserts
- add try/catch around `abortTransaction()`
- detect (and reject) an illegal call to `template.send()` when there is no existing transaction
- from the send callback remove the `ThreadLocal` check (will always be null) and only close the producer if it's not transactional
- remove autoFlush from template tests
artembilan pushed a commit that referenced this issue Apr 13, 2018
Resolves #646

- add protection to the transactional producer cache to avoid multiple cache inserts
- add try/catch around `abortTransaction()`
- detect (and reject) an illegal call to `template.send()` when there is no existing transaction
- from the send callback remove the `ThreadLocal` check (will always be null) and only close the producer if it's not transactional
- remove autoFlush from template tests
artembilan pushed a commit that referenced this issue Apr 13, 2018
Resolves #646

- add protection to the transactional producer cache to avoid multiple cache inserts
- add try/catch around `abortTransaction()`
- detect (and reject) an illegal call to `template.send()` when there is no existing transaction
- from the send callback remove the `ThreadLocal` check (will always be null) and only close the producer if it's not transactional
- remove autoFlush from template tests

# Conflicts:
#	spring-kafka/src/test/java/org/springframework/kafka/core/KafkaTemplateTransactionTests.java
artembilan pushed a commit that referenced this issue Apr 13, 2018
Resolves #646

- add protection to the transactional producer cache to avoid multiple cache inserts
- add try/catch around `abortTransaction()`
- detect (and reject) an illegal call to `template.send()` when there is no existing transaction
- from the send callback remove the `ThreadLocal` check (will always be null) and only close the producer if it's not transactional
- remove autoFlush from template tests

# Conflicts:
#	spring-kafka/src/test/java/org/springframework/kafka/core/KafkaTemplateTransactionTests.java

# Conflicts:
#	spring-kafka/src/main/java/org/springframework/kafka/core/DefaultKafkaProducerFactory.java
#	spring-kafka/src/test/java/org/springframework/kafka/core/KafkaAdminBadContextTests.java
#	spring-kafka/src/test/java/org/springframework/kafka/core/KafkaTemplateTransactionTests.java
garyrussell added a commit to garyrussell/spring-kafka that referenced this issue Apr 13, 2018
denis554 added a commit to denis554/spring-kafka that referenced this issue Mar 27, 2019
Resolves spring-projects/spring-kafka#646

- add protection to the transactional producer cache to avoid multiple cache inserts
- add try/catch around `abortTransaction()`
- detect (and reject) an illegal call to `template.send()` when there is no existing transaction
- from the send callback remove the `ThreadLocal` check (will always be null) and only close the producer if it's not transactional
- remove autoFlush from template tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant