473,326 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

MQSeries based file transfers using the pymqi module

Hi everyone,
Has anyone developed a pymqi module based file transfer method for use
with WebSphere MQSeries v5.3?

If so, would it be possible to point me towards examples of how this was
done?

Any help that can be provided would be greatly appreciated.
Thanks
May 5 '06 #1
1 2494
Andrew Robert wrote:
Hi everyone,
Hello,
Has anyone developed a pymqi module based file transfer method for use
with WebSphere MQSeries v5.3?

If so, would it be possible to point me towards examples of how this
was done?


I'm not sure I understand your question. Webshpere MQ expects your code
to give it a stream of bytes, there's nothing file-specific in using
base WMQ so it's your application's job to read a file, put its contents
onto the desired queue, and to get it off the queue some time later.

If the code below is not what you need then feel free to ask a more
specific question :-)

import pymqi as mq

# Queue manager name
qm_name = "M01"

# Listener host and port
listener = "127.0.0.1(1414)"

# Channel to transfer data through
channel = "SYSTEM.DEF.SVRCONN"

# Input/output queue name
queue_name = "Q01"

# Make some data
file_name = "C:\\sample.txt"
sample_data = "Hello from PyMQI."
open(file_name,"w").write(sample_data)

# Connect to queue manager
qm = mq.QueueManager(None)
qm.connectTCPClient(qm_name, mq.cd(), channel, listener)

# Put a message onto the queue
queue = mq.Queue(qm, queue_name)
data = open(file_name).read()
queue.put(data)

# Close the queue, queue.put has implicitly opened the queue for output
# so we can't use the same pymqi.Queue object for getting the messages
# off the queue
queue.close()

# Now get the message, queue.get will implicitly open the queue for
# input
queue = mq.Queue(qm, queue_name)
msg = queue.get()
queue.close()

# Here's the message contents
print msg

--
Dariusz Suchojad
May 7 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: | last post by:
I am having a major problem with file transfers - they are ending early when the bandwidth tops-out. Smaller files transfer just fine, but large files (12Mb+) can 'abort' the transfer after maybe...
7
by: Limey Drink | last post by:
Hi all, Firstly :-) , is there any where I can search through archived newsgroup posts so I am not cluttering up the newsgroup with repeated queries ? And secondly :-), I know this has...
3
by: Kyler Laird | last post by:
I've been using Unison http://www.cis.upenn.edu/~bcpierce/unison/ for awhile and it causes me a lot of grief. I'd love to have a Python version which would be vastly easier to modify. Anyone...
0
by: ardechou | last post by:
Hi , i'm working on unix with MQseries and egate i want to have an injector to use in MQseries. , of course i want to use python to code this. do you some news on ? i want to hve just a sample to...
4
by: Pete H | last post by:
Hi All; I'm trying to get some of the samples that are amply illustrated in multiple docs to work. When I try to create a Warehouse Center view "...for MQ Series messages" or use the UDF wizard in...
8
by: Andrew Robert | last post by:
Hi Everyone. I tried the following to get input into optionparser from either a file or command line. The code below detects the passed file argument and prints the file contents but the...
9
by: Andrew Robert | last post by:
Hi everyone, I have a python program that will need to interact with an MQSeries trigger monitor. It does this fine but it hogs the trigger monitor while it executes. I'd like to fork the...
1
by: nams | last post by:
Hi, I have a simple piece of code as follows in which I am trying to test the commit/backout of messages put on the queue. It seems that inspite of doing a QueueManager.backout(), the message...
1
by: chainsinthewall | last post by:
Me and a friend of mine are trying to make a file sharing program using python. I have a book that recommends using urllib2 for file transfers. But which ever we end up using, i cant find any...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.