Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-3680

Cannot conditionally configure a durable subscription with Spring JMS 4.1

    XMLWordPrintable

    Details

      Description

      The setter for AbstractMessageListenerContainer#setDurableSubscriptionName was modified to also mark the message listener as durable.

      	public void setDurableSubscriptionName(String durableSubscriptionName) {
      		this.subscriptionName = durableSubscriptionName;
      		this.subscriptionDurable = true;
      	}
      

      This has unintended side effects when configuring a message listener via spring-integration.

      <int-jms:message-driven-channel-adapter ...
      		subscription-durable="${subscription.durable}" durable-subscription-name="subscriptionName"  ... />
      

      The adapter will first invoke the #setSubscriptionDurable method and then #setDurableSubscriptionName. The second setter will override whatever value was previously configured.

      This makes it impossible to configure the connection in spring 4.1.

      There appears to be an alternative setter #setSubscriptionName that doesn't have the above sideeffect, but this setter is inaccessible when using the spring integration tag library.

        Attachments

          Activity

            People

            Assignee:
            grussell Gary Russell
            Reporter:
            phaas Patrick Haas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: