Announcement Announcement Module
No announcement yet.
Share a ConnectionFactory or Connection between several JVMs Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Share a ConnectionFactory or Connection between several JVMs

    Hi, i'm working on an application which create several JVMs and dialog with them via JMS.

    I have a central server which create JVMs at runtime, the JVMs execute potentially bugged components. If a JVM crash the application continue to run.

    For now I have a JMS ConnectionFactory accessible via JNDI so it's shared between the central server and the JVMs. What I want to do now is share a single JMS Connection between all those JVMs.

    On the central server I've tried to use a SingleConnectionFactory and then bind the associated instance:
    public void postConstruct()  throws NamingException {
        this.singleConnectionFactory = new SingleConnectionFactory(connectionFactory);
        this.jndiTemplate.bind("SINGLE_CONNECTION_FACTORY", this.singleConnectionFactory);
    In the separated JVMs I want to do something like that:
    this.connectionFactory = (ConnectionFactory) jndiTemplate.lookup("SINGLE_CONNECTION_FACTORY");
    This would allow to share the same JMS Connection between the JVMs and the central server. But I can't do that because SingleConnectionFactory isn't Serializable.

    So, do you know how can I do to share a JMS Connection between JVMs ?