Category: JMS options

Q

What's the configuration for using JBossMQ from C++?

A

When configuring the runtime for use with JBossMQ, we have recently successfully used the configuration information below. We used JBoss 4.0 GA, but this information hopefully won't change significantly between releases.

If you're running with the default setup, you can use the following lookup names:
 

Item Lookup name
Queue connection factory ConnectionFactory
Queue for testing queue/A
Topic connection factory ConnectionFactory
Topic for testing topic/testTopic

The following sections provide example snippets for configuring the runtime for JBossMQ as your application's JMS provider.

Explicit

xmog_jvm_loader & loader = xmog_jvm_loader::get_jvm_loader();
 
// ------------------------------------------------------------------
// you have to add one jar file to the classpath
loader.appendToClassPath( "<FQN of jbossall-client.jar>" );

// ------------------------------------------------------------------
// you have configure the JNDI setup
loader.setDashDOption( "java.naming.factory.initial",
                       "org.jnp.interfaces.NamingContextFactory" );
loader.setDashDOption( "java.naming.factory.url.pkgs",
                       "org.jnp.interfaces" );
// this assumes JBoss default setup running on localhost
loader.setDashDOption( "java.naming.provider.url",
                       "jnp://localhost:1099" );

Configuration File

<configuration>
  <Codemesh>
    <Runtime>

      <Loader name="Default" />
      
      <Default.JvmSettings>
        <!-- set the classpath so it's right for the JMS provider           -->
        <!-- make sure that the fileseparator is correct for your platform  -->
        <add key="ClassPath" value="c:\jboss-4.0.4.GA\client\jbossall-client.jar" />
      </Default.JvmSettings>

      <Default.Options>
        <!-- here we configure the JNDI options for our JMS vendor          -->
        <add key="java.naming.factory.initial" value="org.jnp.interfaces.NamingContextFactory" />
        <add key="java.naming.provider.url" value="jnp://localhost:1099" />
        <add key="java.naming.factory.url.pkgs" value="org.jnp.interfaces" />
      </Default.Options>

    </Runtime>
  </Codemesh>
</configuration>

Copyright 2006-2011 by Codemesh, Inc., ALL RIGHTS RESERVED

:
frequently asked questions
home products support customers partners newsroom about us contact us