-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/22630/
-----------------------------------------------------------

(Updated July 4, 2014, 10:48 a.m.)


Review request for qpid, Alan Conway, Gordon Sim, Kenneth Giusti, and Rafael 
Schloming.


Changes
-------

New patch proposal, with Alan's idea of MangledString class implemented (it 
gets really easier, thanks!).


Bugs: QPID-5823
    https://issues.apache.org/jira/browse/QPID-5823


Repository: qpid


Description
-------

The easiest "solution" would be to do the "mangling" in parse_address method in 
driver.py (see original https://svn.apache.org/r1602820 I reverted). That 
prevents any application to get proper node address ('#' expanded).

So the '#' expansion needs to be done in endpoints.py and the information 
"address is expanded" needs to be passed to parse_address method. Either using 
[Sender|Receiver].mangled boolean (like in attached patch) or Sender.target / 
Receiver.source could be a double (address_string, mangled), like _mangle 
method returns in the patch. I don't know what approach (or some combination) 
is better.


FYI C++ client has similar code:

    if (qpid::messaging::AddressImpl::isTemporary(a) && createPolicy.isVoid()) {
        createPolicy = "always";
        Opt specified = Opt(a)/NODE/X_DECLARE;
        if (!specified.hasKey(AUTO_DELETE)) autoDelete = true;
        if (!specified.hasKey(EXCLUSIVE)) exclusive = true;
    }

where isTemporary(a)==true iff node name starts with '#'.


Diffs (updated)
-----

  /trunk/qpid/python/qpid/messaging/driver.py 1607804 
  /trunk/qpid/python/qpid/messaging/endpoints.py 1607804 

Diff: https://reviews.apache.org/r/22630/diff/


Testing
-------

Automated tests passed.

Manual test passed as well:

$ drain "#q; {node: {durable:true}}" -t 2 & qpid-stat -q
[1] 25174
c17af530-6cd8-462d-b8e8-5e4b6c9d50f8#q; {node: {durable:true}}
Queues
  queue                                     dur  autoDel  excl  msg   msgIn  
msgOut  bytes  bytesIn  bytesOut  cons  bind
  
=========================================================================================================================
  af192c4d-b2a0-47c3-8dd4-e99f400da51d:0.0       Y        Y        0     0      
0       0      0        0         1     2
  c17af530-6cd8-462d-b8e8-5e4b6c9d50f8#q    Y    Y        Y        0     0      
0       0      0        0         1     1
$

(the same for spout)

receiver / producer is able to print expanded address (see the 
"c17af530-6cd8-462d-b8e8-5e4b6c9d50f8#q; {node: {durable:true}}" line).


Thanks,

Pavel Moravec

Reply via email to