Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

When bootstrap.servers are not available, Thread Stuck on logger.warn #83

Open
piyush2409 opened this issue Apr 1, 2019 · 1 comment

Comments

@piyush2409
Copy link

piyush2409 commented Apr 1, 2019

<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
        <appender-ref ref="kafkaAppender" />
    </appender>

    <root level="INFO">
           <appender-ref ref="ASYNC" />
        <appender-ref ref="APPLICATION"/>

    </root>

   <dependency>
        <groupId>com.github.danielwegener</groupId>
        <artifactId>logback-kafka-appender</artifactId>
        <version>0.2.0-RC1</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka-clients</artifactId>
        <version>2.0.0</version>
    </dependency>


    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.2.3</version>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>1.2.3</version>
    </dependency>
mytopic
        <!-- Optional parameter to use a fixed partition -->
        <!-- <partition>0</partition> -->

        <!-- Optional parameter to include log timestamps into the kafka message -->x
        <!-- <appendTimestamp>true</appendTimestamp> -->

        <!-- each <producerConfig> translates to regular kafka-client config (format: key=value) -->
        <!-- producer configs are documented here: https://kafka.apache.org/documentation.html#newproducerconfigs -->
        <!-- bootstrap.servers is the only mandatory producerConfig -->
        <producerConfig>bootstrap.servers=wronghost:9092wronghost:9092,wronghost:9092</producerConfig>

        <producerConfig>compression.type=gzip</producerConfig>
        <producerConfig>retries=2</producerConfig>
        <!-- the maximum time to wait for the response of a sent message -->
        <producerConfig>request.timeout.ms=2500</producerConfig>
        <!-- the maximum time producer.send() and partitionsFor() will block waiting for acknowledgment -->
        <producerConfig>max.block.ms=10000</producerConfig>
        <!--The maximum amount of time in milliseconds to wait when reconnecting
        to a broker that has repeatedly failed to connect.
        If provided, the backoff per host will increase
        exponentially for each consecutive connection failure, up to this maximum.
        After calculating the backoff increase, 20% random jitter is added to avoid connection storms-->
        <producerConfig>reconnect.backoff.max.ms=1000</producerConfig>

        <producerConfig>max.block.ms=800</producerConfig>
        <producerConfig>metadata.fetch.timeout.ms=10</producerConfig>



        <!-- this is the fallback appender if kafka is not available. -->
       <!-- <appender-ref ref="FILE"/>
        <appender-ref ref="ERROR_FILE"/>
        <appender-ref ref="TRANSACTION_FILE"/>-->

        <appender-ref ref="APPLICATION"/>



    </appender>

Application is hung or stuck whenever its step on LOGGER.WARN statement.

@piyush2409
Copy link
Author

any updates

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant