Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

communication between machines  RSS feed

 
Bob Matthews
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Proposed setup is as follows:-

4 PCs on a local LAN network
1st PC - Master PC - used for scheduling - and connected to Forex broker using propriety API
Its tasks on an hourly basis are to:-
(a) receive currency price updates
(b) send a message containing these details to each of the other 3 PCs and get them to commence running their particular java program
(c) receive a message from each of the other 3 PCs containing the results of the program they have just run
(d) possibly place an order on the forex market using the API mentioned above

2nd, 3rd and 4th PC - each has a java program to run on an hourly basis (once they have received price updates from computer 1

Question: should I be looking at a messaging broker such as Apache Active MQ of is there a simpler way of achieving the simple messaging required ?

Bob M
 
Les Morgan
Rancher
Posts: 795
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're looking at 4 separate JVM instances so what goes off in my mind instantly is Socket communication.

I am a develop it myself kind of guy, and that is what my employers look for too, so I'd program the client and server, and also the logic for the needed tasks.  I generalize it so I have an easier time reusing the product.
 
Bob Matthews
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Les

As I know nothing about socket communication , a question please

Is computer No. 1 the server and are computers 2, 3 & 4 clients ?

Bob M
 
Paul Clapham
Sheriff
Posts: 24089
54
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bob Matthews wrote:Is computer No. 1 the server and are computers 2, 3 & 4 clients ?



You could say that, yes. It looks like once an hour computers 2, 3, and 4 will connect to computer 1 and ask for the price updates. That's a pretty standard client-server setup, and you'll probably notice that you could add in computers 5, 6, 7, and so on to do the same task.

Now, when you're talking about socket communication it isn't necessary to designate computers as "server" and "client" -- you might have what's called peer-to-peer communication. But in your case it looks like client-server and considering as such will probably help you to get up to speed learning about it.
 
Bob Matthews
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you to Les and Paul for your helpful comments

Sending variable values between machines using socket communication seems reasonable to understand

but how does the server get each client to commence running its own java program ?

Bob M
 
Paul Clapham
Sheriff
Posts: 24089
54
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bob Matthews wrote:but how does the server get each client to commence running its own java program ?



It doesn't. Is that really, really a requirement of your proposed system? Usually if somebody wants a server to run on a computer then they just run it there.
 
Bob Matthews
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul

Computer No. 1 [Server] is using API to connect to Forex platform in a continuous manner
Part of the API ensures that its java program runs every hour on the hour

I require all client computers to also run their own java programs on the hour every hour but I don't wish to have any client talking to the forex platform via proprietory API

Bob M
 
Tim Moores
Saloon Keeper
Posts: 5235
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If they should run at a fixed time, they could be started by a cron job, or by windows task scheduler.
 
Paul Clapham
Sheriff
Posts: 24089
54
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are 2, 3, and 4 running on separate computers? What do they do with the data they receive from 1? Why are there three of them?
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!