This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

communication between java programs using ActiveMQ message broker

 
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have just downloaded v5.12.0 and installed, tested and monitored OK

Not sure how to incorporate it into my current system - as follows

I have a dozen cloned strategies written in java each independent of the others
I start them one at a time on a forex java platform

I wish to use ActiveMQ to allow each strategy to communicate with all the others
I wish to use just 2 simple message formats a status message and a decision message

Can you point to an example of how I set this all up please

Bob M

p.s. is it just a matter of putting the activeMQ jar file into each strategy ?
 
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A simple unique Topic where everybody has subscribed to and publishes to might do the trick for you.

It is known as publish/subscribe.

Here is some links to get you started:

http://activemq.apache.org/how-does-a-queue-compare-to-a-topic.html

http://activemq.apache.org/virtual-destinations.html

You will typically need at least client files on your nodes at at least one MQ Server running somewhere or 1 MQ Server installed and running on every node.

 
Bob Matthews
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks AJ for your reply....................

but I am really out of my depth here.......................

Does what you suggest involve using Active MQ ?
Where does JMS come in to the picture?

I do not understand your use of the terms 'client files', nodes, at least 1 MQ server

Thanks

Bob M

On a more positive note, is the following somewhere close to what I am trying to do ?

http://stackoverflow.com/questions/9015882/activemq-publisher-subscriber-hello-world-example
 
A.J. Côté
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK

Bob Matthews wrote:I have just downloaded v5.12.0 and installed, tested and monitored OK

Not sure how to incorporate it into my current system - as follows

I have a dozen cloned strategies written in java each independent of the others
I start them one at a time on a forex java platform



From a high level perspective, I guessed your strategies were your nodes that need to communicate with each other.

Are each strategy running in its own jvm instance?

Are all your strategies running on the same machine?

I guess by forex, you are referring to the trading platform.




I wish to use ActiveMQ to allow each strategy to communicate with all the others
I wish to use just 2 simple message formats a status message and a decision message

Can you point to an example of how I set this all up please

Bob M

p.s. is it just a matter of putting the activeMQ jar file into each strategy ?



You need at least the client activeMQ jar file accessible to each strategy and you need at least 1 activeMQ server running (e.g. ActiveMQ Broker) somewhere although it might be possible to run an ActiveMQ Broker inside one or all of your strategy jvm, depending on the forex platform specificities.
 
Bob Matthews
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi AJ

OK so nodes are strategies (java programs)

Is each strategy running in its own jvm instance?
Not sure I understand this.................
I logon to the forex platform and then run each strategy separately

At the moment - say up to 3 strategies are running on the same machine but in future I need to have more than one host (machine)

Forex - foreign exchange I am using the Dukascopy Trading platform

client activeMQ jar file - accessible to each strategy
no problem - I add this to a library of jar files in each strategy

my thinking is that I run activeMQ broker inside each and every strategy

each strategy will send message1 at predetermined intervals - saying hey - I am here!
each strategy will send message2 soon after saying - my next prediction is such-and-such

All strategies need to know when they have received all possible message2's - not sure how to do this part..............
Then each strategy does the same calculation routine to reduce x trades down to y trades where the exposure is much less but achieves the same trade action

Thank you again for your help
Bob M



 
A timing clock, fuse wire, high explosives and a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic