dapr / quickstarts

Dapr quickstart code samples and tutorials showcasing core Dapr capabilities
Apache License 2.0
1.02k stars 516 forks source link

Trying to integrate Mosquitto broker in Dapr example #1040

Open Soujanya459 opened 2 weeks ago

Soujanya459 commented 2 weeks ago

Hi I'm trying to integrate the Mosuitto broker in Dapr example instead of Redis.. I'm creating services in docker container. I have modified docker-compose.yml and mosquitto.cnf and components/pubsub.yml as below.. Why Dapr side-car is not starting for the service-checkout.. IT shows there is error while associating pubsub.yml file.. can you please let me know what does this below error mean? what can I modify ?

checkout-dapr-1 | time="2024-06-25T06:31:50.829991065Z" level=fatal msg="Fatal error from runtime: process component filetransferpubsub error: [INIT_COMPONENT_FAIL URE]: initialization error occurred for filetransferpubsub (pubsub.mqtt3/v1): init timeout for component filetransferpubsub (pubsub.mqtt/v1) exceeded after 5s" app_id=checkout-dapr instance=7bb69d830a3c scope=dapr.runtime type=log ver=edge

docker-compose.yml

checkout:
    build: ./checkout
    depends_on:
      - mqtt-broker
    networks:
      - hello-dapr
checkout-dapr:
    image: "daprio/daprd:edge"
    command: ["./daprd",
              "-app-id", "checkout-dapr",
              "-components-path", "/components"]
    volumes:
      - "./components/:/components"
    network_mode: "service:checkout"

mqtt-broker:
    image: "eclipse-mosquitto"
    ports:
      - "50007:50007"
    volumes:
      - "./mqtt/mosquitto.conf:/mosquitto/config/mosquitto.conf"
    networks:
      - hello-dapr

pubsub.yml

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: filetransferpubsub
spec:
  type: pubsub.mqtt
  version: v1
  metadata:
    - name: url
      value: "tcp://mqtt-broker:50007"
    - name: cleanSession
      value: "false"
    - name: consumerID
      value: "channel1"
    - name: qos
      value: "1"

mosquitto.conf

listener 50007
require_certificate false