ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » mqseries using java

Post new topic  Reply to topic
 mqseries using java « View previous topic :: View next topic » 
Author Message
mq_pm
PostPosted: Mon Sep 08, 2003 12:17 pm    Post subject: mqseries using java Reply with quote

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
View user's profile Send private message Send e-mail
vennela
PostPosted: Mon Sep 08, 2003 12:29 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
mq_pm
PostPosted: Mon Sep 08, 2003 12:43 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
vennela
PostPosted: Mon Sep 08, 2003 1:03 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
mq_pm
PostPosted: Tue Sep 09, 2003 1:17 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
vennela
PostPosted: Tue Sep 09, 2003 2:16 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
mq_pm
PostPosted: Tue Sep 09, 2003 2:39 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
vennela
PostPosted: Tue Sep 09, 2003 4:47 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Your program is fine. There is nothing wrong with it.

You can use amqsbcg program to view the message.
amqsbcg QUEUENAME QMGRName

There is a browse program in this thread that might also be helpful.

http://www.mqseries.net/phpBB2/viewtopic.php?t=8288&highlight=mqbrowse

-------
Venny
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bower5932
PostPosted: Wed Sep 10, 2003 3:42 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

There is also an amqsbcg.java at http://www.developer.ibm.com/tech/sampmq.html
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » mqseries using java
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.