I have rabbitMQ running on http://xyzip:5672 and credentials sampleusername, samplepassword, created the rabbitMQ component yaml file created.
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: componentName
namespace: samplenamespace
spec:
type: pubsub.rabbitmq
version: v1
metadata:
- name: connectionString
value: "amqp://xyzip:5672"
- name: protocol
value: amqp
- name: hostname
value: 10.22.39.162
- name: username
value: sampleusername
- name: password
value: samplepassword
- name: consumerID
value: pubsub-subscriber
- name: durable
value: false
- name: deletedWhenUnused
value: false
- name: autoAck
value: false
- name: deliveryMode
value: 0
- name: requeueInFailure
value: false
- name: prefetchCount
value: 0
- name: reconnectWait
value: 0
- name: concurrencyMode
value: parallel
- name: publisherConfirm
value: false
- name: enableDeadLetter # Optional enable dead Letter or not
value: true
- name: maxLen # Optional max message count in a queue
value: 3000
- name: maxLenBytes # Optional maximum length in bytes of a queue.
value: 10485760
- name: exchangeKind
value: fanout
- name: saslExternal
value: false
- name: ttlInSeconds
value: 60
- name: clientName
value: pubsub-subscriber
- name: heartBeat
value: 10s
The dapr service sidecar is giving below error.
Fatal error from runtime: process component dapr-pubsub error: [INIT_COMPONENT_FAILURE]: initialization error occurred for dapr-pubsub (pubsub.rabbitmq/v1): init timeout for component dapr-pubsub (pubsub.rabbitmq/v1) exceeded after 5s
In-order to configure rabbitMQ on AKS, kindly follow below steps- Here I will be using bitnami charts for rabbitMQ for the setup.
Run
helm listcommand to verify if any charts already present. If not, you will search for the rabbitmq repo usinghelm search repo rabbitmq, add the repo usinghelm repo add bitnami https://charts.bitnami.com/bitnami, update the repo to keep things upto-date usinghelm repo updateand verify your rabbitMQ details usinghelm show values bitnami/rabbitmqNow install the rabbitMQ using

helm install my-release bitnami/rabbitmq.Once installed, you will get your login credentials on your screen. Save them and map your ports as shown above using
kubectl port-forward --namespace default svc/my-release-rabbitmq 15672:15672Once the port is mapped, you should see something like this-Now go to your browser and type
localhost:15672and you are on the login page of rabbitMQIn order to install dapr on your AKS Follow the below steps- Here I am using helm charts instead of dapr CLI and I will be installing version 1.12.
Once the repo is downloaded, verify the available version using
Install dapr with your preferred version.
Now if you check, dapr is installed
and pods are active
When encountering a
Fatal error from runtimeindicating an initialization timeout for a Dapr component, it's important to narrow down the issue systematically. Below are the steps to diagnose and potentially resolve the problem with your Dapr RabbitMQ pub/sub component: Start by ensuring that your RabbitMQ instance is running and reachable from your AKS cluster:If the connection fails, your RabbitMQ instance might not be accessible from within the cluster, or the service address/port might be incorrect. Next, check the logs of the Dapr sidecar container for more detailed error messages:
Also ensure there are no AKS network policies or Azure Network Security Groups blocking communication between the Dapr sidecar and RabbitMQ:
Reference documents- MS Doc Dapr Doc Rabbitmq Doc