You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Jason Gustafson (JIRA)" <ji...@apache.org> on 2018/02/26 16:44:00 UTC
[jira] [Resolved] (KAFKA-6153) Kafka Transactional Messaging does
not work on windows but on linux
[ https://issues.apache.org/jira/browse/KAFKA-6153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jason Gustafson resolved KAFKA-6153.
------------------------------------
Resolution: Duplicate
Seems like the same underlying issue as KAFKA-6052. Marking as dup for now, but we can reopen if we find reason to think it's different.
> Kafka Transactional Messaging does not work on windows but on linux
> -------------------------------------------------------------------
>
> Key: KAFKA-6153
> URL: https://issues.apache.org/jira/browse/KAFKA-6153
> Project: Kafka
> Issue Type: Bug
> Components: consumer, producer
> Affects Versions: 0.11.0.1
> Reporter: Changhai Han
> Priority: Critical
> Labels: windows
> Attachments: TransactionalProducer_Notworking.txt
>
>
> As mentioned in title, the kafka transaction messaging does not work on windows but on linux.
> The code is like below:
> {code:java}
> stringProducer.initTransactions();
> while(true){
> ConsumerRecords<String, String> records = stringConsumer.poll(2000);
> if(!records.isEmpty()){
> stringProducer.beginTransaction();
> try{
> for(ConsumerRecord record : records){
> LOGGER.info(record.value().toString());
> stringProducer.send(new ProducerRecord<String, String>("kafka-test-out", record.value().toString()));
> }
> stringProducer.commitTransaction();
> }catch (ProducerFencedException e){
> LOGGER.warn(e.getMessage());
> stringProducer.close();
> stringConsumer.close();
> }catch (KafkaException e){
> LOGGER.warn(e.getMessage());
> stringProducer.abortTransaction();
> }
> }
> }
> {code}
> When I debug it, it seems to it stuck on committing the transaction. Does anyone also experience the same thing? Is there any specific configs that i need to add in the producer config? Thanks.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)