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

Currently difficult to add a transactionManager to Jms.messageDrivenChannelAdapter using the DSL

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 5.0 M7
    • Component/s: JMS Support
    • Labels:

      Description

      Currently using a TransactionManager with a Jms MessageDrivenChannelAdapter is rather clunky. It seems to require using DefaultMessageListenerContainer via Jms.container() and creating the channel adapter with said container. i.e.

      		DefaultMessageListenerContainer myContainer = Jms.container(myJmsConnectionFactory, "myQueue").transactionManager(myTransactionManager).get();
      		
      		return IntegrationFlows.from(Jms.messageDrivenChannelAdapter(myContainer))...
      

      What would be ideal (as suggested by Gary Russell) would be

      return IntegrationFlows.from(Jms.messageDrivenChannelAdapter(connectionFactory)
                      .configureListenerContainer(c -> c.transactionManager(tm()))
                      ...
                      .get();
      

        Attachments

          Activity

            People

            Assignee:
            abilan Artem Bilan
            Reporter:
            chrisumbel Christopher Umbel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: