3

I am using DAPR , Docker in my .net core microservice. I have made following configuration in docker-compose.yml to run broker and dapr pubsub configuration.

PUBSUB.yml

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: pubsub
  namespace: default
spec:
  type: pubsub.kafka
  version: v1
  metadata:
      # Kafka broker connection setting
    - name: brokers
      value: local:9092
    - name: authRequired
      value: "false"
    - name: maxMessageBytes
      value: 1024

and Dockercompose.yml

  zookeeper:
     image: confluentinc/cp-zookeeper:6.1.1
     ports:
      - "2181:2181"
     environment:
      ZOOKEEPER_CLIENT_PORT: 2181
  broker:
    image: confluentinc/cp-kafka:6.1.1
    hostname: broker
    container_name: broker
    depends_on:
      - zookeeper
    ports:
      - "29092:29092"
      - "9092:9092"
      - "9101:9101"
      - "9090:9090"
    environment:
      KAFKA_BROKER_ID: 1
      KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:29092,PLAINTEXT_HOST://localhost:9092
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
      KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
      KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
      KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
      KAFKA_JMX_PORT: 9101
      KAFKA_JMX_HOSTNAME: localhost

My dapr car is not getting initialize in local environment , its throwing error as follows

image

error :


time="2021-04-12T07:05:26.9278616Z" level=info msg="starting Dapr Runtime -- version 1.0.0 -- commit 6314733" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.runtime type=log ver=1.0.0

time="2021-04-12T07:05:26.9282174Z" level=info msg="log level set to: info" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.runtime type=log ver=1.0.0

time="2021-04-12T07:05:26.9317538Z" level=info msg="metrics server started on :9090/" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.metrics type=log ver=1.0.0

time="2021-04-12T07:05:26.9339347Z" level=info msg="loading default configuration" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.runtime type=log ver=1.0.0

time="2021-04-12T07:05:26.9349457Z" level=info msg="standalone mode configured" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.runtime type=log ver=1.0.0

time="2021-04-12T07:05:26.9350359Z" level=info msg="app id: monitoringapi" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.runtime type=log ver=1.0.0

time="2021-04-12T07:05:26.9354469Z" level=info msg="mTLS is disabled. Skipping certificate request and tls validation" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.runtime type=log ver=1.0.0

time="2021-04-12T07:05:26.9384313Z" level=info msg="local service entry announced: monitoringapi -> 172.28.0.11:37301" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.contrib type=log ver=1.0.0

time="2021-04-12T07:05:26.9385462Z" level=info msg="Initialized name resolution to standalone" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.runtime type=log ver=1.0.0

time="2021-04-12T07:05:32.3047616Z" level=fatal msg="process component pubsub error: init timeout for component pubsub exceeded after 5s" app_id=monitoringapi instance=43a8c7996e98 scope=dapr.runtime type=log ver=1.0.0

Please help me to resolve this issue

kishan Thakar
  • 101
  • 1
  • 6
  • Hi mate, I am having the same problem. Has this been resolved? Thanks. – Rich Apr 23 '21 at 12:25
  • The title of the question says nothing about what is happening. Change it so that you have more chances of receiving an answer. It needs to be more intuitive. – Jackson Mourão May 14 '21 at 15:54

1 Answers1

0

This is resolved following simple config has resolved this enter image description here

kishan Thakar
  • 101
  • 1
  • 6