I have two PC computers both running similar java programs
Computer 1: java program decides whether to trade on forex market or not and places a trade if required
Computer 2: shortened version of java program on Computer 1 - decides whether to trade AND then sends message to Computer 1 with its decision
[i.e. trade or NOT trade, and if trade whether to go short or long]
I am seeking a simple way to
a) have Computer 2 send a message to Computer 1
b) have Computer 1 receive that message
Bob Matthews wrote:The machines are on the same network both connected by ethernet cable to the same router
OK, so that makes it possible to use a direct connection like a socket. The question remains whether the codes do know the IP addresses of each other (or host names they can look up). If they do, sockets are not hard to implement, and the "All about sockets" section in the link Campbell posted will get you started. If they have no way of figuring out each other's IP address, a solution with an intermediary or registry (i.e., a server of some sort) would be necessary.
I have tried understanding Active MQ etc. but I quickly get bogged down with the technical language
ActiveMQ would imply a server; is that what you want? It sounded as if a direct connection was desired, but you didn't actually say whether or not a server-based solution was an option.
posted 1 month ago
Sorry but can not see the example you suggest ???
I believe that the computers do know the other one's IP address
(both computers are running 24/7)
I don't know what options are available or what I want
Computer 1 runs its java program to the point where it needs to receive a message from Computer 2
It waits at this point until a message is received
It then continues with the java program...........
Let me just clarify things a bit: You really want your Java programs to communicate with each other. So saying you want the computers to communicate, that confuses the requirements a bit.
Anyway it seems like making the program which waits to receive messages into a server. In that case, ordinary low-level communication via sockets should be sufficient. Here's a link to a relevant tutorial: Lesson: All About Sockets.
posted 1 month ago
I find the discussion about sockets confusing...................
I have just read about JMS messaging service--- point to point
Maybe that would suffice
I guess I do not want to use an elephant to crack a nut
On reflection my requirements are a little more complicated:-
Computer 1 (the master computer) runs four different java programs simultaneously - each program handles a different current pair e.g. USD/JPY
It is the only computer which actually trades on the forex market
Computer 2 also runs four different java programs simultaneously - each program handles the same currency pair as one of the programs running on Computer 1
I require each program running on Computer 2 to send a message to the program on Computer 1 with the same currency pair