Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multi Process Configuration

 
Yair Ogen
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a product built out of multiple processes. Each process uses internally commons configuration.

Does anyone have an idea how to manage the config? I.e. we do not want to duplicate variables so each process will be able to read them.

Additionally, DB solution is no good, as we do not want to be dependent on DB for something like configuration.

Thanks

Yair
 
Matt Cartwright
Ranch Hand
Posts: 152
Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yair Ogen wrote:Hi,

I have a product built out of multiple processes. Each process uses internally commons configuration.


"multiple processes" as in "multiple instances of JVM" hosted in one instance of OS?

or multiple threads?
as in "multiple tasks (executions paths) in the same instance of JVM"?

Just trying to figure
M
 
Yair Ogen
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Multiple JVM's.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A commonly available XML configuration file or Properties file is a typical solution.

How does data move between the processes?

Bill
 
Matt Cartwright
Ranch Hand
Posts: 152
Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The way I understand your question is, you are looking for dynamic
configuration updates (at runtime without having to restart the app).

If all JVMs are running on the same hos,t Inter Process Communication (IPC)
could be the way to share variables between processes.

In Java you could be using java.nio.MappedByteBuffer.
Well, synchronization is another thing to do then.

Or maybe you wanna have a look into JINI which
also supports a distributed approach (JVMs running on different machines).

Hope that helps
Matt




 
Yair Ogen
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please elaborate more on IPC?
 
Matt Cartwright
Ranch Hand
Posts: 152
Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The main IPC facilities are

  • message queues
  • semaphores
  • shared memory


  • and have been introduced in AT&T's System V.

    There also are BSD IPC facilities which are mainly socket based.

    Maybe you can have a read here
    and in particular here.

    Hope that helps
    Matt
     
    Yair Ogen
    Greenhorn
    Posts: 29
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks, So you think that if one has multiple processes on multiple VM's and he wishes to have a centralized Configuration (to avoid duplicate entries etc), the way to go is via IPC?

    Not a bit of an over kill?

    Specifically, we are using commons-configuration. anyone know if they have any solution for such a problem?

    Thanks.
     
    Matt Cartwright
    Ranch Hand
    Posts: 152
    Linux VI Editor
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Yair Ogen wrote:Thanks, So you think that if one has multiple processes on multiple VM's and he wishes to have a centralized Configuration (to avoid duplicate entries etc), the way to go is via IPC?


    That's the only way I know when it comes to sharing data between processes and you are not using a database or files.

    For Java you could also use Java Spaces (e.g. Apache River).

    I am not saying this is the holy grail, just the world from my point of view having worked with TP Monitors in IPC
    environments for more than 15 years



     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic