【问题标题】:ActivationConfigProperty with configurable clientId具有可配置 clientId 的 ActivationConfigProperty
【发布时间】:2018-09-16 01:57:34
【问题描述】:

使用 liberty 18.0.0.1 和这样的 MDB:

@MessageDriven(
        activationConfig = { 
                @ActivationConfigProperty(propertyName = "destination", propertyValue = "distributedACLCache"), 
                @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
                @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),
                @ActivationConfigProperty(propertyName = "subscriptionName", propertyValue = "distributedACLCache"),
                @ActivationConfigProperty(propertyName = "clientId", propertyValue = "cli-id-01")

在这种情况下,clientId 是静态的,但是如果我想在具有不同 clientId 的多个实例中部署此 MDB,这似乎是不可能的?

有没有办法从当前运行时的环境变量或属性中注入 clientId ?

/bwa

【问题讨论】:

    标签: jms ejb websphere-liberty jms-topic


    【解决方案1】:

    您可以使用 xml (ejb-jar.xml) 配置所有这些值,这样您就可以更改每个部署的配置。我认为您还可以混合使用 MDB 的注释和 xml 配置。

    https://docs.oracle.com/cd/E24329_01/web.1211/e24977/annotations.htm#WLMDB10006

    【讨论】:

      猜你喜欢
      • 2013-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-31
      • 2018-07-08
      • 2019-01-07
      相关资源
      最近更新 更多