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

HttpRequestExecutingMessageHandler should return AbstractIntegrationMessageBuilder, not a full Message<?>

    XMLWordPrintable

    Details

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

      Description

      Currently HttpRequestExecutingMessageHandler.handleRequestMessage() returns this:

      return replyBuilder.copyHeaders(headers).build();
      

      where in the supper class AbstractMessageProducingHandler.createOutputMessage() we have:

      if (output instanceof Message<?>) {
      	if (!this.shouldCopyRequestHeaders()) {
      		return (Message<?>) output;
      	}
      	builder = this.getMessageBuilderFactory().fromMessage((Message<?>) output);
      }
      else if (output instanceof AbstractIntegrationMessageBuilder) {
      	builder = (AbstractIntegrationMessageBuilder<?>) output;
      }
      

      and go to the first branch and rebuild a Message, when we could reuse a builder from the HttpRequestExecutingMessageHandler.handleRequestMessage().

      I mark this JIRA as 5.0, but for me it looks like pretty simple good fix even for 4.3.1.

      Can be backported on demand, though.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: