Author |
Message
|
hunterKillerz |
Posted: Wed Jun 30, 2010 8:53 pm Post subject: Reference Message in MQv7 |
|
|
 Apprentice
Joined: 16 Jun 2010 Posts: 40
|
Can I let the MQ or QM to specify the default output path instead of manually key in everytime i run the amqsprm.exe?
Can it be configure in qm.ini or in MsgExit or something?
appreciate if anyone could give me piece of advice=) |
|
Back to top |
|
 |
gbaddeley |
Posted: Thu Jul 01, 2010 3:25 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
amqsprm is a sample program. You can modify the source and recompile it to do whatever you want. _________________ Glenn |
|
Back to top |
|
 |
hunterKillerz |
Posted: Thu Jul 01, 2010 6:11 pm Post subject: |
|
|
 Apprentice
Joined: 16 Jun 2010 Posts: 40
|
gbaddeley wrote: |
amqsprm is a sample program. You can modify the source and recompile it to do whatever you want. |
Ya i have recompiled and make a vb6.0 version of amqsprm(with common dialog to browse for file)
As far I knew from my Boss on this project, he's going to send attachment like .zip or .jpeg from a dumb terminal to server. Due to every time I send attachment via reference message (amqsprm), I need to specify the destination file.
So , he said the destination path setting should only be configured on MQ(middleware) or on Server itself ...The sending program should just send without bothering where it will goes... any idea to achieve that?
I was thinking of modifying the message exit, specifying destination path on that program(amqsxrma.c). Is this the best way? |
|
Back to top |
|
 |
gbaddeley |
Posted: Thu Jul 01, 2010 10:54 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
You should be looking for a solution that does not require a MQ message exit. You need to have a common agreement on what the information in the RMH means to the source and destination parties, and where the attachment is actually located (maybe on a shared drive or server that is accessible to both parties). _________________ Glenn |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jul 02, 2010 4:51 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
hunterKillerz wrote: |
I was thinking of modifying the message exit, specifying destination path on that program(amqsxrma.c). Is this the best way? |
An exit is never the best way. For anything. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Jul 02, 2010 6:14 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Vitor wrote: |
hunterKillerz wrote: |
I was thinking of modifying the message exit, specifying destination path on that program(amqsxrma.c). Is this the best way? |
An exit is never the best way. For anything. |
Don't let Roger hear you talking like that! Exits are the perfect fit in some scenarios. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
jeevan |
Posted: Fri Jul 02, 2010 8:34 am Post subject: |
|
|
Grand Master
Joined: 12 Nov 2005 Posts: 1432
|
Vitor wrote: |
hunterKillerz wrote: |
I was thinking of modifying the message exit, specifying destination path on that program(amqsxrma.c). Is this the best way? |
An exit is never the best way. For anything. |
I think exits should be best way for at least one thing for which they were created /invented for. Are not they? |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jul 02, 2010 9:32 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
PeterPotkay wrote: |
Vitor wrote: |
hunterKillerz wrote: |
I was thinking of modifying the message exit, specifying destination path on that program(amqsxrma.c). Is this the best way? |
An exit is never the best way. For anything. |
Don't let Roger hear you talking like that! Exits are the perfect fit in some scenarios. |
I apologise for my overly broad statement!
Allow me to rephrase - a home-grown exit is never the best way for anything. All the useful exits are available commercially (including Roger's excellent products and those of our hosts). _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
hunterKillerz |
Posted: Sun Jul 04, 2010 5:43 pm Post subject: |
|
|
 Apprentice
Joined: 16 Jun 2010 Posts: 40
|
Thanks for the comments.
So, guys, Shall i proceed to use exit to alter my destination path or there's any other way round to configure the destination path at receiving side? through your experiences. |
|
Back to top |
|
 |
hunterKillerz |
Posted: Sun Jul 04, 2010 5:47 pm Post subject: |
|
|
 Apprentice
Joined: 16 Jun 2010 Posts: 40
|
I will explain what I need and let you guys to discuss about it.
I've already built a simple file transfer program using vb6.0 by referring to amqsprm.c.(reference message)
I have a file dialog browse for source file, and then i typed in the destination file path, and put to Q.
And It worked out. It just that my boss said the program should do sending only, w/o the need to specify destination path whenever we send, then i said, I can hard-code the destination path in that program instead of user input. But he said, what if i need to change the path again?
So basically, he dont want the sending side to bother the destination path, he's asking me whether we can configure that on MQ or WMQ or not... |
|
Back to top |
|
 |
hunterKillerz |
Posted: Sun Jul 04, 2010 5:48 pm Post subject: |
|
|
 Apprentice
Joined: 16 Jun 2010 Posts: 40
|
How I coded in my sending program?
-------------------------------------------
I manually add in the SourceName and DestName variable into type MQRMH in cbmq.bas.
Both of them are in fixed string form: String * 256
Den I create a function to calculate their offset position in MQRHM type. And I use len() function to mimic the function sizeof() in C.
I set all the properties of MQRHM accordingly, and lastly MQPUT1Any() to a remote queue on machine1 sending to machine2.
This is how i coded in my vb6.0 program. |
|
Back to top |
|
 |
Vitor |
Posted: Sun Jul 04, 2010 6:54 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
hunterKillerz wrote: |
I've already built a simple file transfer program using vb6.0 by referring to amqsprm.c.(reference message) |
Why? WMQ FTE is a perfectly circular wheel that not only does what you want but already does what you're trying to do.
It also overcomes all the file transfer over WMQ problems you haven't hit yet with your simple program but will hit in the future as your boss keeps adding requirements (as he's done with the hard coded path).
And before you say "we don't want to spend more money on this", ask yourself how much your time has cost so far, how much these changes will cost & how much future maintenance will cost.
Or alternatively Google "Total Cost of Ownership".  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
hunterKillerz |
Posted: Mon Jul 05, 2010 11:18 pm Post subject: |
|
|
 Apprentice
Joined: 16 Jun 2010 Posts: 40
|
Its ok, I got it to compile through command line already, just put all mq lib and header file into Microsoft Visual Studio C++ directory folder\LIB and \INCLUDE, just to post here if anyone who meet the same problem in the future, can read this out.
And I've successfully modified the message exit program alter/configure the destination path through reading INI file.
Again, thanks for the responses from MQ guys in this forum  |
|
Back to top |
|
 |
exerk |
Posted: Tue Jul 06, 2010 1:08 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
hunterKillerz wrote: |
Its ok, I got it to compile through command line already, just put all mq lib and header file into Microsoft Visual Studio C++ directory folder\LIB and \INCLUDE, just to post here if anyone who meet the same problem in the future, can read this out.
And I've successfully modified the message exit program alter/configure the destination path through reading INI file.
Again, thanks for the responses from MQ guys in this forum  |
So, which wheel are you going to reinvent next?  _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
gbaddeley |
Posted: Tue Jul 06, 2010 3:36 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Quote: |
Its ok, I got it to compile through command line already, just put all mq lib and header file into Microsoft Visual Studio C++ directory folder\LIB and \INCLUDE |
This is not the correct way to do it. The MQ lib directory should be added to the LIB environment variable, and the MQ include directory should be added to the INCLUDE environment varialbe. _________________ Glenn |
|
Back to top |
|
 |
|