Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8074341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:37:09+00:00 2026-06-05T14:37:09+00:00

I have the following situation: I have 2 JVM processes (really 2 java processes

  • 0

I have the following situation:

I have 2 JVM processes (really 2 java processes running separately, not 2 threads) running on a local machine. Let’s call them ProcessA an ProcessB.

I want them to communicate (exchange data) with one another (e.g. ProcessA sends a message to ProcessB to do something).

Now, I work around this issue by writing a temporary file and these process periodically scan this file to get message. I think this solution is not so good.

What would be a better alternative to achieve what I want?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T14:37:11+00:00Added an answer on June 5, 2026 at 2:37 pm

    Multiple options for IPC:

    Socket-Based (Bare-Bones) Networking

    • not necessarily hard, but:
      • might be verbose for not much,
      • might offer more surface for bugs, as you write more code.
    • you could rely on existing frameworks, like Netty

    RMI

    • Technically, that’s also network communication, but that’s transparent for you.

    Fully-fledged Message Passing Architectures

    • usually built on either RMI or network communications as well, but with support for complicated conversations and workflows
    • might be too heavy-weight for something simple
    • frameworks like ActiveMQ or JBoss Messaging

    Java Management Extensions (JMX)

    • more meant for JVM management and monitoring, but could help to implement what you want if you mostly want to have one process query another for data, or send it some request for an action, if they aren’t too complex
    • also works over RMI (amongst other possible protocols)
    • not so simple to wrap your head around at first, but actually rather simple to use

    File-sharing / File-locking

    • that’s what you’re doing right now
    • it’s doable, but comes with a lot of problems to handle

    Signals

    • You can simply send signals to your other project
    • However, it’s fairly limited and requires you to implement a translation layer (it is doable, though, but a rather crazy idea to toy with than anything serious.

    Without more details, a bare-bone network-based IPC approach seems the best, as it’s the:

    • most extensible (in terms of adding new features and workflows to your
    • most lightweight (in terms of memory footprint for your app)
    • most simple (in terms of design)
    • most educative (in terms of learning how to implement IPC). (as you mentioned "socket is hard" in a comment, and it really is not and should be something you work on)

    That being said, based on your example (simply requesting the other process to do an action), JMX could also be good enough for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say that I have following situation. I have many customers and many consultans,
I have the following situation: using a classical Java server (using ServerSocket) I would
Possible Duplicate: How does Copy-local work? I have following situation: there's a project named
I have following situation - Have a MongoService class, which reads host, port, database
I have following situation. In a constructor of a pseudo class I attach a
I have following situation (simplified, of course): MyDomain.groovy: class MyDomain { MyAnotherDomain anotherDomain //
I have following situation, String a=<em>crawler</em> <em> Yeahhhhh </em></a></h3><table; System.out.println(a.indexOf(</em>)); It returns the 11
I have following situation: String a = A Web crawler is a computer program
I have following Situation, Server A sends some data (HTML form) to server B,
I have the following situation: vec1 <- c(A, B, D, C, E, A, C)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.