Author |
Message
|
mq_pm |
Posted: Mon Sep 08, 2003 12:17 pm Post subject: mqseries using java |
|
|
Centurion
Joined: 27 Aug 2003 Posts: 132
|
Hi,
I am trying to write a sample java pgm to put the message to the remote queue definition .......which iam not able to do.........
I used this syntax to place a message in a local queue........
MQQueue system_queue = qMgr.accessQueue("LQUEUE",openOptions);
but i need to place in a remote queue definition.........
Please anyone let me know ........
Thank you |
|
Back to top |
|
 |
vennela |
Posted: Mon Sep 08, 2003 12:29 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
If you have defined a remote queue on the local queue manager, then
Code: |
int openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING
MQQueue InQueue = qmgr.accessQueue(QUEUE1 , openOptions, null, null, null);
|
|
|
Back to top |
|
 |
mq_pm |
Posted: Mon Sep 08, 2003 12:43 pm Post subject: |
|
|
Centurion
Joined: 27 Aug 2003 Posts: 132
|
Hi,
The scenario is like this....
I have created a QMGR on the local system and defined transimmision queue and remote definition queue.
I have to send a message to another QMGR on remote machine
The pgm is running fine but is not placing the message .......
Please let me know ........
Thank you |
|
Back to top |
|
 |
vennela |
Posted: Mon Sep 08, 2003 1:03 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Do you have a local queue defined on the second queue manager?
Do you have the channels setup between the two QMGRs?
Where is the message?
Are the channels running?
If the channels are running, then see if the message is in the dead letter queue of either of the QMGRs.
-------
Venny |
|
Back to top |
|
 |
mq_pm |
Posted: Tue Sep 09, 2003 1:17 pm Post subject: |
|
|
Centurion
Joined: 27 Aug 2003 Posts: 132
|
Yes I have defined all the necessary queues and channels. They are all running..........
I have tested whether they working by using explorer and placing the message ..........it is working.....
but when iam trying to place the message using java appl then it is not working........i mean the message is not placed..........
This is the code...........
import com.ibm.mq.*;
import java.io.*;
public class sample
{
private String qManager = "NEW";
private MQQueueManager qMgr;
public static void main(String a[])
{ new sample();
}
public sample()
{
try{
qMgr = new MQQueueManager(qManager);
int openOptions = MQC.MQOO_OUTPUT| MQC.MQOO_FAIL_IF_QUIESCING ;
MQQueue system_queue = qMgr.accessQueue("RMD",openOptions);
MQMessage msg = new MQMessage();
msg.writeUTF("testing........................");
MQPutMessageOptions pmo = new MQPutMessageOptions();
system_queue.put(msg, pmo);
system_queue.close();
qMgr.disconnect();
}
catch(MQException ex)
{
System.out.println(ex.completionCode + "reason" + ex.reasonCode);
}
catch(java.io.IOException ex)
{
System.out.println(ex);
}
}
} |
|
Back to top |
|
 |
vennela |
Posted: Tue Sep 09, 2003 2:16 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Is your PUT successful ?
Is your application returning some error?
-------
Venny |
|
Back to top |
|
 |
mq_pm |
Posted: Tue Sep 09, 2003 2:39 pm Post subject: |
|
|
Centurion
Joined: 27 Aug 2003 Posts: 132
|
Yes now iam able to put the message but when i check the message in the explorer it shows there is message in the queue but not able to see it ....i think it is in hexadecimal format ...not sure.........
the prog i have written is it correct????? or do i need to change any format of the string before placing....... |
|
Back to top |
|
 |
vennela |
Posted: Tue Sep 09, 2003 4:47 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
|
Back to top |
|
 |
bower5932 |
Posted: Wed Sep 10, 2003 3:42 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
|
Back to top |
|
 |
|