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

Refactor MessageChannelTemplate and gateway classes

    Details

    • Type: Refactoring
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 2.0 M7
    • Component/s: None
    • Labels:
      None

      Description

      We might want to simplify the AbstractMessagingGateway to rely more upon the MessageChannelTemplate (and we might want to rename it to "MessagingGatewaySupport"?).

      To be consistent with other template (e.g. JMS), it would actually make sense to have the methods that accept Objects within the template (rather than requiring Messages), i.e. we could have the equivalent of "sendAndConvert" but delegating to MessageMapper implementations (inbound for send, outbound for receive) instead.

        Issue Links

          Activity

          Hide
          mark.fisher Mark Fisher added a comment -

          We should rename the template (big change, but this is 2.0 and therefore a good chance to get it right) to "MessagingTemplate". We should also create a "MessagingOperations" interface. The convertAndSend/receiveAndConvert methods should all be moved to the template. All of this will make it much more consistent with other Spring templates (such as JmsTemplate and AmqpTemplate).

          Show
          mark.fisher Mark Fisher added a comment - We should rename the template (big change, but this is 2.0 and therefore a good chance to get it right) to "MessagingTemplate". We should also create a "MessagingOperations" interface. The convertAndSend/receiveAndConvert methods should all be moved to the template. All of this will make it much more consistent with other Spring templates (such as JmsTemplate and AmqpTemplate).
          Hide
          mark.fisher Mark Fisher added a comment -

          Also (another big change), for the sake of consistency (see JMS Template) we should probably use: send(channel, message) as opposed to send(message, channel).

          Show
          mark.fisher Mark Fisher added a comment - Also (another big change), for the sake of consistency (see JMS Template) we should probably use: send(channel, message) as opposed to send(message, channel).
          Hide
          mark.fisher Mark Fisher added a comment -

          A major part of this has now been done (for M6), but there are a few things remaining:

          1) define a MessageOperations interface (in 'core') with all the send/receive methods of MessagingTemplate
          2) add ChannelResolver-awareness to MessagingTemplate and then add convertAndSend/receiveAndConvert methods
          3) Refactor "gateway" classes to use MessagingTemplate directly as necessary (potentially removing the AbstractMessagingGateway/SimpleMessagingGateway and instead providing just convenient template access in MessagingGatewaySupport)

          I will create sub-tasks for those.

          Show
          mark.fisher Mark Fisher added a comment - A major part of this has now been done (for M6), but there are a few things remaining: 1) define a MessageOperations interface (in 'core') with all the send/receive methods of MessagingTemplate 2) add ChannelResolver-awareness to MessagingTemplate and then add convertAndSend/receiveAndConvert methods 3) Refactor "gateway" classes to use MessagingTemplate directly as necessary (potentially removing the AbstractMessagingGateway/SimpleMessagingGateway and instead providing just convenient template access in MessagingGatewaySupport) I will create sub-tasks for those.

            People

            • Assignee:
              mark.fisher Mark Fisher
              Reporter:
              mark.fisher Mark Fisher
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: