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 » General Discussion » MQSeries Channel Exit

Post new topic  Reply to topic
 MQSeries Channel Exit « View previous topic :: View next topic » 
Author Message
Graham Cogill
PostPosted: Wed May 19, 2004 10:36 pm    Post subject: MQSeries Channel Exit Reply with quote

Novice

Joined: 19 May 2004
Posts: 10
Location: UK

We are trying to create a DLL (written in C++) as an exit on a MQSeries channel. We can compile and make the dll but cannot get it to load despite following the instructions quoted in the IBM manual.

We are running MQSeries 5.3 csd6 on Windows 2K SP4

The exit is to modify the message to insert a transaction code (needed by IMS which is the destination)

This has become very urgent as we have been trying to resolve this issue for several weeks
Back to top
View user's profile Send private message
jsware
PostPosted: Thu May 20, 2004 12:01 am    Post subject: Reply with quote

Chevalier

Joined: 17 May 2001
Posts: 455

We'll need a little more help. What error codes etc. are you getting?
_________________
Regards
John
The pain of low quaility far outlasts the joy of low price.
Back to top
View user's profile Send private message
Graham Cogill
PostPosted: Thu May 20, 2004 1:36 am    Post subject: MQSeries Channel Exit Reply with quote

Novice

Joined: 19 May 2004
Posts: 10
Location: UK

Basically, we gutted an existing IBM sample - amqsqrma.c - and added code for the Microsoft C++ environment, as per "Intercommunications" manual - adding entry MQStart etc.
We cannot get past the load. We are getting AMQ6174 - cannot find library - though the path quoted in the message is correct. AMQ6174 is then followed by AMQ9535.
We can run the original amqsqrma dll - i.e. the channel is then "running" instead of "retrying".
Security access to the DLLs is inherited from the Exits folder, and is the same for both existing DLLs and the new one.
We have tried quoting the full path in the channel specification (MQSeries Explorer), without success.
The path is the default path for the queue manager - as per "Properties" in "MQServices".
We are however, producing this on a machine without MQSeries installed, which means copying one or two LIB files (which are actually not then referenced).
The DLL has the MsgExit entry point exported, and MQStart is the DLL entry point.
I was going to attach the dll but can't find a way of doing it
Back to top
View user's profile Send private message
JasonE
PostPosted: Thu May 20, 2004 2:41 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

You havent built it in debug mode have you? (debug dlls are only installed on the machine where the compiler is installed).

Run depends on the dll - can all associated imported dlls get found / loaded?
Back to top
View user's profile Send private message
Graham Cogill
PostPosted: Thu May 20, 2004 5:54 am    Post subject: Reply with quote

Novice

Joined: 19 May 2004
Posts: 10
Location: UK

We rebuilt the DLL with debug mode off, this time we get the following error

Instead of "cannot find the dll" we now have "AMQ6175 - could not load DLL - return code 1114"
Back to top
View user's profile Send private message
JasonE
PostPosted: Thu May 20, 2004 6:14 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

net helpmsg 1114 : A dynamic link library (DLL) initialization routine failed.

Write a simple program which does a loadlibrary("yourdll.dll"); and then getprocaddress for your proceedure - can you get that working. This is all MQ is doing for you.
Back to top
View user's profile Send private message
jed
PostPosted: Thu May 20, 2004 10:50 pm    Post subject: Reply with quote

Centurion

Joined: 08 Jan 2004
Posts: 118
Location: MI, USA

can u paste the .DEF file?
can u paste the MsgExit function? the header part where u make this function.

the MQ Intercommunications manual gives u a basic framework of how to create a channel exit and how to compile and make a DLL.
_________________
Jed
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Graham Cogill
PostPosted: Fri May 21, 2004 1:25 am    Post subject: Reply with quote

Novice

Joined: 19 May 2004
Posts: 10
Location: UK

This is the .DEF file

LIBRARY exit


PROTMODE

DESCRIPTION 'Provides Retry and Channel Exits'

CODE SHARED LOADONCALL
DATA NONSHARED MULTIPLE

HEAPSIZE 4096
STACKSIZE 8192

EXPORTS Retry

/********************************************************************/
/* Program Start. */
/* The entry MQStart is added as per "Intercommunications" manual */
/* MQStart must be made the entry point of the DLL */
/********************************************************************/
void MQStart() {;}
void MQENTRY MsgExit (PMQCXP pExitParms,
PMQCD pChannelDef,
PMQLONG pDataLength
PMQLONG pAgentBufferLength,
PMQVOID pAgentBuffer,
PMQLONG pExitBufferLength,
PMQCHAR *pExitBuffer)

Thanks
Back to top
View user's profile Send private message
Graham Cogill
PostPosted: Fri May 21, 2004 2:05 am    Post subject: Reply with quote

Novice

Joined: 19 May 2004
Posts: 10
Location: UK

Write a simple program which does a loadlibrary("yourdll.dll"); and then getprocaddress for your proceedure - can you get that working. This is all MQ is doing for you.

We tried that and got the same 1114 error
Back to top
View user's profile Send private message
jed
PostPosted: Fri May 21, 2004 3:58 am    Post subject: Reply with quote

Centurion

Joined: 08 Jan 2004
Posts: 118
Location: MI, USA

hhmm.....
u made a mistake on the .DEF file.....
shud be like this...

LIBRARY <program name>
PROTMODE
DESCRIPTION <description>
CODE SHARED LOADONCALL
DATA NONSHARED MULTIPLE
HEAPSIZE 4096
STACKSIZE 8192
EXPORTS MsgExit


You export the function that is being called by MQENTRY which is MsgExit.
And the LIBRARY is the your program that u coded.
lets say u have a program call MyMON.C, u'll have .DEF file shown below.

LIBRARY MYMON
DESCRIPTION "Channel exits"
EXPORTS MsgExit

to setup the .DLL do the following....

ALTER CHANNEL (<channel name>) CHLTYPE (<channel type>) MSGEXIT('<full path of the DLL>').

using the example above u do it by....

ALTER CHANNEL(<channel name>) CHLTYPE(<channel type>) MSGEXIT('C:\MyMON(MsgExit)')



I hope this helps........
_________________
Jed
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
jed
PostPosted: Fri May 21, 2004 4:11 am    Post subject: Reply with quote

Centurion

Joined: 08 Jan 2004
Posts: 118
Location: MI, USA

if u'r using VC++ to compile and link the program...
u do it on the command prompt via...


CL /MT /LD <program name> <definition file>


u shud be a-ok by then.......

any questions just drop by again.......
whew! i just finished setting up SSL today darn!

why is MQ so simple but darn complicated.... ha ha ha ha ha.....
_________________
Jed
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Graham Cogill
PostPosted: Mon May 24, 2004 12:17 am    Post subject: Reply with quote

Novice

Joined: 19 May 2004
Posts: 10
Location: UK

Many thanks for all your help. We have had some success now and have managed to get the exit to load.

We are now starting to code the routine and have a further query.

The exit is to connect a distributed application (version 2 MQMD) to the IMS Bridge, which only accepts Version 1 MQMD. How do you enforce this, as the MQMD in the transmission queue header is always version 1?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » MQSeries Channel Exit
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.