Author |
Message
|
Roby |
Posted: Wed Oct 25, 2006 5:49 am Post subject: Problem with MQPUT |
|
|
Newbie
Joined: 25 Oct 2006 Posts: 3
|
Hi! I'm experiencing troubles working with MQ series via Visual Basic 6. The problem is that when I pass a MessageDescriptor as a parameter with custom values I found them changed when I come back from the MQPUTX function/API. Have someone experienced some kind of troubles yet?
Thanks
Roby |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Oct 25, 2006 5:59 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Um.
The MQMD is supposed to get updated after the Put.
It's how you find out, for example, what the automatically generated MsgId of your message was, so you can then use that as a Correlation ID for retrieving a reply.
It's also why you have to always clear the MQMD between GETs, so you aren't implicitly asking for a GET match by MsgId. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Oct 25, 2006 5:59 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Before anyone else says it, VB6 is depreciated & shouldn't be used - VB .NET is the thing now.
Having said that, what "custom values" are you trying to use? What do they change to and from? By MQPUTX do you mean the standard MQPUT/MQPUT1 or the XMS interface? Does the MQPUT actually work or does it return a code? Have you looked at the sample code provided and examined the documentation? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Roby |
Posted: Wed Oct 25, 2006 6:38 am Post subject: |
|
|
Newbie
Joined: 25 Oct 2006 Posts: 3
|
Vitor wrote: |
Before anyone else says it, VB6 is depreciated & shouldn't be used - VB .NET is the thing now.
|
Yes, but the project I'm working on is VB6, so I can't do anything else...
Vitor wrote: |
what "custom values" are you trying to use?
|
I need that the PutApplName and UserIdentifier are those I'm putting on the queue because the application to be invoked is that and the user granted to do this is that I'm sending!
Vitor wrote: |
What do they change to and from?
|
The PutApplName becomes the name of the Visual Basic 6 executable and the UserIdentifier becomes the user logged onto my computer!
Vitor wrote: |
By MQPUTX do you mean the standard MQPUT/MQPUT1 or the XMS interface?
|
Sorry but I'm a newbie on MQ and don't know the difference, I can say only that I've started working on it form the examples included in the prog, so it's that.
Vitor wrote: |
Does the MQPUT actually work or does it return a code?
|
It works, but it seems to send wrong datas on the queue and I get an error response about the syntax of this request. I've compared a request done with VB and one done with an AS400 application and I've found that the user and the program had changed and the syntax of request having a different header. In the AS400 there are the right params but in mine request there are my username and the vb6 executable path!
Vitor wrote: |
Have you looked at the sample code provided and examined the documentation?
|
Yes but didn't found nothing helping me solve this prob and so I wrote! Going crazy on it....
Hope to have explained well my prob, but not so sure...
Thanks again!
Roby |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Oct 25, 2006 6:46 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
Vitor |
Posted: Wed Oct 25, 2006 7:11 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Roby wrote: |
I need that the PutApplName and UserIdentifier are those I'm putting on the queue because the application to be invoked is that and the user granted to do this is that I'm sending!
|
See my honoured associate's comments above. Functioning as designed on a distributed platform.
It's also a uncommon user of those fields. How can "PutApplName", i.e. the name of the program that put the message, be interpreted in a sane system as the name of the program that's to read it off? As you can't find out that value until you've read the message with something....
Also, and more importantly, it's best practice to let the receiving end specify how they process the message. They may write a new & better program with a different name one day. And it's tiresome to have all the putting programs rewritten to specify the new name!
As to the user id - this specifies the user name to be used to run the program at the receiving end? With no password or verification? Run it on a Unix box with "root" in that field & you'll make some friends, especially if you're specifiying what to run in the application field. "rm *.* -r" would be fun run as root....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Roby |
Posted: Wed Oct 25, 2006 8:30 am Post subject: |
|
|
Newbie
Joined: 25 Oct 2006 Posts: 3
|
Thanks to all, I solved...at least he MQPUT trouble!
Now I'm fighting with the limit of the "depreciated & not to be used" VB 6 const maximum length to set the buffer size to get the respense, but tomorrow it's another day...thanks again!
Bye!
Roby |
|
Back to top |
|
 |
|