Category: JMS options

Q

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

A

When configuring the runtime for use with swiftMQ you should try the following configuration. We have not tried this ourselves, but an evaluator reported it as a working configuration with a swiftMQ server of a version unknown to us. They used the following lookup names. With these values and a working Java JMS example as guidance, you should have little trouble getting your JMS C++ applications working with your own swiftMQ server:
 

Item Lookup name
Queue connection factory myQueueConnectionFactory
Queue for testing testqueue@router1
Topic connection factory myQueueConnectionFactory
Topic for testing testtopic

The following sections provide example snippets for configuring the runtime for swiftMQ as a 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 swiftmq.jar>" );

// ------------------------------------------------------------------
// you have configure the JNDI setup
loader.setDashDOption( "java.naming.factory.initial",
                       "com.swiftmq.jndi.InitialContextFactoryImpl" );
// this assumes swiftmq default setup running on localhost
loader.setDashDOption( "java.naming.provider.url",
                       "smqp://localhost:4001" );

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:\swiftmq\lib\swiftmq.jar" />
      </Default.JvmSettings>

      <Default.Options>
        <!-- here we configure the JNDI options for our JMS vendor          -->
        <add key="java.naming.factory.initial" value="com.swiftmq.jndi.InitialContextFactoryImpl" />
        <add key="java.naming.provider.url" value="smqp://localhost:4001" />
        <!--add key="java.naming.security.principal" value="admin" />
        <add key="java.naming.security.credentials" value="secret" /-->
      </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