Category: JMS options

Q

What's the configuration for nirvana from C++?

A

When configuring the runtime for use with nirvana you should try the following configuration. We have tested this configuration with nirvana JMS v3.1.4177. The following lookup names are created when you instruct nirvana to set up a sample JMS environment via the supplied menuitem:
 

Item Lookup name
Queue connection factory QueueConnectionFactory
Queue for testing testqueue
Topic connection factory TopicConnectionFactory
Topic for testing testtopic

The following sections provide example snippets for configuring the runtime for nirvana as a JMS provider for your C++ application. Please use the platform-appropriate path separator as more than one jar file is required at runtime.

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 jms.jar>;<FQN of nJMSClient.jar>" );

// ------------------------------------------------------------------
// you have configure the JNDI setup
loader.setDashDOption( "java.naming.factory.initial",
                       "com.pcbsys.nirvana.nSpace.NirvanaContextFactory" );
// this assumes swiftmq default setup running on localhost
loader.setDashDOption( "java.naming.provider.url",
                       "nsp://127.0.0.1:9000" );

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:\Nirvana JMS 3.1.4177\lib\jms.jar;C:\Nirvana JMS 3.1.4177\lib\nJMSClient.jar;" />
      </Default.JvmSettings>

      <Default.Options>
        <!-- here we configure the JNDI options for our JMS vendor          -->
        <add key="java.naming.factory.initial" value="com.pcbsys.nirvana.nSpace.NirvanaContextFactory" />
        <add key="java.naming.provider.url" value="nsp://127.0.0.1:9000" />
        <!-- uncomment the security options if you set username and password on the context --?
        <!--add key="java.naming.security.principal" value="simple" />
        <add key="java.naming.security.credentials" value="simple" /-->
      </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