Author |
Message
|
hunterKillerz |
Posted: Wed Jun 16, 2010 9:36 pm Post subject: File Transfer via MQ |
|
|
 Apprentice
Joined: 16 Jun 2010 Posts: 40
|
I am working on sending image file (example: .jpg) across MQ.
What i did was reading the image file to streams of bytes.
Then try to put to a local queue (Q1) with VB6.0 application.
Here's the problem, should i convert the byte array to string before putting to queue? or just leave it and put to queue w/o conversion.
If i put byte array to queue:
--------------------------------
Do i need to set .format to MQMO_NONE while putting/getting message to/from queue?
how to make sure that i will receive the byte array from queue w/o any character conversion?
Then, I was trying to get the 'message' from queue and write it back to file store in disk.
I've tried everything but It seems to fail to reform back d image file.
Any guide would be appreciated! thanks in advance.! |
|
Back to top |
|
 |
gbaddeley |
Posted: Wed Jun 16, 2010 11:48 pm Post subject: Re: File Transfer via MQ |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
hunterKillerz wrote: |
..should i convert the byte array to string before putting to queue? |
No, just put the byte array as the message data.
Quote: |
Do i need to set .format to MQMO_NONE while putting/getting message to/from queue? |
Format only needs to be set to NONE on the put. This is actually the default if you don't set it.
Quote: |
how to make sure that i will receive the byte array from queue w/o any character conversion? |
If the Format of the source message is NONE, MQ will never do any conversion. Therefore no special code is required in the receiving program. _________________ Glenn |
|
Back to top |
|
 |
hunterKillerz |
Posted: Thu Jun 17, 2010 12:08 am Post subject: |
|
|
 Apprentice
Joined: 16 Jun 2010 Posts: 40
|
Ok. i got what you mean, but how about the length of message?
Code: |
MQPUT gHcon, gHobj, md, pmo, filelen("filename"), b, CompCode, Reason
|
Should it be d file size of the image file?
So, how about when i wanna to get it back with MQGET, d default MQGET would be:
Code: |
buflen = CCHBUFFER
MQGET gHconG, gHobjG, md, gmo, buflen, Buffer, messlen, CompCode, Reason
|
the Buffer on MQGET would be a fixed-string with CCHBUFFER = 100 right?
any thing i need to be concern with MQGET part? |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu Jun 17, 2010 12:28 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi hunterKillerz,
I would assume that every customer has not only image transfer requirements but also lots of files and batch processing.
Ask the customer to invest in MQ FTE agents and invoke the image transfer via any application (VB).
The reason I suggest this is that if you do images today, tomorrow the customer might expect you to do bigger files tomorrow. FTE will prevent network clogging and overloading of MQ, which will be too much for custom code to handle.
Regards. |
|
Back to top |
|
 |
hunterKillerz |
Posted: Thu Jun 17, 2010 12:34 am Post subject: |
|
|
 Apprentice
Joined: 16 Jun 2010 Posts: 40
|
elvis_gn wrote: |
Hi hunterKillerz,
I would assume that every customer has not only image transfer requirements but also lots of files and batch processing.
Ask the customer to invest in MQ FTE agents and invoke the image transfer via any application (VB).
The reason I suggest this is that if you do images today, tomorrow the customer might expect you to do bigger files tomorrow. FTE will prevent network clogging and overloading of MQ, which will be too much for custom code to handle.
Regards.
|
Yes, i understand what you mean. I myself have tested the MQ FTE v7 out too. It works great.
But I would like to try something out to extend my knowledge on MQ-Based File transfer Application.
Because I was having internship now, still a college student  |
|
Back to top |
|
 |
RogerLacroix |
Posted: Thu Jun 17, 2010 11:22 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
hunterKillerz wrote: |
Because I was having internship now, still a college student  |
Well then, have a look at the open source project: MQ File Mover
If you have time, then you can improve on it.
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
hunterKillerz |
Posted: Fri Jun 18, 2010 11:02 pm Post subject: Re: File Transfer via MQ |
|
|
 Apprentice
Joined: 16 Jun 2010 Posts: 40
|
gbaddeley wrote: |
hunterKillerz wrote: |
..should i convert the byte array to string before putting to queue? |
No, just put the byte array as the message data.
Quote: |
Do i need to set .format to MQMO_NONE while putting/getting message to/from queue? |
Format only needs to be set to NONE on the put. This is actually the default if you don't set it.
Quote: |
how to make sure that i will receive the byte array from queue w/o any character conversion? |
If the Format of the source message is NONE, MQ will never do any conversion. Therefore no special code is required in the receiving program. |
Thanks for the info, gbaddeley. at least it clears some of my doubts=).
Yeah i did do according what you have told, "Format only needs to be set to NONE on the put".
But in the get application, the default MQGET output is in string format, So how can i get a byte array instead of string? (i was working on VB6.0)
I have tried MQGETX or MQGETANY, none of them shows what i want.
Hope you could reply me ^^ |
|
Back to top |
|
 |
hunterKillerz |
Posted: Tue Jun 22, 2010 5:21 pm Post subject: |
|
|
 Apprentice
Joined: 16 Jun 2010 Posts: 40
|
can anyone here guide me how to specify a message exit at both ends of a channel?
I've found a guide via MR. GOOGLE, does it involve copying .dll file from ../C/bin to message exit folder?
note: was trying to do reference message now. |
|
Back to top |
|
 |
exerk |
Posted: Tue Jun 22, 2010 11:14 pm Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
hunterKillerz wrote: |
can anyone here guide me how to specify a message exit at both ends of a channel?
I've found a guide via MR. GOOGLE, does it involve copying .dll file from ../C/bin to message exit folder?
note: was trying to do reference message now. |
You have an uncanny knack of asking new questions which are totally unrelated to the original subject; I have already split one of your threads and I have no wish to do so with another
I strongly suggest you read the posts in THIS forum and also THIS one, then search the complete site before posting again.
And if you do have a new, and unrelated, question to ask - start a new thread! _________________ 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 |
|
 |
hunterKillerz |
Posted: Tue Jun 22, 2010 11:28 pm Post subject: |
|
|
 Apprentice
Joined: 16 Jun 2010 Posts: 40
|
I thought i'd lost my thread "connection count in mq series" , thanks for splitting out for me.
This will not happen again. =) |
|
Back to top |
|
 |
|