Example usage for org.springframework.integration.ip.tcp.connection TcpNioClientConnectionFactory setSerializer

List of usage examples for org.springframework.integration.ip.tcp.connection TcpNioClientConnectionFactory setSerializer

Introduction

In this page you can find the example usage for org.springframework.integration.ip.tcp.connection TcpNioClientConnectionFactory setSerializer.

Prototype

public void setSerializer(Serializer<?> serializer) 

Source Link

Usage

From source file:com.acmemotors.Main.java

@Bean
public TcpNioClientConnectionFactory connectionFactory(@Value("${dongleHost:192.168.0.10}") String dongleHost,
        @Value("${donglePort:35000}") int donglePort) {
    TcpNioClientConnectionFactory factory;

    factory = new TcpNioClientConnectionFactory(dongleHost, donglePort);

    OBD2Serializer odb2Serializer = new OBD2Serializer();
    factory.setSerializer(odb2Serializer);
    factory.setDeserializer(odb2Serializer);
    factory.setSingleUse(false);/*w  w  w.jav a  2s  . com*/
    factory.afterPropertiesSet();

    return factory;
}