diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2009-10-11 16:54:18 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2009-10-11 16:54:18 +0000 |
| commit | 89801ebb1a85df6aacbd0f5cdd42926c1be3a605 (patch) | |
| tree | 84c2f95040536037869089d10e1e9a3cacd2dc01 /python | |
| parent | bc6700c7076f05bdc57ef5e7e09f9f3b7ff5d096 (diff) | |
| download | qpid-python-89801ebb1a85df6aacbd0f5cdd42926c1be3a605.tar.gz | |
fixed subscription to use subject if present
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@824105 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python')
| -rw-r--r-- | python/qpid/driver.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/python/qpid/driver.py b/python/qpid/driver.py index 13861aa215..7c293fe146 100644 --- a/python/qpid/driver.py +++ b/python/qpid/driver.py @@ -546,11 +546,18 @@ class Driver: else: _rcv._queue = "%s.%s" % (rcv.session.name, rcv.destination) sst.write_cmd(QueueDeclare(queue=_rcv._queue, durable=DURABLE_DEFAULT, exclusive=True, auto_delete=True)) - # XXX - if _rcv.options.get("filter") is None: + filter = _rcv.options.get("filter") + if _rcv.subject is None and filter is None: f = FILTER_DEFAULTS[result.type] + elif _rcv.subject and filter: + # XXX + raise Exception("can't supply both subject and filter") + elif _rcv.subject: + # XXX + from messaging import Pattern + f = Pattern(_rcv.subject) else: - f = rcv.filter + f = filter f._bind(sst, _rcv.name, _rcv._queue) do_link() sst.write_query(ExchangeQuery(name=_rcv.name), do_exchange_q) |
