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 Java / JMS » how to send/receive .pdf files through JMS

Post new topic  Reply to topic
 how to send/receive .pdf files through JMS « View previous topic :: View next topic » 
Author Message
suri
PostPosted: Wed Jun 09, 2004 4:41 pm    Post subject: how to send/receive .pdf files through JMS Reply with quote

Apprentice

Joined: 16 May 2004
Posts: 39
Location: NewYork

Hi

My requirement is, I am getting data in XML stream. Inside the XML stream will be a .pdf file. This XML stream needs to be retrieved from the Queue and stored in to database.

Can any one help me the best method to proceed.

Thanks in advance
Back to top
View user's profile Send private message Send e-mail
bduncan
PostPosted: Thu Jun 10, 2004 10:31 am    Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

First off, what do you mean "XML stream" ??? MQSeries doesn't support streaming. It is an asynchronous messaging system.
Second, why should MQSeries care if it is a PDF or any other type of file? The queue manager simply treats it as a bunch of bytes that get packaged into a message.
Now, assuming that messages are arriving on a queue, and those messages contain a bunch of bytes that represent a PDF file, you can write an application that simply gets the message from the queue, and assuming you have a BLOB column type in your database, take the byte array and insert it. It's as simple as that.
_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
exp
PostPosted: Thu Jun 10, 2004 11:26 am    Post subject: Reply with quote

Newbie

Joined: 13 May 2004
Posts: 9

First option:
Don't use xml at all.
Simply read the pdf into a byte array and send it using the JMS BytesMessage.
On the receiving end you can save the byte array as BLOB.
//
Second option:
Encode each byte of the pdf file as 2 chars (a hex representation).
Then pass the resulting string in some xml element
<tag>********************</tag>
using the body of a JMS TextMessage.
On the receiving end you decode it and save in a BLOB.
The problem with this method is that you actually double the size
of the transmitted file. Also you add data processing.
But, if you insist on xml ...
//
I think the first option is preferrable - but it's your choise.
Back to top
View user's profile Send private message
suri
PostPosted: Thu Jun 10, 2004 11:34 am    Post subject: Reply with quote

Apprentice

Joined: 16 May 2004
Posts: 39
Location: NewYork

Hi bduncan

Thanks a lot,

Could you please tell me sample program to retrieve data from the Qmanager and inserting into database(SQL).

Thanks
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Thu Jun 10, 2004 11:38 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

suri wrote:
Could you please tell me sample program to retrieve data from the Qmanager and inserting into database(SQL).


Have you looked at the available sample programs first?

Why not?

Have you searched here for "sample program"?

Why not?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
suri
PostPosted: Thu Jun 10, 2004 11:42 am    Post subject: Reply with quote

Apprentice

Joined: 16 May 2004
Posts: 39
Location: NewYork

Hi

All applications submitted online will be saved in an xml stream of data. This XML stream needs to be retrieved from the MQ Series and processed.

Thanks.
Back to top
View user's profile Send private message Send e-mail
bduncan
PostPosted: Thu Jun 10, 2004 5:57 pm    Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

Quote:
All applications submitted online will be saved in an xml stream of data. This XML stream needs to be retrieved from the MQ Series and processed.


Perhaps I'm not understanding you, but the above statement worries me. I'm not sure if you understand what MQSeries does. When you say applications (which I'm assuming are the PDFs) are submitted, they "will be saved in an xml stream" Where does this stream go? What sort of stream is it? What protocol is it using? And when you say "this XML stream needs to be retrieved from the MQ Series", I have to ask you, how is the XML stream getting translated into MQSeries messages which get placed on a queue in the first place?
_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
suri
PostPosted: Mon Jun 14, 2004 4:25 am    Post subject: Reply with quote

Apprentice

Joined: 16 May 2004
Posts: 39
Location: NewYork

Hi,

Thank you for your response.

I am also bit of confusion, actually the task I have to perform is

# Read messages from the MQ(request queue)
# Send status to MQ(Response Queue)
# Parse the xml and download the PDF
# Send the PDF to a printer
# Load the PDF into database.

This xml is in BLOB, pl.let me know how to proceed.

Thanks
Back to top
View user's profile Send private message Send e-mail
manoj
PostPosted: Mon Jun 14, 2004 5:45 am    Post subject: Reply with quote

Master

Joined: 30 Jan 2002
Posts: 237
Location: Virgina

By XML Stream do you mean the form data submitted from your online application is in the form of XML ?

From the order you have specified i could see that you want to send this XML to an MQ queue...an application listening to that queue will parse the XML and generate the PDF ..also will insert the PDF in to BLOB...

I don't understand why do you want to send the PDF?
_________________
-manoj
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
suri
PostPosted: Mon Jun 14, 2004 7:21 am    Post subject: Reply with quote

Apprentice

Joined: 16 May 2004
Posts: 39
Location: NewYork

manoj

Inside the XML stream will be a .PDF file that mimics the current application, all data fields entered into the online form will also included in this XML stream of data. This I need to be retrieved from the queue.

Thanks
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » how to send/receive .pdf files through JMS
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.