I'm working with a build from SVN trunk, and am trying to use the Python
QMFv2 bindings. I've been starting with the example provided (agent.py),
and then moving on to try and get a functional console, but have had
some difficulties.

First, the agent example as provided fails to function correctly, and
outputs the following:

2010-10-07 21:52:22 warning Exception received from broker: not-found:
not-found: Queue not found: qmf.default.direct
(qpid/broker/SessionAdapter.cpp:752) [caused by 2 \x08:\x01]
Traceback (most recent call last):
  File "./example_agent.py", line 145, in <module>
    agent = ExampleAgent("fed1.lab.eseri.net")
  File "./example_agent.py", line 47, in __init__
    self.session.open()
  File "/usr/lib/python2.6/site-packages/qmf2.py", line 229, in open
    self._impl.open()
  File "/usr/lib/python2.6/site-packages/cqmf2.py", line 246, in open
    def open(self): return _cqmf2.AgentSession_open(self)
RuntimeError: Queue qmf.default.direct does not exist
Segmentation fault

I've tried looking through the qmf2.py source to understand how to
create a Console, and came up with this as a simple proof of concept:

import cqpid
from qmf2 import *

connection = cqpid.Connection("fed1.lab.eseri.net")
connection.open()

myconsole = ConsoleSession(connection)
myconsole.open()
print myconsole.getAgents()

When run, it outputs the following:

2010-10-07 21:50:15 warning Exception received from broker: not-found:
not-found: Exchange not found: qmf.default.direct
(qpid/broker/ExchangeRegistry.cpp:90) [caused by 2 \x07:\x01]
Traceback (most recent call last):
  File "./console.py", line 24, in <module>
    myconsole.open()
  File "/usr/lib/python2.6/site-packages/qmf2.py", line 166, in open
    self._impl.open()
  File "/usr/lib/python2.6/site-packages/cqmf2.py", line 314, in open
    def open(self): return _cqmf2.ConsoleSession_open(self)
RuntimeError: Exchange qmf.default.direct does not exist

I found that by using the messaging library, I can create the
"qmf.default.direct" and "qmf.default.topic" exchanges by hand before
opening the console session, and the console appears to work (although
getAgents never returns any values)

However, if I then run the agent example, with the qmf exchanges created
by the console, I get this output instead:

./example_agent.py 
Traceback (most recent call last):
  File "./example_agent.py", line 145, in <module>
    agent = ExampleAgent("broker.example.org")
  File "./example_agent.py", line 47, in __init__
    self.session.open()
  File "/usr/lib/python2.6/site-packages/qmf2.py", line 229, in open
    self._impl.open()
  File "/usr/lib/python2.6/site-packages/cqmf2.py", line 246, in open
    def open(self): return _cqmf2.AgentSession_open(self)
RuntimeError: Ambiguous address, please specify queue or topic as node
type
Segmentation fault

It seems like my difficulties are centred around not having the
qmf.default.* exchanges set up correctly. Am I wrong in thinking that
the QMF libraries ought to be declaring/asserting these exchanges
automatically, the same way the QMF queues are created? If not, I'd
appreciate a couple of lines I could use with the messaging API to
create the exchanges with the correct options/settings.

Greg


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

Reply via email to