Results 1 to 4 of 4

Thread: customized tcp-connection-factory

  1. #1

    Default customized tcp-connection-factory

    Hello,
    I'm curious if is it possible to customize a tcp connection factory.
    Say, I would like to extend
    Code:
    TcpNetServerConnectionFactory
    . How can I do that? I mean by configuration file.

    For example,
    Code:
        <int-ip:tcp-connection-factory id="testServer"
                                       type="server"
                                       port="10011"
                                       task-executor="exec" single-use="true"
                                       interceptor-factory-chain=""
                />
    Here is not a mention about type of connection factory. What should I do to nail a problem?

    Thanks in advance,
    Oleg

  2. #2
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    646

    Default

    Hi!

    Here is not a mention about type of connection factory
    What do you mean? To tell to <int-ip:tcp-connection-factory> tag to use your TcpNetServerConnectionFactory subclass?
    What is a problem to configure it as regular bean:
    HTML Code:
    <bean id="serverConnectionFactory" class="com.my.proj.tcp.MyTcpNetServerConnectionFactory"
             c:port="10011" p:singleUse="true" />
    Any Spring custom tags provide in the end some specific beans of some built-in types. And in many cases they provide not only one bean... That's why similar tags don't allow to customize a general contract between tag and provided beans. But you always can configure them all as <bean ...> and you may end up with the same behaviour. E.g. configure Spring Security with regular beans very difficult.
    So be carefull to provide some customization of existing stategies.

    From other side: is there really a reason to extend TcpNetServerConnectionFactory ?

    Take care,
    Artem

  3. #3

    Default

    Thanks Artem!

    To be honest, I'm not sure if I have to extend it.
    I would like to get notifications about: socket opened/closed, listening on port #... . In addition to be able to disconnect & reconnect by specific criteria. May be there are other ways to do so.

    KR,
    Oleg

  4. #4
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    646

    Default

    socket opened/closed, listening on port
    Yes it is here now: http://static.springsource.org/sprin...3.0-tcp-events
    And this upcoming Pull Request: https://github.com/SpringSource/spri...2/files#diff-8

    There is no so much changes in the 3.0 yet, so, you won't have a lot problem to upgrade your application to Spring Integration 3.0.M1

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •