|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
2085 for Cluster Qs (C code working, Java not) |
« View previous topic :: View next topic » |
Author |
Message
|
nyey |
Posted: Wed May 14, 2003 7:25 am Post subject: 2085 for Cluster Qs (C code working, Java not) |
|
|
Acolyte
Joined: 13 Mar 2003 Posts: 57
|
Hi. I have a cluster between an AIX node and a Win 2K node. The AIX is MQ 5.3.0.3 while the Win2K is MQ 5.2.X. The cluster is working by doing this test:
On the AIX side, use the amqsput to the Q mgr on the AIX machine to a cluster Q on the NT machine. We can see the msg put to the Q on the NT machine. For NT, we used the same amqsput to another cluster hosted y the AIX machine.
However, I used Java to put a msg to the AIX machine for the cluster Q on Win2k. I got 2085?
Any idea? Appreciate your input....
Thanks |
|
Back to top |
|
 |
vennela |
Posted: Wed May 14, 2003 7:46 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Maybe you spelled it wrong. (It is case sensitive too).
You may try doing a refresh cluster.
Post the java code snippet where you open the queue |
|
Back to top |
|
 |
nyey |
Posted: Wed May 14, 2003 8:46 am Post subject: |
|
|
Acolyte
Joined: 13 Mar 2003 Posts: 57
|
I have post all the code here.... Thanks for your input..
Do you feel I need upgrade to 5.3 on NT side?
private static void test()
{
try
{
counter ++;
System.out.println(new Date() + "Test No. " + counter + " started!");
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF |
MQC.MQOO_OUTPUT;
// MQQueue tQueue = qMgr.accessQueue("MDB.REQUEST", openOptions);
// MQQueue tQueue = qMgr.accessQueue("TODD.REQUEST", openOptions);
// MQQueue tQueue = qMgr.accessQueue("ROL.RFI.REPLY", openOptions);
MQQueue tQueue = qMgr.accessQueue("ROL.RFI.DISK.REQUEST", openOptions);
MQPutMessageOptions pmo = new MQPutMessageOptions(); // use defaults
MQMessage msg = new MQMessage();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
String dateStrXY = format.format(new Date());
if (counter % 2 == 0)
{
msg.writeUTF("CompId=62642_GLDBNK_CD_0000FOW,qty=8234.0^q,dealerCost=82.34^P,TimeStmp=" + dateStrXY);
}
else
{
msg.writeUTF("CompId=62642_GLDBNK_CD_0000FOW,qty=6234.0^q,dealerCost=62.34^P,TimeStmp=" + dateStrXY);
}
msg.expiry = 1000; // 100 secs
tQueue.put(msg, pmo);
tQueue.close();
System.out.println(new Date() + "Test No. " + counter + " finished!");
}
catch (MQException ex)
{
System.out.println("MQ Error Location 1" + ex.getMessage());
Connect();
}
catch (IOException ex)
{
System.out.println("IO Location 3" + ex.getMessage());
}
}
public static MQQueueManager Connect()
{
// MQQueueManager qmgr = null;
try
{
// local machine client mode
// MQEnvironment.hostname = "localhost";
// MQEnvironment.channel = "CHANNEL1";
// MQEnvironment.port = 1414;
// qMgr = new MQQueueManager("WSAD_TESTSERVER");
// AIX
MQEnvironment.hostname = "10.201.35.111";
MQEnvironment.channel = "ROLWD11.CLIENT.CHL";
MQEnvironment.port = 1414;
qMgr = new MQQueueManager("ROLWD11");
/*
// AIX
MQEnvironment.hostname = "rolapdp1";
MQEnvironment.channel = "ROLPD11.CLIENT.CHL";
MQEnvironment.port = 1414;
qMgr = new MQQueueManager("ROLPD11");
*/
/*
// NT
MQEnvironment.hostname = "rolvcdw1";
MQEnvironment.channel = "ROLWD31.CLIENT.CHL";
MQEnvironment.port = 1414;
// MQEnvironment.userID ="was";
MQEnvironment.password = "z00mz00m";
// MQEnvironment.password = "password";
qMgr = new MQQueueManager("ROLWD31");
*/
/*
MQEnvironment.hostname = "160.101.99.10"; // this is staging
MQEnvironment.channel = "PROD_CHANNEL1";
MQEnvironment.port = 1414;
qMgr = new MQQueueManager("WSAD_PROD_SERVER");
*/
}
catch (MQException ex)
{
System.out.println("MQ Error location 2" + ex.getMessage());
}
return qMgr;
}
public static long convertDateStringToMilSec(String dateStr)
{
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
// This is ODBC 121 in SP
try
{
Date d = format.parse(dateStr.trim());
return d.getTime();
}
catch(Exception e)
{
return 0;
}
}
public static void main(String args[])
{
int sleepInterval = 20;
boolean keepOnRunning = true;
long timeMarker = convertDateStringToMilSec("2003-05-30 06:00:00.000");
while(keepOnRunning)
{
try
{
qMgr = Connect();
while(keepOnRunning)
{
test();
int tempi = (int)Math.random()*(sleepInterval*1000);
if (tempi < 5000) tempi = 5000;
//if (counter % 40 == 0) Thread.sleep(tempi);
Thread.sleep(250);
if (counter % 100 ==0)
{
getMsg();
}
if (System.currentTimeMillis() >= timeMarker)
{
keepOnRunning = false;
}
}
if (qMgr != null) qMgr.disconnect();
qMgr = null;
}
catch (Exception e)
{
System.out.println("System Terminated Abnormally ???" + " Exception Msg" + e.getMessage());
}
}
if (qMgr != null)
{
try
{
qMgr.disconnect();
}
catch(Exception e)
{
}
}
System.out.println("System Terminated successfully!!!" + "Test Time:" + counter*sleepInterval);
}
} |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|