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

Reconsider JpaOutboundGatewayFactoryBean proxying logic and introduce TransactionHandleMessageAdvice

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Complete
    • None
    • 5.0.M1
    • JPA Support

    Description

      The JpaOutboundGatewayFactoryBean has the code:

      if (!CollectionUtils.isEmpty(this.txAdviceChain)) {
      
      	ProxyFactory proxyFactory = new ProxyFactory(jpaOutboundGateway);
      	if (!CollectionUtils.isEmpty(this.txAdviceChain)) {
      		for (Advice advice : this.txAdviceChain) {
      			proxyFactory.addAdvice(advice);
      		}
      	}
      
      	return (MessageHandler) proxyFactory.getProxy(this.beanClassLoader);
      }
      

      According ConsumerEndpointFactoryBean logic:

      for (Advice advice : this.adviceChain) {
      	if (!replyMessageHandler || advice instanceof HandleMessageAdvice) {
      		NameMatchMethodPointcutAdvisor handlerAdvice = new NameMatchMethodPointcutAdvisor(advice);
      		handlerAdvice.addMethodName("handleMessage");
      ...
      

      We can refactor that code to the expected proxying logic based on the generic solution.
      But for that purpose we should consider to introduce TransactionHandleMessageAdvice, which let to wrap to the TX the entire sub-flow, not only handleRequestMessage like it is with the regular TransactionInterceptor.

      When we will have that Advice aboard already, we will be able to come up with the solution for the INT-3770.

      Any comments are welcome!

      Attachments

        Issue Links

          Activity

            People

              abilan Artem Bilan
              abilan Artem Bilan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: