Announcement Announcement Module
No announcement yet.
Robust RMI Connections Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Robust RMI Connections

    Are they any exceptions I can catch or properties to set to make sure a failed RMI connection doesn't crash my application.

    I have set the following properties but I am not sure if it will be enough.
    refreshStubOnConnectFailure = true
    cacheStub = false
    lookupStubOnStartUp = false

    Basically I have a networked message handler that accepts proprietary messages from third parties, processes them and then hands it off to another service through RMI for further processing of the message. The first part just logs and records the incoming messages to the database at the moment but I do expect it to grow. Each service needs to be stand alone. If the second service is down for any reason, I want to catch an exception (or something like that) so I can just log the state of the messages in the DB as errored and when the second service starts it can process what it missed. I want to be able to try and reconnect the RMI connection every so often in order to hot fix the application.

    Any advice would be appreciated.

    I must also say
    does not go into enough details about rmi remoting...just a note for anyone reading, do not use 1199...spring will not start its own registry if you specify a port. You need to set a couple rmi properites on the java run line as arguments also. I have been letting spring start it because using linux as a user (aka not root) I cannot start rmiregistry (pid permission issues with the tmp directory). I need to read up about rmi in general but these are some of the issues I have been having fun with. The documentation makes it look like spring does everything magically for you and it really doesn't

  • #2

    ok so using the 3 options above seem to do what I want for the most part...I just need to catch an exception or something so I know what the outcome of the rmi connection was.