How do I register queue objects with iMQ 2.0 and iAS 6.0 SP2?
In JMQ 1.1 we registered queue objects with iPlanet using a dedicated
wrapper script jmqjmsadm.sh.
I can't find anything equivalent in iPlanet Message Queue 2.0. I've tried
hacking the registry using kregedit with no success. I need a way of getting
JMQ 2.0 stuff into the IAS JNDI tree.
We're using IAS 6.0 SP2.
JMQ 1.1 came with an administered object management utility called 'jmqconfig' that
you could use to store administered objects into a JNDI repository.
As part of the instructions for enabling JMS providers on iPlanet Application
Server 6.0 SP2 (and running the JMS examples), you need to do several things
- run a setup script named 'jms_setup'
- use a script that you have used, 'jmqjmsadm.sh' to store the administered
objects used by the examples into iAS's JNDI repository.
The jmqjmsadm.sh above is a wrapper script that invokes JMQ 1.1's 'jmqconfig'
utility. The point to note here is that jmqjmsadm.sh is bundled in iAS 6.0 SP2, not
JMQ 1.1, or iMQ 2.0.
iMQ 2.0 comes with it's own set of administration tools, the one of interest here
is 'jmqobjmgr' - it is used to store JMS administered objects into a directory server
via JNDI.
To make things work for iMQ 2.0 i.e. store iMQ 2.0's administered
objects into iAS's JNDI repository, iAS's jmqjmsadm.sh script needs to be
modified to use 'jmqobjmgr' instead of 'jmqconfig'. There's a bit more involved
here than just swapping the names of the executables since the command line
options supported are different.
FYI - a migration guide from JMQ 1.1 to iMQ 2.0 is available at:
http://docs.iplanet.com/docs/manuals/javamq/20/migration.pdf
which among other things, compares how one would do things with
iMQ 2.0's jmqobjmgr VS JMQ 1.1's jmqconfig.
I'm including below a modified version of the jmqjmsadm.sh script that uses
iMQ 2.0's jmqobjmgr utility.
[Didn't send as attachment as I wasn't sure if the listserv will accept it]
Save it out - remove the "START of..." and "END of" lines obviously.
The call to 'jmqobjmgr' in the script is *one* long line.
So, to integrate iMQ 2.0 with iAS 6.0 SP2, you need to:
1. Run the jms_setup script as before, but specifying
/opt/SUNWjmq/lib/jmq.jar
/opt/SUNWjmq/lib/jmqutil.jar
for CLASSPATH.
2. Edit IAS_HOME in the included jmqjmsadm.sh script to point to
your iAS 6.0 SP2 install. Edit JMQ_HOME to point to your
iMQ 2.0 install, if needed.
3. jmqjmsadm.sh is now ready to be used.
To make the JMS examples work, follow the instructions you used previously
for setting up the examples to run with JMQ 1.1. I believe these
instructions are installed at:
http://yourhost:yourport/ias-samples/jms/docs/index.html#jmq-solaris
(They recommend you copy the script to iAS's ias/jms/bin directory).
=========================START of jmqjmsadm.sh=================================
#!/bin/ksh
#
# JMSAdmin
# This script launches the JMQ JMS administration tool with the
# appropriate environment to access the iAS 6.0 JNDI system.
#
##### Set these variables appropriately for your installation #####
IAS_HOME=/export/iplanet/ias6/ias
JMQ_HOME=/opt/SUNWjmq
####################################################################
typeset -f -x print_usage
function print_usage
{
echo "Usage when adding queues or topics..."
echo "jmqjmsadm [q|t] [JNDI name of queue/topic] [name of queue/topic]"
echo "For example..."
echo "jmqjmsadm q theQueue SampleQueue"
echo "jmqjmsadm t theTopic SampleTopic"
echo "Usage when adding connection factories..."
echo "jmqjmsadm [qf|tf] [JNDI name of factory]"
echo "For example..."
echo "jmqjmsadm qf theFactory"
echo "jmqjmsadm tf theTopicFactory"
exit 1
}
if [ $1 == "t" -o $1 == "q" ]; then
if [ -z $3 ]; then
print_usage
fi
DESTINATION="JMQDestinationName=$3"
DEST_FLAG=-o
elif [ $1 == "tf" -o $1 == "qf" ]; then
if [ -z $2 ]; then
print_usage
fi
else
print_usage
fi
JAVA_HOME=$IAS_HOME/usr/java
JMS_CLASSES=$IAS_HOME/classes/java/jms.jar
JMQ_CLASSES=$JMQ_HOME/lib/jmq.jar:$JMQ_HOME/lib/jmqadmin.jar:$JMQ_HOME/lib
IAS_CLASSES=$IAS_HOME/classes/java/javax.jar:$IAS_HOME/classes/java/kfcjdk11.ja r
LD_LIBRARY_PATH=$IAS_HOME/gxlib:$LD_LIBRARY_PATH
CLASSPATH=$JMQ_CLASSES:$JMS_CLASSES:$IAS_CLASSES:$CLASSPATH
export LD_LIBRARY_PATH CLASSPATH JAVA_HOME
# The following command may be used with JMQ 1.1
# $JMQ_HOME/bin/jmqconfig -a -t $1 -n $2 -o "name=$3" -i com.netscape.server.jms.RefFSContextFactory -u
/jms
$JMQ_HOME/bin/jmqobjmgr add -t $1 -l $2 $DEST_FLAG $DESTINATION -j
"java.naming.factory.initial=com.netscape.server.jms.RefFSContextFactory" -j
"java.naming.provider.url=/jms"
=========================END of jmqjmsadm.sh=================================