You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by aguestrush <ag...@gmail.com> on 2009/07/16 02:59:57 UTC

How to transfer a document like xml or txt using qpidclient?

hello,

I want to write a client to transfer some files such as .xml to another client,there is a example but I want a example which have a function that if I use the name of the file as one parameter of the function,the file will be transfered.How can I use the client API to implement this problem.

2009-07-16 



aguestrush 

Re: How to transfer a document like xml or txt using qpidclient?

Posted by Waltenhares <wa...@yahoo.com.br>.
John Dennis,

Can you share with me you code? Are you using persistent messages for file
transfer?

Thanks,
Waltenhares


John Dennis wrote:
> 
> On 07/15/2009 08:59 PM, aguestrush wrote:
>> I want to write a client to transfer some files such as .xml to another
>> client,there is a example but I want a example which have a function that
>> if I use the name of the file as one parameter of the function,the file
>> will be transfered.How can I use the client API to implement this
>> problem.
> 
> I have code that does file transfers, however I get the feeling it's
> more than you might want/need. It's designed for Linux systems and
> transfers all the metadata associated with a file as well as the file
> contents (e.g. ownership, permissions, extended attributes, etc.). It
> also is capable of transferring large files in chunks and compressing
> the file contents prior to transmission and then uncompressing it upon
> receipt. I can share the code if there is interest, but like I said I it
> may be way more than you need.
> 
> If all you want to do is transfer a simple file of reasonable size then
> it's trivial with AMQP.
> 
> On the sending side:
> 
> 1) Add the filename to the application headers in the message.
> 2) Open the file, read it's contents into a string, set the string as
> the message.
> 
> On the receive side:
> 
> 1) Get the filename from the application headers
> 2) Open the file for writing and write the message.
> 
> Each side is about 5 lines of C++ code.
> 
> How to do C++ file IO is left as an exercise for the reader :-)
> 
> -- 
> John Dennis <jd...@redhat.com>
> 
> Looking to carve out IT costs?
> www.redhat.com/carveoutcosts/
> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
> 
> 
> 

-- 
View this message in context: http://n2.nabble.com/How-to-transfer-a-document-like-xml-or-txt-using-qpidclient--tp3266678p3364201.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: How to transfer a document like xml or txt using qpidclient?

Posted by Carl Trieloff <cc...@redhat.com>.
John,

If you want to contribute your file transfer utility to the project as a
packaged example,
that would be a great use case to have in the shipped examples or utilities.

regards
Carl.


John Dennis wrote:
> On 07/15/2009 08:59 PM, aguestrush wrote:
>   
>> I want to write a client to transfer some files such as .xml to another client,there is a example but I want a example which have a function that if I use the name of the file as one parameter of the function,the file will be transfered.How can I use the client API to implement this problem.
>>     
>
> I have code that does file transfers, however I get the feeling it's
> more than you might want/need. It's designed for Linux systems and
> transfers all the metadata associated with a file as well as the file
> contents (e.g. ownership, permissions, extended attributes, etc.). It
> also is capable of transferring large files in chunks and compressing
> the file contents prior to transmission and then uncompressing it upon
> receipt. I can share the code if there is interest, but like I said I it
> may be way more than you need.
>
> If all you want to do is transfer a simple file of reasonable size then
> it's trivial with AMQP.
>
> On the sending side:
>
> 1) Add the filename to the application headers in the message.
> 2) Open the file, read it's contents into a string, set the string as
> the message.
>
> On the receive side:
>
> 1) Get the filename from the application headers
> 2) Open the file for writing and write the message.
>
> Each side is about 5 lines of C++ code.
>
> How to do C++ file IO is left as an exercise for the reader :-)
>
>   


Re: How to transfer a document like xml or txt using qpidclient?

Posted by John Dennis <jd...@redhat.com>.
On 07/15/2009 08:59 PM, aguestrush wrote:
> I want to write a client to transfer some files such as .xml to another client,there is a example but I want a example which have a function that if I use the name of the file as one parameter of the function,the file will be transfered.How can I use the client API to implement this problem.

I have code that does file transfers, however I get the feeling it's
more than you might want/need. It's designed for Linux systems and
transfers all the metadata associated with a file as well as the file
contents (e.g. ownership, permissions, extended attributes, etc.). It
also is capable of transferring large files in chunks and compressing
the file contents prior to transmission and then uncompressing it upon
receipt. I can share the code if there is interest, but like I said I it
may be way more than you need.

If all you want to do is transfer a simple file of reasonable size then
it's trivial with AMQP.

On the sending side:

1) Add the filename to the application headers in the message.
2) Open the file, read it's contents into a string, set the string as
the message.

On the receive side:

1) Get the filename from the application headers
2) Open the file for writing and write the message.

Each side is about 5 lines of C++ code.

How to do C++ file IO is left as an exercise for the reader :-)

-- 
John Dennis <jd...@redhat.com>

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org