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 » IBM MQ API Support » Read file contents from queue

Post new topic  Reply to topic
 Read file contents from queue « View previous topic :: View next topic » 
Author Message
gh
PostPosted: Sat Aug 12, 2006 2:22 am    Post subject: Read file contents from queue Reply with quote

Novice

Joined: 12 Aug 2006
Posts: 14
Location: eq

I've a Queue which contains a file, I want to read the contents of the file in my VB.NET program.
Can someone tell me how can I use the mqftrcvc command in my vb.net code?
Is there any .NET class available to perform File Transfer ?

Thanks
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
leehairy
PostPosted: Sun Aug 13, 2006 6:11 am    Post subject: Reply with quote

Novice

Joined: 04 Aug 2006
Posts: 13

mqftrcvc is a command line tool.

There is no reason to try and invoke 'mqftrcvc' from within a VB program. This would be overkill

If your queue contains the contents of a file. You have the file already available. Call one of the MQMessage methods such as ReadString or ReadBytes etc and you will have a copy of the file in memory
Back to top
View user's profile Send private message
gh
PostPosted: Sun Aug 13, 2006 10:46 pm    Post subject: Read file contents from queue Reply with quote

Novice

Joined: 12 Aug 2006
Posts: 14
Location: eq

Thanks for reply.

I've used ReadString method but that's given me some header information also with the contents of file.I don't want any extra information I just want the exact contents of file.
Format of message on queue is 'MQHRF2'

My file contains information like this:
Msg1
Msg2
Msg3
Msg4

But Readstring fetching it like this:

RFH  @ " &#9569; &#9557;  <MQFT><MQFT_REJECT_UNSUPPORTED><FORMAT>BINARY</FORMAT><LAST>Y</LAST><FILENAME>first.txt</FILENAME><OFFSET>0</OFFSET><ORIGINAL_LENGTH>22</ORIGINAL_LENGTH></MQFT_REJECT_UNSUPPORTED><MQFT_ACCEPT_UNSUPPORTED><DIR>\TestMQ</DIR><ORIG_QMGR></ORIG_QMGR></MQFT_ACCEPT_UNSUPPORTED></MQFT> Msg1
Msg2
Msg3
Msg4
_________________
rewrw
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
zpat
PostPosted: Sun Aug 13, 2006 11:23 pm    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Make sure your messages have MQMD.Format = "MQSTR".
Back to top
View user's profile Send private message
gh
PostPosted: Mon Aug 14, 2006 12:12 am    Post subject: Read file contents from queue Reply with quote

Novice

Joined: 12 Aug 2006
Posts: 14
Location: eq

Message format would not be "MQSTR" when a file resides on Queue
Our client want us to read contents of file which is available on Queue.They will put the whole File on Queue then we have to read the contents of that file in our program.
_________________
rewrw
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Vitor
PostPosted: Mon Aug 14, 2006 12:47 am    Post subject: Reply with quote

Grand High Poobah

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

If that's the format, they're adding it with an RFH2 header, which it the extra information you're getting. You'll need to write a snippet of code to deal with it.

Do a search through this forum - it's been discussed a few times.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Aug 14, 2006 1:46 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Hey, gh.

A "file" is just a stream of bytes on disk.

So when you put a "file" on a "queue", what you have is a stream of bytes on a queue.

A stream of bytes on a queue is called a "message".
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
gh
PostPosted: Mon Aug 14, 2006 2:04 am    Post subject: Read file contents from queue Reply with quote

Novice

Joined: 12 Aug 2006
Posts: 14
Location: eq

Thanks Vitor and jefflowrey
I just want to confirm that there is no way to get the message body without this header information.
I can remove this extra info in my program but I'm not sure whether this information will be consistent or it could be different..
_________________
rewrw
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
jefflowrey
PostPosted: Mon Aug 14, 2006 2:07 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The MQRFH2 is in the body of the message. You can't get the body of the message without getting the MQRFH2.

The MQRFH2 is supposed to be in the body of the message.

I think you need to process this header, rather than throw it away. I suspect you need to do more with it than just extract the file name - like decide if the file is supported or not and then decide if you need to reject if unsupported and etc.
_________________
I am *not* the model of the modern major general.
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 » IBM MQ API Support » Read file contents from queue
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.