|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQConn on Auto Defn Exit |
« View previous topic :: View next topic » |
Author |
Message
|
MB |
Posted: Sun Aug 15, 2004 8:19 pm Post subject: MQConn on Auto Defn Exit |
|
|
Acolyte
Joined: 25 Jun 2004 Posts: 52
|
Hi All,
Wanted to know if we can do a MQConn call in an Auto Defn Exit.
If in the Auto Defn exit, I just put and MQConn call, Cluster Sender channel to the repository doesnt come up. Wanted to know if there is some restriction to do a MQConn in Auto defn exit.
In the Auto defn Exit, I want to alter the attributes of the Auto Defined channel. can anyone tell me a way to do this.
Can anyone guide me with this.
Thanks,
~MB. |
|
Back to top |
|
 |
Nigelg |
Posted: Thu Aug 19, 2004 7:48 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
I do not know about restrictions on an MQCONN in a CHAD exit. I would have thought it would work.
To change the channel definition, amend the fields in the PMQCD passed tro the exit. |
|
Back to top |
|
 |
MB |
Posted: Thu Aug 19, 2004 9:42 pm Post subject: MQConn on Auto Defn Exit |
|
|
Acolyte
Joined: 25 Jun 2004 Posts: 52
|
Hi,
When in the code, included a MQCONN to a Queue manager, The QueueManager starts running. But the Cluster Sender Channel to the repository doesnt come up.
Yes, I did try to alter the Channel Defn PMQCD. My requirement is to change the MessageExit Name and MessageuserData in auto defined Cluster sender channel. I tried to use STRCPY, MEMCPY, STRNCPY. But the channel Exit information wasnt changed.
Any information on this would be useful..
Regards,
MB |
|
Back to top |
|
 |
Nigelg |
Posted: Thu Aug 19, 2004 11:02 pm Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
The message exit name and message exit data can be changed by changing the pointers in the PMQCD. Here is a code snippet which does something similar:
I then read the manual again (Intercomms, Channel Exits), and coded my
exit so that it filled in the MsgExitsDefined MsgExitPtr MsgUserDataPtr
fields, and the corresponding fields for Send and Receive exits. This
did work, and the exit names that I put in were called with MQXR_INIT
as required.
.
Here are some code fragments that did the work. Note that my exit
functions are called ChlScyExit, ChlMsgExit, ChlSndExit and ChlRcvExit,
with a full path. I copied the security exit name and changed the
middle portion correspondingly.
.
// Data declaration
typedef struct USEREXIT
{
char ExitName[MQ_EXIT_NAME_LENGTH];
} USEREXIT, *PUSEREXIT;
typedef struct USERDATA
{
char ExitData[MQ_EXIT_DATA_LENGTH];
} USERDATA, *PUSERDATA;
USEREXIT userexit[3];
USERDATA userdata[3];
.
// Copy security exit names to other exits
// type is my exit's internal variable for the type of exit called
if (type == CHAD && pmqcxp->ExitReason == MQXR_AUTO_CLUSSDR)
{
long slen,elen;
//
// dump security exit name to debug output
//
slen = dump_exit_name(fp,pmqcd->SecurityExit,"SecurityExit");
//
// copy to MsgExit and change name
//
strncpy(userexit[0].ExitName,pmqcd->SecurityExit,slen);
strncpy(userexit[0].ExitName+slen-8,"Msg",3);
memset(userdata[0].ExitData,' ',MQ_EXIT_DATA_LENGTH);
pmqcd->MsgExitsDefined = 1;
pmqcd->MsgExitPtr = (char *)userexit[0].ExitName;
pmqcd->MsgUserDataPtr = (char *)userdata[0].ExitData;
//
// copy to RcvExit and change name
//
strncpy(userexit[1].ExitName,pmqcd->SecurityExit,slen);
strncpy(userexit[1].ExitName+slen-8,"Rcv",3);
memset(userdata[1].ExitData,' ',MQ_EXIT_DATA_LENGTH);
pmqcd->ReceiveExitsDefined = 1;
pmqcd->ReceiveExitPtr = (char *)userexit[1].ExitName;
pmqcd->ReceiveUserDataPtr = (char *)userdata[1].ExitData;
//
// copy to SendExit and change name
//
strncpy(userexit[2].ExitName,pmqcd->SecurityExit,slen);
strncpy(userexit[2].ExitName+slen-8,"Snd",3);
memset(userdata[2].ExitData,' ',MQ_EXIT_DATA_LENGTH);
pmqcd->SendExitsDefined = 1;
pmqcd->SendExitPtr = (char *)userexit[2].ExitName;
pmqcd->SendUserDataPtr = (char *)userdata[2].ExitData;
}
.
As you can see, the channel definition fields MsgExit ReceiveExit and
SendExit are not updated; it is the fields later in the structure
which point to a list of exit names and exit user data for each exit
type which are updated with the new exit names.
. |
|
Back to top |
|
 |
MB |
Posted: Fri Aug 20, 2004 12:56 am Post subject: Working CHAD Exit |
|
|
Acolyte
Joined: 25 Jun 2004 Posts: 52
|
Hi,
Thanks a lot.
Auto Defn exit is working fine now. The Code and Explanation you had posted helped a lot.
Regards,
MB. |
|
Back to top |
|
 |
MB |
Posted: Sun Aug 22, 2004 10:58 pm Post subject: |
|
|
Acolyte
Joined: 25 Jun 2004 Posts: 52
|
Hi,
If I have to read the current value of Message Exit , Do a check if blank or not and then change it accordingly, then how do I go about doing that?
strcpy(Initial_Exit_Name, pChannelDefinition->MsgExitPtr);
Does this statement return the exisiting value of MessageExit?
Thanks,
~MB |
|
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
|
|
|
|