Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everybody, iam a beginner in Talend ESB.
I want to establish a TCP/IP connection to a Server. It's an RFID reader.
I have to send the reader an XML message via TCP / IP to a Host: "141.79.224.86" and a Port: 10001.
The XML message is called HostGreetings.
(<frame><cmd><id>1</id><hostGreetings><readerType>SIMATIC_RF680R</readerType><supportedVersions><version>V2.0</version><version>V2.1</version><version>V2.2</version></supportedVersions></hostGreetings></cmd></frame>)
After sending I have to get an answer. But that doesnt work.
My process is as follows:
In the first step i send the whole code via tFileDelimited to the tSocketOutput (Client). This is working.
The answer i can see only about wireshark i get one. But in Talend it does not show me.
Thats the mistake i get.
Does anybody know what i'm doing wrong?
Thanks in advance!!!!
Kind regards
Ao
Try this.
Have two separate jobs. One for sending the message and one for receiving the message. Start the job that is sending the message first. Then start the job which is receiving the message while the first job is still running. You should then see it working. The problem with doing this in one job is that the components need to be sending and receiving at the same time. You can do this quite easily with the tParallelize component in the Enterprise Edition.
your job design is wrong...
1) 1st job: Open the port by using tsocketInput component and make sure timeout is bit high and give you enough time to execute second job
2) 2nd Job: Send your file to tsocketOutput in this job.
To be honest, the order of the jobs is not terribly important so long as you ensure that there is a crossover where they are both sending and trying to receive at the same time. To do this there are a few methods you can use. But it makes sense to look at the tSocketOutput's timeout and retry times AND the tSocketInput's timeout. Whichever you have more control over should have its timeout lengthened (and assigned more "trys" in the tSocketOutput's case).
Many thanks for the answer.
I have tried this several times before. But without success.
SocketServer (first job that is running):
SocketClient (Secound Job):
With two separate jobs, it works only via localhost!
SocketServer: (Starting)
SocketClient: runs
after the timeout comes an error message.
Starte Job SocketServer am 10:58 21/02/2018.
[statistics] connecting to socket on port 3846
[statistics] connected
Exception in component tSocketInput_1 (SocketServer)
java.net.SocketTimeoutException: Accept timed out
at java.net.DualStackPlainSocketImpl.waitForNewConnection(Native Method)
at java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
at java.net.AbstractPlainSocketImpl.accept(Unknown Source)
at java.net.PlainSocketImpl.accept(Unknown Source)
at java.net.ServerSocket.implAccept(Unknown Source)
at java.net.ServerSocket.accept(Unknown Source)
at rfidtosap.socketserver_0_1.SocketServer.tSocketInput_1Process(SocketServer.java:514)
When i mark at tSocketInput (bind host name), an error message comes immediatly.
Starte Job SocketServer am 11:01 21/02/2018.
[statistics] connecting to socket on port 4063
[statistics] connected
Exception in component tSocketInput_1 (SocketServer)
java.net.BindException: Cannot assign requested address: JVM_Bind
at java.net.DualStackPlainSocketImpl.bind0(Native Method)
at java.net.DualStackPlainSocketImpl.socketBind(Unknown Source)
at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at rfidtosap.socketserver_0_1.SocketServer.tSocketInput_1Process(SocketServer.java:507)
at rfidtosap.socketserver_0_1.SocketServer.runJobInTOS(SocketServer.java:938)
at rfidtosap.socketserver_0_1.SocketServer.main(SocketServer.java:787)
[statistics] disconnected
Job SocketServer endet am 11:01 21/02/2018. [exit code=1]
I dont know what else to do!
Have you tried the "Bind host name" option in the tSocketInput component?
When i mark at tSocketInput (bind host name), an error message comes immediatly.
Starte Job SocketServer am 11:01 21/02/2018.
[statistics] connecting to socket on port 4063
[statistics] connected
Exception in component tSocketInput_1 (SocketServer)
java.net.BindException: Cannot assign requested address: JVM_Bind
at java.net.DualStackPlainSocketImpl.bind0(Native Method)
at java.net.DualStackPlainSocketImpl.socketBind(Unknown Source)
at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at rfidtosap.socketserver_0_1.SocketServer.tSocketInput_1Process(SocketServer.java:507)
at rfidtosap.socketserver_0_1.SocketServer.runJobInTOS(SocketServer.java:938)
at rfidtosap.socketserver_0_1.SocketServer.main(SocketServer.java:787)
[statistics] disconnected
Job SocketServer endet am 11:01 21/02/2018. [exit code=1]
You have to bind it to an IP address that belongs to the machine you are running the code on. This says to me that the IP address you have bound it to does not belong to the machine you are running it on.
Sorry i didnt quite understand that. Iam connected to the RFID reader via VPN. The reader is somewhere at the college. I can ping the reader via the host address: "141.79.224.86". So what does that mean exactly?
How can i bind it?