Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to remote queue instead of local 1

Status
Not open for further replies.

emerlino

Programmer
Jul 23, 2003
3
IT
Hi all,

I'm new with MQ Series and its functionalities.
I write a program that interface with MQ by a java client interface (package com.ibm.mq.*).

My little program runs with no problems when I use a local queue, but have problem (NullPointerException) when trying to use a remote queue.
Such remote queue is defined on the same QueueManager of the right running program.
Have I to specify a different code for remote queue???

Here is some code parts:

// - Inizializzare il Queue Manager e la coda di MQ
String qManager = "QMFX";
MQQueueManager m_qMgr = null;
MQQueue mq_queue = null;
MQMessage sendMsg = null;

try
{
java.util.Hashtable properties = new java.util.Hashtable();

properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);
properties.put(MQC.HOST_NAME_PROPERTY, "10.100.184.140");
properties.put(MQC.CHANNEL_PROPERTY, "JAVA.CHANNEL");


m_qMgr = new MQQueueManager(qManager, properties);
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT ;

mq_queue = m_qMgr.accessQueue("UPLOAD", openOptions, "QMFX" , null, null);
}
catch (MQException ex)
{
System.out.println("An MQ error occurred : Completion code " + ex.completionCode + " Reason code " + ex.reasonCode);
out.print("Errore: istanziazione Queue Manager.");
}


....

Could somebody tell me why?

Thank's in advance.

 
Firstly you CANNOT open a remote queue for Input.MQC.MQOO_INPUT_AS_Q_DEF . Secondly where is the remote queue, is the remote queue on the server. Are you running the java app as a client or server app.



Cheers
KK
 
Hi mqonnet,

I'll explain you my doing.
I have to run a jsp page under WebSphere that insert a special message into a queue, that has to map this host (the same where running jsp page) and a remote host where I'll get the message out of queue.
I think this is a remote queue.

Well, in writing my basic java/jsp program a had used a local queue to insert and get out my messages.

Can you tell me what is the right option to open a remote queue?

I'll look for "MQC.MQOO_INPUT_AS_Q_DEF" meaning in manuals, since now I've used it without really know what it means!

Thank's for your reply.

Best Regards,

Emilio Merlino.


 
When you say remote queue, do you mean a queue defined as remote... DEFINE QRMOTE(<>). If yes, then you cannot open remote queues for input which is what is MQOO_INPUT_AS_Q_DEF. Remote queues can only be opened for output to put any messages onto it.



Cheers
KK
 
Thank's mqonnet I've solved my problem using your last reply that ring my bells!

Have a good time.

Bye,
Emilio Merlino

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top