当前位置: 首页 > 知识库问答 >
问题:

Spring cloud stream rabbitmq-set属性来自源代码

何涵衍
2023-03-14
                    //qName,    passive, durable, exclusive  auto-delete
channel.queueDeclare("myQueue", true,    false,   false,   , false       , null);

关于如何使用春云流实现同样的事情,有什么想法吗?

共有1个答案

令狐珂
2023-03-14

在“application.yml”中,您可以添加所有这些值,下面是示例

spring:
  cloud:
    stream:
      instance-count: 1
      bindings:
        input:
          consumer:
            concurrency: 2
            maxAttempts: 1
          group: geode-sink
          destination: jdbc-event-result
          binder: rabbit
      rabbit:
        bindings:
          input:
            consumer:
              autoBindDlq: true
              republishToDlq: true
              requeueRejected: false

rabbitmq:
    username: ur-user-name
    password: ur-password
    host: rabbitmq-url-replace-here
    port: 5672
datasource:
  platform: mysql
  url: jdbc:mysql-url-replace-here
  username: ur-user-name
  password: ur-password
  driverClassName: com.mysql.jdbc.Driver

  datasource:
    tomcat:
      max-wait:  300
      min-idle: 10
      max-idle: 100

aggregator:
  groupCount: 2
  batchSize: 1000
  batchTimeout: 1000

更新:

>

  • https://cloud.spring.io/spring-cloud-static/spring-cloud-stream-binder-rabbit/2.2.0.m1/spring-cloud-stream-binder-rabbit.html

  •  类似资料:
    • 下面的示例将展示使用方法设置dom元素的属性,批量更新以及在将HTML String解析为Document对象后添加/删除类方法。 语法 (Syntax) Document document = Jsoup.parse(html); Element link = document.select("a").first(); link.attr("href","www.yahoo.c

    • 配置类-根据活动配置文件创建bean: 这个很管用。但是,当我删除application.yml并通过Spring Cloud Config-with Git repository使用外部配置时,这就不起作用了。活动配置文件仅为prod,不包括“enable_tls”和“enable_mongo_ssl”,因此在bean创建时,语句: 不再是真的了。 我当前的解决方案是将所有属性都外部化在配置服务

    • 出于某种原因,我使用外部属性源,其中一个外部属性源没有自动连接,在创建身份验证bean时接收空指针 原因: org.springframework.beans.BeanInstantiationException: Failed to instanceiate [com.filechecker.check.Authenticator]: Constructor threw exception;ne

    • 问题内容: 我正在做一个猜谜游戏的AI部分。我希望AI从此列表中选择一个随机字母。我将其设置为一组,这样我就可以轻松地从列表中删除字母,因为它们在游戏中会被猜测出来,因此不再可供再次猜测。 它说对象不可索引。我该如何解决? 问题答案: 注意(2020年10月): 从v3.9开始,Python正式弃用 了集合,官方指导是在传入之前将集合显式转换为列表或元组。 文档:https : //docs.py

    • 我有豆子,例如 服务(特定服务)是使用抽象方法初始化()扩展抽象类MyService并使用方法特定的Logic()实现接口MyInterface的类。 因此,管理器在服务对象上调用方法init(),如下所示: 但当bean初始化时,我有以下问题: 无法转换“java.util”类型的属性值。将LinkedHashSet设置为所需类型“java.util”。设置“for property”“serv

    • 问题内容: 我究竟做错了什么?我无法获得子属性内标签的值。这是我的xml: 这是我在节点中所做的: 我确定那是一个语法问题,但我看不到它!它有可能获得两个孩子的名字,例如标题和文本? 问候 问题答案: 使用的语法允许您浏览JSON对象的节点。但是似乎您正在尝试搜索将其视为XPath谓词。它不会工作。 使用xml2js可以使用以下代码在代码中获取对象数组: 然后,循环比较该值,这就是达到属性的方式。