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 IBM MQ Support » Get the name of the transfered file

Post new topic  Reply to topic Goto page 1, 2  Next
 Get the name of the transfered file « View previous topic :: View next topic » 
Author Message
Bahan
PostPosted: Mon Jul 17, 2006 4:26 am    Post subject: Get the name of the transfered file Reply with quote

Apprentice

Joined: 16 Jul 2006
Posts: 47
Location: France

Hi again everyone.

I'm wondering how, on my receiver server, I can get the name of the file I sent from my sender server.

I tried to use amqsbcg on my receiver server, but I didn't see the name of my file among all the displayed parameters.

I don't know if it is or not an easy question about MQseries. Maybe it is possible to find somewhere a guide listing every MQseries functions ?

I'm sorry if it is an easy question.

Already thank you for your answers.

Bahan
_________________
Close the world.||.txen eht nepO


Last edited by Bahan on Mon Jul 17, 2006 6:12 am; edited 1 time in total
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Jul 17, 2006 4:34 am    Post subject: Reply with quote

Grand High Poobah

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

Are you talking about Reference Messages? If so, it should be in the MQRMH structure; though my knowledge of this is more theoretical & should be taken with a pinch of salt .

There's quite a bit about moving bulk data by Reference Message (and the structure of the MQRMH) in the online help:
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp

You might get a guide there.

Not actually used it in anger myself you see.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Bahan
PostPosted: Mon Jul 17, 2006 4:53 am    Post subject: Reply with quote

Apprentice

Joined: 16 Jul 2006
Posts: 47
Location: France

Hum, what do you mean by reference message ? ^_^

In fact, I have a file named testBahan.txt that I sent from my sender server. And I want to get this name when I receive the message on my receiver server.

Already thank you for your answer.

Bahan
_________________
Close the world.||.txen eht nepO
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Jul 17, 2006 5:11 am    Post subject: Reply with quote

Grand High Poobah

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

Ah - reference messages are a way (not approved of by all I think) of moving files round in MQ Series. It was my assumption that you were using these to move the file you refered to. I was in error and I apologise

Do you instead mean that you have a file called testBahan.txt which you have used as input to a Java equivalent of amqsput to populate the target queue? If so, the file name is not transferred because all MQ can see is the contents of the file expressed as messages.

The best you'll get at the receiving end is the name of the sending application. It's possible (using custom code) to record some details (like original file name) in the MQMD accounting fields, or perhaps as a user - defined header to the message depending on your requirements.

If I still have the stick by the wrong end please accept my continuing apologies and correct me further.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Bahan
PostPosted: Mon Jul 17, 2006 5:16 am    Post subject: Reply with quote

Apprentice

Joined: 16 Jul 2006
Posts: 47
Location: France

No problem.

Quote:
Do you instead mean that you have a file called testBahan.txt which you have used as input to a Java equivalent of amqsput to populate the target queue?


Exactly.

Quote:
If so, the file name is not transferred because all MQ can see is the contents of the file expressed as messages.


Ok, I will see how I can do. In fact, my problem is really annoying, because I can't modify even one thing in the sender part .

Thank you for your help.

Bahan
_________________
Close the world.||.txen eht nepO
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Jul 17, 2006 5:25 am    Post subject: Reply with quote

Grand High Poobah

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

Bahan wrote:
In fact, my problem is really annoying, because I can't modify even one thing in the sender part .



This is often the way.

If you want to post details of your requirements then maybe we can offer some suggestions as to a possible design?

If you're trying to move a file over MQ, be aware that there are a number of commercial offerings that do this. They are a better wheel than you're likely to reinvent!
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
PieterV
PostPosted: Mon Jul 17, 2006 5:34 am    Post subject: Reply with quote

Disciple

Joined: 04 Jan 2006
Posts: 164
Location: Belgium

If your budget allows you to, you can always use IBM Message Broker in combination with the JText Adapter.

That adapter can pick up a file, (and remembers the file name), put it on a queue.
In the message broker you can change your message (if you mean that by changing the sender part) and transfer it to another queue (or whatever output method you require).
You can output it again to a file using the JText Adapter.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Jul 17, 2006 5:40 am    Post subject: Reply with quote

Grand High Poobah

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

PieterV wrote:
If your budget allows you to...


I should have emphasied that the commercial solutions to which I referred (of which this is an excelent example) do require the payment of additional sums of money!

There's also a question mark raised by your assertion that
Bahan wrote:

In fact, my problem is really annoying, because I can't modify even one thing in the sender part .


If you can't change anything on the sender side then you will need the kind of non-invasive solution PieterV has suggested, rather than PM4Data or similar.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Bahan
PostPosted: Mon Jul 17, 2006 5:47 am    Post subject: Reply with quote

Apprentice

Joined: 16 Jul 2006
Posts: 47
Location: France

This is strange because on another queue MyQueue1, I have as header the name of the source file and for this queue MyQueue2, I don't have anything...

I'll see if I really can't modify something on the sender server.

Thank you for your help!

Bahan
_________________
Close the world.||.txen eht nepO
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Jul 17, 2006 5:50 am    Post subject: Reply with quote

Grand High Poobah

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

Bahan wrote:
This is strange because on another queue MyQueue1, I have as header the name of the source file and for this queue MyQueue2, I don't have anything...



Do you mean it's in the header i.e. the MQMD or a header as in on the front of the message? In both cases the sending side can achieve this through code. If it's in the MQMD exactly where?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Bahan
PostPosted: Mon Jul 17, 2006 6:03 am    Post subject: Reply with quote

Apprentice

Joined: 16 Jul 2006
Posts: 47
Location: France

Hum, I think it is on the beginning of my message bacause it appears when I display my message.

Here is my message when I do a printf :

Code:
[M+,FD:PathAndNameOfMyFile,MN:0
Line1OfMyFile
Line2OfMyFile
]


Bahan
_________________
Close the world.||.txen eht nepO
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Jul 17, 2006 6:09 am    Post subject: Reply with quote

Grand High Poobah

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

Then it's almost certainly being inserted by the sender code. I don't recognise the format as an MQ one, though I stand ready to be corrected on this (anyone?)

Why on one and not the other? Ask the guy who wrote the code......?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Bahan
PostPosted: Mon Jul 17, 2006 6:11 am    Post subject: Reply with quote

Apprentice

Joined: 16 Jul 2006
Posts: 47
Location: France

If only I could but he is not there anymore, and for long ago .

A big thank you for your help.

Bahan
_________________
Close the world.||.txen eht nepO
Back to top
View user's profile Send private message
Bahan
PostPosted: Mon Jul 17, 2006 6:24 am    Post subject: Reply with quote

Apprentice

Joined: 16 Jul 2006
Posts: 47
Location: France

I have another question (tadaaa ).
And what about the MSGID ? I can't use that ?

Bahan
_________________
Close the world.||.txen eht nepO
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Jul 17, 2006 6:41 am    Post subject: Reply with quote

Grand High Poobah

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

Bahan wrote:
And what about the MSGID ? I can't use that ?


To identify a given message? Certainly. As a Xmas decoration? Less use.

To identify the source file name? (Another assumption here - accept a pre-emptive apology)

Short answer:

It's a generated field. More importantly it's not a string, it's a 24 byte array. It's not converted between code pages and may have nulls at any position within it which will confuse your C program.

Longer answer:

If you want to use it as provided it will tell you nothing about the source of the message. It's a generated 24 byte field which should be unique within the scope of your MQ installation if you don't want bad things to start happening.

If you're going to insert data into it, don't. Because it's a byte field, attempts to use it to contain string or other data are not doomed to fail, but the omens are bad. Use the provided Accounting fields (which I think I suggested earlier) to store stuff in the MQMD. This would require a change at the sender end & is not necessarially recommended. I suspect this is why the information is turning up appended to the file data in the front of the message - good safe place to put it.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 IBM MQ Support » Get the name of the transfered file
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.