Creating a RabbitMQ Broker

    1. You have installed Knative Eventing.
    2. You have installed - easiest integration with RabbitMQ Messaging Topology Operator
    3. You have installed RabbitMQ Messaging Topology Operator - our recommendation is with CertManager
    4. You have access to a working RabbitMQ instance. You can create a RabbitMQ instance by using the RabbitMQ Cluster Kubernetes Operator. For more information see the .

    Install the RabbitMQ controller

    1. Install the RabbitMQ controller by running the command:

    2. Verify that and rabbitmq-broker-webhook are running:

      1. kubectl get deployments.apps -n knative-eventing

      Example output:

    1. Create a YAML file using the following template:

      1. apiVersion: eventing.knative.dev/v1alpha1
      2. kind: RabbitmqBrokerConfig
      3. name: <rabbitmq-broker-config-name>
      4. spec:
      5. rabbitmqClusterReference:
      6. # Configure name if a RabbitMQ Cluster Operator is being used.
      7. name: <cluster-name>
      8. # Configure connectionSecret if an external RabbitMQ cluster is being used.
      9. connectionSecret:
      10. name: rabbitmq-secret-credentials
      11. queueType: quorum
      • is the name you want for your RabbitMQBrokerConfig object.
      • is the name of the RabbitMQ cluster you created earlier.

      Note

      You cannot set and connectionSecret at the same time, since name is for a RabbitMQ Cluster Operator instance running in the same cluster as the Broker, and connectionSecret is for an external RabbitMQ server.

    2. Apply the YAML file by running the command:

      Where <filename> is the name of the file you created in the previous step.

    Create a RabbitMQBroker object

      1. apiVersion: eventing.knative.dev/v1
      2. kind: Broker
      3. metadata:
      4. eventing.knative.dev/broker.class: RabbitMQBroker
      5. name: <broker-name>
      6. spec:
      7. config:
      8. apiVersion: rabbitmq.com/v1beta1
      9. kind: RabbitmqBrokerConfig

      Where <rabbitmq-broker-config-name> is the name you gave your RabbitMQBrokerConfig in the step above.

    1. Apply the YAML file by running the command:

      Where <filename> is the name of the file you created in the previous step.

    By default, Triggers will consume messages one at a time to preserve ordering. If ordering of events isn’t important and higher performance is desired, you can configure this by using the parallelism annotation. Setting parallelism to n creates n workers for the Trigger that will all consume messages in parallel.

    1. apiVersion: eventing.knative.dev/v1
    2. kind: Trigger
    3. metadata:
    4. name: high-throughput-trigger
    5. annotations:
    6. rabbitmq.eventing.knative.dev/parallelism: "10"
    7. ...

    Additional information

    • For more samples visit the