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

TcpOutboundGateway annotation based configuration

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 4.1.2
    • Fix Version/s: 4.2 M1
    • Component/s: Documentation
    • Labels:

      Description

      The class `TcpOutboundGateway` is missing the attributes `request-channel` and `request-timeout`.

      For example, the following xml could not be translated to annotation based configuration:

          <int-ip:tcp-outbound-gateway id="outGateway"
              request-channel="input"
              reply-channel="clientBytes2StringChannel"
              connection-factory="client"
              request-timeout="5000"
              reply-timeout="5000"/>
      

      Annotation based as follows (partial):

      @MessageEndpoint
      public class MyEndpoint {
      	//TODO how to set "request-channel" and "request-timeout"?
      	@Bean
      	public TcpOutboundGateway outGateway(TcpConnectionFactoryFactoryBean factory,
      			@Qualifier("clientBytes2StringChannel") MessageChannel channel) throws Exception {
      		TcpOutboundGateway gate = new TcpOutboundGateway();
      		gate.setConnectionFactory(factory.getObject());
      		gate.setReplyChannel(channel);
      		gate.setRequestTimeout(5000);
      		return gate;
      	}
      
      	@Bean
      	public MessageChannel input() {
      		return new DirectChannel();
      	}
      }
      

      If it IS actually possible to convert the xml to proper annotation based config, please document this and comment accordingly. Actually it is not.

        Attachments

          Activity

            People

            Assignee:
            grussell Gary Russell
            Reporter:
            membersound member sound
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: