Category: JMS options
Q
What's the configuration for WebLogic JMS from C++?
A
When configuring the runtime for use with WebLogic you should try the following configuration. We have not tried this ourselves, but an evaluator reported it as a working configuration with a WebLogic 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 WebLogic server:
| Item | Lookup name |
|---|---|
| Queue connection factory | weblogic.jms.ConnectionFactory or weblogic.jms.XAConnectionFactory |
| Queue for testing | javax.jms.exampleQueue |
| Topic connection factory | weblogic.jms.ConnectionFactory or weblogic.jms.XAConnectionFactory |
| Topic for testing | javax.jms.exampleTopic |
The following sections provide example snippets for configuring the runtime for WebLogic 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 weblogic.jar>" ); // ------------------------------------------------------------------ // you have configure the JNDI setup loader.setDashDOption( "java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory" ); // this assumes OpenJMS default setup running on localhost loader.setDashDOption( "java.naming.provider.url", "t3://localhost:7001" );
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:\weblogic\server\lib\weblogic.jar" />
</Default.JvmSettings>
<Default.Options>
<!-- here we configure the JNDI options for our JMS vendor -->
<add key="java.naming.factory.initial" value="weblogic.jndi.WLInitialContextFactory" />
<add key="java.naming.provider.url" value="t3://localhost:7001" />
<add key="java.naming.security.principal" value="guest" />
<add key="java.naming.security.credentials" value="guest" />
</Default.Options>
</Runtime>
</Codemesh>
</configuration>
