I have just started using Spring Integration for sharing data between two heterogenous systems.
Question 1: To begin with, I took the tcp-client-server sample available in the forum and tried to get a better understanding. The tcp-client-server sample as a standalone unit produces expected result when ran using Maven. However, while I run TelnetServer class as java application from eclipse as server and Telnet as client, I do not see communication between the two. I see a Connect Failed in the telnet window. What could be wrong?
Problem I am trying to solve:
Wantd to share data between two systems. The source reads a delimited flat file, converts it into a xml string and writes it to a TCP port. The target listens to the port, retrieves the data, processes it and sends a response back. To implement source system, I referred to the tcp-client-server sample and used only the client portion of code.
Question 2: The program runs fine on Windows XP. However, when I move it to a Mac, I do not get the response. The exception stack shows Exception in sendAndReceive() and timesout. What could be the problem?Code:<?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/integration" xmlns:ip="http://www.springframework.org/schema/integration/ip" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd http://www.springframework.org/schema/integration/ip http://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd"> <!-- Client side --> <gateway id="gw" service-interface="org.springframework.integration.samples.tcpclientserver.SimpleGateway" default-request-channel="input"/> <ip:tcp-connection-factory id="client" type="client" host="localhost" port="9001" single-use="true" so-timeout="10000" /> <!-- <channel id="input" /> --> <ip:tcp-outbound-gateway id="outGateway" request-channel="input" reply-channel="clientBytes2StringChannel" connection-factory="client" request-timeout="10000" reply-timeout="10000" /> <transformer id="clientBytes2String" input-channel="clientBytes2StringChannel" expression="new String(payload)" /> </beans:beans>
Question 3: I am using Spring Batch 2.1.8 to read and convert flat file to xml structure. Spring Integration 2.0.5 and Spring 3.0.5. Would there be any changes to the schema references based on the version of the Spring modules used?
Question 4: When a transformer is defined, do we need to explicitly define the channel? I observe the clientBytes2StringChannel is not defined in the sample. Does the container create one automatically?
Appreciate your assistance.