You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@RestController
classUserController {
@Autowired
privatelateinitvar kafka:KafkaTemplate<String, String>
@Transactional
@RequestMapping(value = ["/user"], method = [RequestMethod.POST])
funuser(@RequestBody user:String): String {
kafka.send("user_updated", user)
println("Hit enter to continue")
readLine();
return user
}
}
I stopped the broker, hit enter, and restarted the broker.
After that, all subsequent POSTs got
{"timestamp":"2018-04-23T16:47:10.101+0000","status":500,"error":"Internal Server Error","message":"Could not create Kafka transaction; nested exception is org.apache.kafka.common.KafkaException: TransactionalId txId0: Invalid transition attempted from state IN_TRANSACTION to state IN_TRANSACTION","path":"/user"}