|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
got a 2058 reason code error accessing queues. Why??? |
« View previous topic :: View next topic » |
Author |
Message
|
carlogol |
Posted: Tue May 13, 2003 12:03 am Post subject: got a 2058 reason code error accessing queues. Why??? |
|
|
Newbie
Joined: 17 Feb 2003 Posts: 6
|
Hi all
I am facing a strange problem. I have a java application which sends
files (splitted into mq messages) to its counterpart via mq queues.
More deeply: application A and B exchange files via mq.
A sends B a file splitted into N mq messages to a particular queue
(B-DATA QUEUE), and it also sends B a particular mq message to another
queue (say B-COMMAND QUEUE).
B receives this command mq message and understands it has to
"re-build" a file reading from its data queue. When the file has been
rebuilt, B sends a proper message back to A using another queue
(A-COMMAND QUEUE), saying that it successfully re-created the file.
If A needs to send B a number of files, it does so by creating a
number of threads (1 file - 1 thread).
Every thread accesses the queue istantiating its own MQManager and
MQQueues.
OK: enough theory
The problem is: I get a 2058 error (reason code) when the thread try
to access the queue using this line of code:
queue = manager.accessQueue( MQqueueName, qOpenOptions);
The weird thing is that i do not always receive this error (actually:
99% of the times everything works fine) but (randomly?) only when many
threads (say 50-60) are running.
That's a mess!
Please help me!
Thanks in advance
Carlo
PS: please, forgive me for my bad English. If something is not clear
enough... TELL ME  |
|
Back to top |
|
 |
fschofer |
Posted: Tue May 13, 2003 1:25 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
Hi Carlo,
do you use client or bindings connection in your
java application ?
If you use client connections you may have reached some
TCP/IP limits.
I'm not so deep into MQ thread programming,
but it seems to me that your thread lost or never
got a connection to your queue manager.
Can you please post your program code for instantiating
your queue manager and the accesssQueue qOpenOptions
settings.
For more informations about MQ and Threads you may take a look
at the MQSeries Application Programming Guide
Chapter 7. Connecting to and disconnecting from a queue
manager
Greetings
Frank |
|
Back to top |
|
 |
carlogol |
Posted: Tue May 13, 2003 2:12 am Post subject: |
|
|
Newbie
Joined: 17 Feb 2003 Posts: 6
|
Hi Frank, and thanks for your reply.
Well, to access mq I use java classes coded by a collegue of mine. But I am quite sure that the problem arises when multiple threads concurrently try to create their own MQ Manager.
Whenever I want to create a new MQ Queue I have to instantiate an object of a particular class (say MyMQQueue) and then "start" it up by issuing a call to the following method
Code: |
public synchronized void startup( boolean manualCommit) throws WmqQueueException
{
//... some other lines
try
{
NSTracer.traceInfo( this.getClass(), "startup()", "Creating a MQQueueManager: " + MQmanagerName);
// Create a connection to the queue manager
manager = new MQQueueManager( MQmanagerName);
NSTracer.traceInfo( this.getClass(), "startup()", "MQQueueManager: " + MQmanagerName + " created");
// All done: returns without throwing exceptions
return;
}
catch( MQException je )
{
NSTracer.traceError( this.getClass(), "startup()", "caught MQException: creating MQManager "+MQmanagerName + " exception is: "+je);
throw new WmqQueueException( this, je);
}
}
|
I can see from the trace file (generated by NSTracer utility) that every time multiple threads issue a call to this method (of course each one has previously created its own instance of the queue) in the same time (exactly the same millisecond) one succeeds and the other fail with reason code 2058.
For example
Thread1: manager name: QM_1; private instance of MyMQQueue
Thread2: manager name: QM_2; private instance of MyMQQueue
both threads pass the manager name to the queue constructor, and then call startup on their own MyMQQueue object. In the trace file I see something like:
Code: |
2003-05-12 16:44:40,662 INFO startup() - Creating a MQQueueManager: QM_1
2003-05-12 16:44:40,662 INFO startup() - Creating a MQQueueManager: QM_2
|
then one succeeds and the other fails (randomly?)
What's wrong with that?
Thanks again,
Carlo |
|
Back to top |
|
 |
fschofer |
Posted: Tue May 13, 2003 2:44 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
Hi Carlo,
Why do you use different names for your queue manager or do you work on serveral ones ?
2058 means that the name of the queue manager is not regonized
(see below for extract from MQSeries Application Programming Reference)
May it be that the first thread suceeds because it has the right queue manager name
and the second fails because there is no "real" queue manaager with that name.
Greetings
Frank
MQSeries Application Programming Reference:
MQRC_Q_MGR_NAME_ERROR (2058)
Explanation: On an MQCONN or MQCONNX call,
the value specified for the QMgrName parameter is not
valid or not known. This reason also occurs if the
parameter pointer is not valid. (It is not always possible
to detect parameter pointers that are not valid; if not
detected, unpredictable results occur.)
v On z/OS for CICS applications, this reason can occur
on any call if the original connect specified an
incorrect or unrecognized name.
This reason code can also occur if an MQ client
application attempts to connect to a queue manager
within an MQ-client queue-manager group (see the
QMgrName parameter of MQCONN), and either:
v Queue-manager groups are not supported.
v There is no queue-manager group with the specified
name.
Completion Code: MQCC_FAILED
Programmer Response: Use an all-blank name if
possible, or verify that the name used is valid. |
|
Back to top |
|
 |
carlogol |
Posted: Tue May 13, 2003 3:12 am Post subject: |
|
|
Newbie
Joined: 17 Feb 2003 Posts: 6
|
Hi again!
Quote: |
Why do you use different names for your queue manager or do you work on serveral ones ?
2058 means that the name of the queue manager is not regonized
(see below for extract from MQSeries Application Programming Reference)
May it be that the first thread suceeds because it has the right queue manager name
and the second fails because there is no "real" queue manaager with that name.
|
Well, I do work on 2 queue managers: each one has 2 local and 2 remote queues, connected via sender/receiver channels.
Hmm... to simulate production environment, I have 2 instances of the same application (say 1 and 2) running on the same workstation (err... my pc): 1 sends file to 2, and, of course, 2 receives from 1.
What else: 1 accesses queue manager QM_1 (and the related queues), 2 accesses QM_2.
When 1 needs to send 2 a file, it does so by creating a thread which splits the file into N messages, sending each of them on its "remote data queue" which maps the 2's "local data queue". Then the same thread sends 2 a proper "command" message on 2's "local command queue": 2 receives this command and creates a new thread to handle the request.
This thread then starts reading its local data queue, looking for the messages that had been previously sent by 1, etc etc.
Now, imagine that 1 needs to send hundreds of file. This means a number of "sending" threads, each of them create a private instances of QM_1 and of the related queues. And it also means a number of "receiving" threads (QM_2 & related queues).
Quite a mess, I know, but ... it has to be done this way
OK. With all that in mind, I see that the trace file contains lines like the ones I mentioned in my first post.
Whew... this drives me crazy
Any suggestion?
Thanks again,
Carlo |
|
Back to top |
|
 |
bower5932 |
Posted: Tue May 13, 2003 5:20 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
Like fschofer said, a 2058 is usually caused by a name mismatch on the qmgr. My guess is that you have these 2 qmgrs created on two different machines and you are attempting to connect to both of them from the same machine in bindings mode. Bindings mode only works if the qmgr is local. My other guess is that you are connecting to these two qmgrs on the same machine using client mode. However, you are coming into the listener for the same qmgr with both of your threads. |
|
Back to top |
|
 |
manish_madanlal |
Posted: Fri Dec 05, 2003 7:47 am Post subject: MQJE036: Queue manager rejected connection attempt |
|
|
Newbie
Joined: 05 Dec 2003 Posts: 1
|
Hello All,
My Java code randamly Reject Connection with MQ Series
It throws this line of code
MQJE036: Queue manager rejected connection attempt
MQJE001: Completion Code 2, Reason 2058
This happen randamly ( 1 out of 100 ) try
Thanks
Manish Sharma |
|
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
|
|
|
|