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 » Capture file name with MQGET

Post new topic  Reply to topic Goto page 1, 2  Next
 Capture file name with MQGET « View previous topic :: View next topic » 
Author Message
yani03
PostPosted: Mon Apr 03, 2017 10:22 am    Post subject: Capture file name with MQGET Reply with quote

Newbie

Joined: 03 Apr 2017
Posts: 8

Hello all,

New to this forum, so I hope I'm posting in the correct place. I have a visual C++ application that pulls file data using MQGET calls from files loaded on the queue.

I'm hoping there is an option that can be set in one of the parameters to capture the filename in the buffer, that the data is being pulled from? We used to save the buffer data to file based on a substring within the buffer, but this won't be possible anymore with the data provided.

Any advice would be great.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Apr 03, 2017 10:27 am    Post subject: Re: Capture file name with MQGET Reply with quote

Grand High Poobah

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

yani03 wrote:
I have a visual C++ application that pulls file data using MQGET calls from files loaded on the queue.


You don't load files onto a queue; you put messages on a queue. If the payload of the message was the contents of a file before it was the payload of a message, that's just dandy but is nothing to do with MQ.

yani03 wrote:
I'm hoping there is an option that can be set in one of the parameters to capture the filename in the buffer, that the data is being pulled from?


If you mean, "is there an option to record the file name that the payload data used to live in so we get the file name and the payload when we do an MQGET", then yes - set the file name as a message property when you put the message.

If you mean something else, please restate the question.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
yani03
PostPosted: Mon Apr 03, 2017 10:30 am    Post subject: Reply with quote

Newbie

Joined: 03 Apr 2017
Posts: 8

Thanks Vitor, that's exactly what I was asking. Unfortunately I don't have any control over the queue on the other end where the message is being PUT, and it sounds like that is the only way to reserve the name of the file?
Back to top
View user's profile Send private message
yani03
PostPosted: Mon Apr 03, 2017 10:32 am    Post subject: Reply with quote

Newbie

Joined: 03 Apr 2017
Posts: 8

yani03 wrote:
Thanks Vitor, that's exactly what I was asking. Unfortunately I don't have any control over the queue on the other end where the message is being PUT, and it sounds like that is the only way to reserve the name of the file?


To clarify, the messages are PUT to the queue by a third party, and that queue is hosted by a 2nd party, both independent of me.
Back to top
View user's profile Send private message
yani03
PostPosted: Mon Apr 03, 2017 10:46 am    Post subject: Re: Capture file name with MQGET Reply with quote

Newbie

Joined: 03 Apr 2017
Posts: 8

Vitor wrote:
yani03 wrote:
I have a visual C++ application that pulls file data using MQGET calls from files loaded on the queue.


You don't load files onto a queue; you put messages on a queue. If the payload of the message was the contents of a file before it was the payload of a message, that's just dandy but is nothing to do with MQ.

yani03 wrote:
I'm hoping there is an option that can be set in one of the parameters to capture the filename in the buffer, that the data is being pulled from?


If you mean, "is there an option to record the file name that the payload data used to live in so we get the file name and the payload when we do an MQGET", then yes - set the file name as a message property when you put the message.

If you mean something else, please restate the question.


If I can get the filename set as a message property, do I need to set any certain parameter option in the MQGET call, or will it come across in the message itself?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Apr 03, 2017 10:58 am    Post subject: Reply with quote

Grand High Poobah

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

You may need to set the gmo option PROPERTIES_IN_HANDLE and enumerate the properties until you find the right one? ...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Mon Apr 03, 2017 11:01 am    Post subject: Re: Capture file name with MQGET Reply with quote

Grand High Poobah

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

yani03 wrote:
If I can get the filename set as a message property, do I need to set any certain parameter option in the MQGET call, or will it come across in the message itself?


It's a message property not part of the message. You need to correctly specify the MsgHandle in the MQGMO structure as described here.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
yani03
PostPosted: Mon Apr 03, 2017 12:50 pm    Post subject: Reply with quote

Newbie

Joined: 03 Apr 2017
Posts: 8

Thank you both for your help. Any idea what the earliest version of MQ the GQMO_PROPERTIES_IN_HANDLE option was available? I'm on Version 6.0.0.0 and I don't see this option in my cmqc.h header file.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Apr 03, 2017 3:37 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

A simple search on google for 'MQ message properties' would have answered this question.

http://www.redbooks.ibm.com/redbooks/pdfs/sg247583.pdf
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Mon Apr 03, 2017 3:56 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2492
Location: Melbourne, Australia

yani03 wrote:
Thank you both for your help. Any idea what the earliest version of MQ the GQMO_PROPERTIES_IN_HANDLE option was available? I'm on Version 6.0.0.0 and I don't see this option in my cmqc.h header file.

The base Version 6? I find that remarkable. Even though this is many years out of support, I would have expected an upgrade would have occurred to 6.0.2 + a recent FixPack level.

MQ messages don't have any concept of "file name". It is up to the producer app and consumer app to agree on a requirement for passing a file name, whether its in the message data, a message property, or a user-settable MQMD field (will have very limited length).
_________________
Glenn
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Apr 04, 2017 4:41 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

What's a 'file'?

Is this something that sits on a personal workstation and holds non-business critical data in a relatively unsecured environment that doesn't need to move between separate applications?
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 04, 2017 5:17 am    Post subject: Reply with quote

Grand High Poobah

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

yani03 wrote:
Thank you both for your help. Any idea what the earliest version of MQ the GQMO_PROPERTIES_IN_HANDLE option was available?


MQv7. You'll need to use an RFH2.

yani03 wrote:
I'm on Version 6.0.0.0 and I don't see this option in my cmqc.h header file.


Do you have any idea how out of date (and out of support) that is? More importantly, do you have any idea how much risk your organization is carrying that the next OS / firmware / other upgrade will cause it to fail? Has anyone in your organization signed off on that risk?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
yani03
PostPosted: Tue Apr 04, 2017 5:24 am    Post subject: Reply with quote

Newbie

Joined: 03 Apr 2017
Posts: 8

mqjeff wrote:
What's a 'file'?

Is this something that sits on a personal workstation and holds non-business critical data in a relatively unsecured environment that doesn't need to move between separate applications?



Sorry I said 'file' I'm not that familiar with MQ. It's built into a C++ windows application that I did not write, but am now maintaining. The messages are being transported across the country.

I'm trying to figure out how to capture the filename that the messages are originating from. It sounds like I need to update versions and create a message handle to collect the properties of the message.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 04, 2017 5:33 am    Post subject: Reply with quote

Grand High Poobah

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

yani03 wrote:
It sounds like I need to update versions and create a message handle to collect the properties of the message.


You need to update the version for far more reasons than collecting the file name (which you can do with an RFH2, the predecessor of the message properties). My most worthy associate has very particular views on files, which while correct, do not fit into the more pragmatic world the rest of us are forced to endure.

But 6.0.0.0 is hideously out of date. Someone needs to sign off on that risk before it blows up in your face, or a very urgent update project needs to be started.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Tue Apr 04, 2017 8:50 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9394
Location: US: west coast, almost. Otherwise, enroute.

Are you saying that the source data originates in a file in a filesystem, and that an upstream app reads the file and converts the source data to MQ messages? Or, are you saying that an upstream app creates a message with the data component is a file?

Why do you need to know the name of the source file?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
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 » General Discussion » Capture file name with MQGET
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.