quickstarts
quickstarts copied to clipboard
Trying to integrate Mosquitto broker in Dapr example
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