spring integration学习入门之tcp通讯

本文介绍了如何使用Spring Integration进行TCP通信。通过配置TCP连接工厂、通道适配器,实现服务端监听客户端连接,处理消息并响应。同时详细展示了客户端如何发送消息到服务端,以及服务端响应后客户端接收消息的过程。通过示例代码展示了服务器端和客户端的启动及测试。
摘要由CSDN通过智能技术生成

第一次编写csdn的博客,只怪stackoverflow死活登不上,没办法了

最近工作需要需要使用springintegration,以前没有使用过,不得已从头开始学习,资料也甚是不全,只能自己到处找英文原版看,也是辛苦,弄了好几天,总算跑通了helloworld和tcp的通讯了。

闲言少叙,直接上干货。

 

环境搭建

Maven 获取项目所需源代码

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.bocom.bbip</groupId>
<artifactId>bbip-integration-test</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<spring.version>3.2.1.RELEASE</spring.version>
<spring.integration.version>4.1.8.RELEASE</spring.integration.version>
<java.version>1.6</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>




<dependencies>
<!-- Spring Integration -->
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-core</artifactId>
<version>${spring.integration.version}</version>
</dependency>


<!-- Testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-ip</artifactId>
<version>${spring.integration.version}</version>
</dependency>
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值