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 API Support » multi-process concurrent MQPUT but ended with ResonCode 2099

Post new topic  Reply to topic Goto page 1, 2  Next
 multi-process concurrent MQPUT but ended with ResonCode 2099 « View previous topic :: View next topic » 
Author Message
andy840920
PostPosted: Sun Apr 29, 2007 6:09 am    Post subject: multi-process concurrent MQPUT but ended with ResonCode 2099 Reply with quote

Apprentice

Joined: 29 Apr 2007
Posts: 44

my program like this:

Code:
#include "test.h"
#include <unistd.h>

int main()
{
    MYMQCONNX(&HandleA...); //use MQCNO_HANDLE_SHARE_BLOCK Option
    MYMQOPEN(HandleA...); //use MQOO_INPUT_AS_Q_DEF option

    MYMQCONNX(&HandleB...);//use MQCNO_HANDLE_SHARE_BLOCK Option

    MYMQOPEN(HandleB); //use MQOO_OUTPUT option


    while (1)
    {
        len = MYMQGET(HandleA...);
/*
gmo.Options=MQGMO_WAIT|MQGMO_LOGICAL_ORDER | MQGMO_ALL_MSGS_AVAILABLE | MQGMO_ALL_SEGMENTS_AVAILABLE */

        if ((pid = fork()) != 0) {
            if (pid < 0)
                exit(-1);
            else
                continue;
        }

        //child process handle do some thing...

        MYMQPUT(HandleB...);
     /* no  special option for MQPUT */
         exit(0);
    }
}

when my process concurrency more then 30 then MQPUT return 2009 reson code. i don't know how to resolve the problem.thanks...
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Sun Apr 29, 2007 8:38 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I would say that you are running out of MaxActiveChannels on the queue manager.

I would also think that you need to control how many connections you want to open and close, likewise with the number of processes you want to fork.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
andy840920
PostPosted: Mon Apr 30, 2007 7:09 am    Post subject: Reply with quote

Apprentice

Joined: 29 Apr 2007
Posts: 44

jefflowrey wrote:
I would say that you are running out of MaxActiveChannels on the queue manager.

I would also think that you need to control how many connections you want to open and close, likewise with the number of processes you want to fork.
how to know the MaxActiveChannels value? and my fork process must close and disconnect the connection? i think when my sub process exit and the connection disconnected...
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Mon Apr 30, 2007 7:21 am    Post subject: Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

You can find MaxActiveChannels value in qm.ini CHANNELS stanza


Quote:
MAXCHANNELS=n ; Maximum number of channels allowed, the ; default value is 100

MAXACTIVECHANNELS=n ; Maximum number of channels allowed to be active at ; any time, the default is the value of MaxChannels

_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
marcin.kasinski
PostPosted: Mon Apr 30, 2007 7:27 am    Post subject: Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

You can also read this :

http://www.mqseries.net/phpBB2/viewtopic.php?t=36612

I think it will help you.
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
andy840920
PostPosted: Mon Apr 30, 2007 7:48 am    Post subject: Reply with quote

Apprentice

Joined: 29 Apr 2007
Posts: 44

marcin.kasinski wrote:
MaxActiveChannels value you can find in qm.ini CHANNELS stanza


Quote:
MAXCHANNELS=n ; Maximum number of channels allowed, the ; default value is 100

MAXACTIVECHANNELS=n ; Maximum number of channels allowed to be active at ; any time, the default is the value of MaxChannels
but my application is not use channels. only direct connect queue of the MQManage
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 30, 2007 7:57 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

andy840920 wrote:
but my application is not use channels. only direct connect queue of the MQManage


If you're getting a 2009 (Connection Broken) then you're using the client channels to connect. If your application is not running on the same machine as the queue manager, that's the only way it can connect to the queue manager.

If you want to connect directly to the queue manger then you need to relink with the server libs not the client ones, and ensure your application is running on the queue manager machine. It'll fail with a 2058 running anywhere else.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
andy840920
PostPosted: Mon Apr 30, 2007 7:58 am    Post subject: Reply with quote

Apprentice

Joined: 29 Apr 2007
Posts: 44

my problem is why some concurrency processes put msg to the queue at the same time would return ResonCode 2009 by MQPUT operate. these concurrency processes are forked by the same parent process and shared the handle produced by the parent process. but when i re-connect , re-open MQPUT close and disconnect to the queue in every child process still return the same result.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 30, 2007 8:02 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

andy840920 wrote:
my problem is why some concurrency processes put msg to the queue at the same time would return ResonCode 2009 by MQPUT operate.


Other than the explainations given above...?

If you can't recode as suggested, you may need to move the code server side.
_________________
Honesty is the best policy.
Insanity is the best defence.


Last edited by Vitor on Mon Apr 30, 2007 8:03 am; edited 1 time in total
Back to top
View user's profile Send private message
andy840920
PostPosted: Mon Apr 30, 2007 8:03 am    Post subject: Reply with quote

Apprentice

Joined: 29 Apr 2007
Posts: 44

Vitor wrote:
andy840920 wrote:
but my application is not use channels. only direct connect queue of the MQManage


If you're getting a 2009 (Connection Broken) then you're using the client channels to connect. If your application is not running on the same machine as the queue manager, that's the only way it can connect to the queue manager.

If you want to connect directly to the queue manger then you need to relink with the server libs not the client ones, and ensure your application is running on the queue manager machine. It'll fail with a 2058 running anywhere else.
my application is running on the same machine with the MQ server. my app MQGET from the other machine via remote channel, and MQPUT to the local queue directly. but it not failed with 2058 and that 2099 , why ?
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 30, 2007 8:07 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

andy840920 wrote:
my application is running on the same machine with the MQ server. my app MQGET from the other machine via remote channel, and MQPUT to the local queue directly. but it not failed with 2058 and that 2099 , why ?


Your application may be running on the same machine as the queue manager, but that 2009 indicates it's linked with the client libraries and is using the client connection.

It's also not doing an MQGET from a remote anything - MQGET is only valid on a queue local to the connection. If the reading queue is on another machine, you must have a client connection to that queue manager or it wouldn't be working.

Think about the queue architecture, where your application fits logically and how the messages flow. This will help you resolve this problem.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
andy840920
PostPosted: Mon Apr 30, 2007 8:24 am    Post subject: Reply with quote

Apprentice

Joined: 29 Apr 2007
Posts: 44

Vitor wrote:
andy840920 wrote:
my problem is why some concurrency processes put msg to the queue at the same time would return ResonCode 2009 by MQPUT operate.


Other than the explainations given above...?

If you can't recode as suggested, you may need to move the code server side.
my code is running on server side...but why still appeared the problem
Back to top
View user's profile Send private message
andy840920
PostPosted: Mon Apr 30, 2007 8:27 am    Post subject: Reply with quote

Apprentice

Joined: 29 Apr 2007
Posts: 44

Vitor wrote:
andy840920 wrote:
my application is running on the same machine with the MQ server. my app MQGET from the other machine via remote channel, and MQPUT to the local queue directly. but it not failed with 2058 and that 2099 , why ?


Your application may be running on the same machine as the queue manager, but that 2009 indicates it's linked with the client libraries and is using the client connection.

It's also not doing an MQGET from a remote anything - MQGET is only valid on a queue local to the connection. If the reading queue is on another machine, you must have a client connection to that queue manager or it wouldn't be working.

Think about the queue architecture, where your application fits logically and how the messages flow. This will help you resolve this problem.
my app is running on the same machine as the queue manager, but MQGET from a queue local and the queue is the remote queue created by an other queue manager on other machine. MQPUT to a queue local created by the QM on the same machine with MQ Server and my app.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Apr 30, 2007 9:26 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

if you have a 2099

2099 0x00000833 MQRC_SIGNAL1_ERROR

you probably have some other errors and at least an FDC.

My guess is that this is some concurrency problem and sharing handle problem.

Each thread should use it's own handle...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Mon Apr 30, 2007 11:22 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Also, please note that a 2099 is completely different than a 2009.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ API Support » multi-process concurrent MQPUT but ended with ResonCode 2099
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.