如何将本机事件处理连接到RabbitMQ外部源

sg24os4d  于 2022-11-08  发布在  RabbitMQ
关注(0)|答案(3)|浏览(175)

我尝试将Knative与Kubernetes集群外部的现有RabbitMQ队列连接,但在测试和查看文档后,我不确定是否可以做到这一点,有人知道如何将Knative-eventing与作为消息源的外部RabbitMQ一起使用吗?
问候!

6fe3ivhb

6fe3ivhb1#

嘿,@Juan,你对我们的文档的看法是完全正确的,在这里,我将在审查和合并文档时留下一个PR修复部分,并提供一个关于使用外部RabbitMQ示例的清晰示例:https://github.com/knative-sandbox/eventing-rabbitmq/pull/786/files#diff-4fdb9e4eb3a1c9da58e4445d94aa5ce4573b5c8d005f20c41c767b07c09a2418
希望这对你有帮助=),谢谢你的反馈!如果你发现有什么不对的,你可以在PR上评论或者在这里留下回复!

kyvafyod

kyvafyod2#

如Knative Eventing源代码目录中所列,有一个RabbitMQ源代码正在由社区(主要来自VMware和RabbitMQ团队的贡献者)开发和维护。
文档和安装说明均为here;如果有错误,请在相关的存储库中报告。

mitkmikd

mitkmikd3#

谢谢你@sameer的回答,我想我没有正确理解你的意思。
访问完你给我的链接后,我就发起了:
kubectl apply --filename https://github.com/knative-sandbox/eventing-rabbitmq/releases/latest/download/rabbitmq-source.yaml
安装rabbitmq源代码并生成secret:
kubectl create secret generic rabbitmqc-default-user -n knative-eventing --from-literal=user=root --from-file=password=/tmp/password
以及以下资源:

apiVersion: sources.knative.dev/v1alpha1
kind: RabbitmqSource
metadata:
  name: rabbitmq-source
  namespace: knative-eventing
spec:
  broker: "host.external.dns:5671/"
  connectionSecret:
    name: "rabbitmqc-default-user"
  user:
    secretKeyRef:
      name: "rabbitmqc-default-user"
      key: "username"
  password:
    secretKeyRef:
      name: "rabbitmqc-default-user"
      key: "password"
  exchangeConfig:
    name: "logs"
    type: "fanout"
    durable: true
    autoDelete: false
  queueConfig:
    name: "test"
    routingKey: ""
    durable: false
    autoDelete: false
  channelConfig:
    parallelism: 10
  sink:
    ref:
      apiVersion: v1
      kind: Service
      name: recorder

但在生成资源后,我得到以下错误:
原生源/rabbitmq控制器管理器

│ W0524 11:45:04.108665       1 reflector.go:324] k8s.io/client-go@v0.23.5/tools/cache/reflector.go:167: failed to list *v1beta1.Binding: the server could not find the requested resource (get bindings.rabbitmq.com)                                                                   │
│ E0524 11:45:04.108718       1 reflector.go:138] k8s.io/client-go@v0.23.5/tools/cache/reflector.go:167: Failed to watch *v1beta1.Binding: failed to list *v1beta1.Binding: the server could not find the requested resource (get bindings.rabbitmq.com)                                 │
│ W0524 11:45:04.109915       1 reflector.go:324] k8s.io/client-go@v0.23.5/tools/cache/reflector.go:167: failed to list *v1beta1.Queue: the server could not find the requested resource (get queues.rabbitmq.com)                                                                       │
│ E0524 11:45:04.109935       1 reflector.go:138] k8s.io/client-go@v0.23.5/tools/cache/reflector.go:167: Failed to watch *v1beta1.Queue: failed to list *v1beta1.Queue: the server could not find the requested resource (get queues.rabbitmq.com)                                       │
│ W0524 11:45:04.109976       1 reflector.go:324] k8s.io/client-go@v0.23.5/tools/cache/reflector.go:167: failed to list *v1beta1.Exchange: the server could not find the requested resource (get exchanges.rabbitmq.com)                                                                 │
│ E0524 11:45:04.109985       1 reflector.go:138] k8s.io/client-go@v0.23.5/tools/cache/reflector.go:167: Failed to watch *v1beta1.Exchange: failed to list *v1beta1.Exchange: the server could not find the requested resource (get exchanges.rabbitmq.com)                              │
│ W0524 11:45:05.253806       1 reflector.go:324] k8s.io/client-go@v0.23.5/tools/cache/reflector.go:167: failed to list *v1beta1.Exchange: the server could not find the requested resource (get exchanges.rabbitmq.com)                                                                 │
│ E0524 11:45:05.254035       1 reflector.go:138] k8s.io/client-go@v0.23.5/tools/cache/reflector.go:167: Failed to watch *v1beta1.Exchange: failed to list *v1beta1.Exchange: the server could not find the requested resource (get exchanges.rabbitmq.com)                              │
│ W0524 11:45:05.443628       1 reflector.go:324] k8s.io/client-go@v0.23.5/tools/cache/reflector.go:167: failed to list *v1beta1.Queue: the server could not find the requested resource (get queues.rabbitmq.com)

事实是,我已经搜索了又搜索,我还没有找到关于如何将它连接到外部RabbitMQ到Kubernetes的信息,也许我没有很好地理解文档。

相关问题