Skip to content

Latest commit

 

History

History
207 lines (177 loc) · 8.85 KB

File metadata and controls

207 lines (177 loc) · 8.85 KB
description
This page contains the technical details of the RabbitMQ endpoint plugin

RabbitMQ

{% hint style="warning" %} This feature requires Gravitee's Enterprise Edition. {% endhint %}

Overview

Use this endpoint to publish and/or subscribe messages to a RabbitMQ broker.

Quality of Service

QoSDeliveryDescription
NoneUnwarrantedMessages are acked automatically
Auto1,0 or nMessages are acked by entrypoint if supported

Compatibility matrix

Plugin version APIM version
1.x 4.x

Endpoint identifier

To use this plugin, declare the following rabbitmq identifier while configuring your API endpoints.

Endpoint configuration

General configuration

AttributesDefaultMandatoryDescription
serverHostN/AYesDefine the host of the RabbitMQ
serverPortN/AYesDefine the port of the RabbitMQ

Shared Configuration

Security configuration

AttributesDefaultMandatoryDescription
auth.usernameN/AYesDefine the user to authenticate to RabbitMQ
auth.passwordN/AYesDefine the password to authenticate to RabbitMQ
ssl.hostnameVerifierYesNoEnable host name verification
ssl.truststore.typeNONENoThe type of truststore (NONE, JKS, PKCS12, PEM). Use NONE if you don’t need to define a truststore.
ssl.truststore.pathN/ANoThe location of the truststore file in the Gateway filesystem
ssl.truststore.contentN/ANoThe base64 encoded content of the truststore file (or the actual certificates if the truststore type is PEM)
ssl.truststore.passwordN/ANoThe password to decrypt the truststore
ssl.keystore.typeNONENoThe type of keystore (NONE, JKS, PKCS12, PEM). Use NONE if you don’t need to define a keystore.
ssl.keystore.pathN/ANoThe location of the keystore file in the Gateway filesystem
ssl.keystore.contentN/ANoThe base64 encoded content of the keystore file (or the actual certificates if the keystore type is PEM)
ssl.keystore.passwordN/ANoThe password to decrypt the keystore
ssl.keystore.certPathN/ANoThe path to cert file (.PEM) in the Gateway filesystem. Only relevant if the keystore type is PEM.
ssl.keystore.certContentN/ANoThe certificate PEM content. Only relevant if the keystore type is PEM.
ssl.keystore.keyPathN/ANoThe path to private key file (.PEM) in the Gateway filesystem. Only relevant if the keystore type is PEM.
ssl.keystore.keyContentN/ANoThe private key PEM content. Only relevant if the keystore type is PEM.

Producer configuration

AttributesDefaultMandatoryDescription
enabledfalseNoEnable or disable the producer capability
routingKeyYesThe routing key used to route messages to queues
exchange.nameYesThe exchange name
exchange.typeYesThe exchange type
exchange.durableYesThe exchange durable flag
exchange.autoDeleteYesThe exchange autoDelete flag

Consumer configuration

AttributesDefaultMandatoryDescription
enabledfalseNoEnable or disable the consumer capability
routingKeyYesThe routing key used to route messages to queues
exchange.nameYesThe exchange name
exchange.typeYesThe exchange type
exchange.durableYesThe exchange durable flag
exchange.autoDeleteYesThe exchange autoDelete flag

Examples

Produce messages

{
  "name": "default",
  "type": "rabbitmq",
  "weight": 1,
  "inheritConfiguration": false,
  "configuration": {
    "serverHost": "server-host",
    "serverPort": 5672
  },
  "sharedConfigurationOverride": {
    "security": {
      "auth": {
        "username": "user",
        "password": "bitnami"
      }
    },
    "producer": {
      "enabled": true,
      "routingKey": "a.routing.key",
      "exchange": {
        "name": "an-exchange",
        "type": "topic",
        "durable": true,
        "autoDelete": false
      }
    }
  }
}

Consume messages

{
  "name": "default",
  "type": "rabbitmq",
  "weight": 1,
  "inheritConfiguration": false,
  "configuration": {
    "serverHost": "server-host",
    "serverPort": 5672
  },
  "sharedConfigurationOverride": {
    "security": {
      "auth": {
        "username": "user",
        "password": "bitnami"
      }
    },
    "consumer": {
      "enabled": true,
      "routingKey": "a.routing.key",
      "exchange": {
        "name": "an-exchange",
        "type": "topic",
        "durable": true,
        "autoDelete": false
      }
    }
  }
}

TLS configuration with file

{
  "name": "default",
  "type": "rabbitmq",
  "weight": 1,
  "inheritConfiguration": false,
  "configuration": {
    "serverHost": "server-host",
    "serverPort": 5672
  },
  "sharedConfigurationOverride": {
    "security": {
      "auth": {
        "username": "user",
        "password": "bitnami"
      },
      "ssl": {
        "hostnameVerifier": true,
        "trustStore": {
            "type": "PKCS12",
            "path": "/opt/graviteeio-gateway/config/ssl/client.truststore.p12",
            "password": "my-secured-password"
        }
      }
    },
    "producer": {
      "enabled": true,
      "routingKey": "a.routing.key",
      "exchange": {
        "name": "an-exchange",
        "type": "topic",
        "durable": true,
        "autoDelete": false
      }
    }
  }
}

mTLS configuration with file

{
  "name": "default",
  "type": "rabbitmq",
  "weight": 1,
  "inheritConfiguration": false,
  "configuration": {
    "serverHost": "server-host",
    "serverPort": 5672
  },
  "sharedConfigurationOverride": {
    "security": {
      "auth": {
        "username": "user",
        "password": "bitnami"
      },
      "ssl": {
        "hostnameVerifier": true,
        "trustStore": {
            "type": "PKCS12",
            "path": "/opt/graviteeio-gateway/config/ssl/client.truststore.p12",
            "password": "my-secured-password"
        },
        "keyStore": {
            "type": "PKCS12",
            "path": "/opt/graviteeio-gateway/config/ssl/client.keystore.p12",
            "password": "my-secured-password"
        }
      }
    },
    "producer": {
      "enabled": true,
      "routingKey": "a.routing.key",
      "exchange": {
        "name": "an-exchange",
        "type": "topic",
        "durable": true,
        "autoDelete": false
      }
    }
  }
}