YES!!!

Now temporary queues are deletes as expected!
Huge thanks for help!

Do you think the fix should be included in proton mainline?
Just in case the patch is attached.

Best regards,

On 01.08.2018 14:03, Gordon Sim wrote:
> On 01/08/18 11:44, Michael Ivanov wrote:
>> Currently I have the following:
>>
>>    [0x55da51103a80]:  -> AMQP
>>    [0x55da51103a80]:0 -> @open(16) 
>> [container-id="03F84325-E282-4535-800D-637EB4383871", hostname="localhost", 
>> channel-max=32767]
>>    [0x55da51103a80]:0 -> @begin(17) [next-outgoing-id=0, 
>> incoming-window=2147483647, outgoing-window=2147483647]
>>    [0x55da51103a80]:0 -> @attach(18) [name="receiver-29591.0", handle=0, 
>> role=true, snd-settle-mode=2, rcv-settle-mode=0,
>> source=@source(40) [durable=0, expiry-policy=:"link-detach", timeout=1000, 
>> dynamic=true,
>> dynamic-node-properties={:"lifetime-policy"="delete-on-close", 
>> :exclusive=true}], target=@target(41) [durable=0,
>> expiry-policy=:"link-detach", timeout=1000, dynamic=false], 
>> initial-delivery-count=0, max-message-size=0]
> 
> That looks like you are setting the value to the string 'delete-on-close'. It 
> should instead by a described list, e.g. something
> like:
> 
>     static pn_bytes_t _symbol = { 25, "amqp:delete-on-close:list" };
>     pn_data_put_described(data);
>     pn_data_enter(data);
>     pn_data_put_symbol(data, _symbol);
>     pn_data_put_list(data);
>     pn_data_exit(data);
> 
> (Alternatively, you can try patching your broker with the attached patch that 
> I think should fix the handling of the exclusive
> option.)
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
> For additional commands, e-mail: users-h...@qpid.apache.org
> 


-- 
 \   / |                                   |
 (OvO) |  Mikhail Iwanow                   |
 (^^^) |      Voice:   +7 (911) 223-1300   |
  \^/  |      E-mail:  iv...@logit-ag.de   |
  ^ ^  |                                   |
diff -ur qpid-proton-0.24.0.orig/c/src/messenger/messenger.c qpid-proton-0.24.0/c/src/messenger/messenger.c
--- qpid-proton-0.24.0.orig/c/src/messenger/messenger.c	2018-06-26 16:42:03.000000000 +0300
+++ qpid-proton-0.24.0/c/src/messenger/messenger.c	2018-08-01 14:27:05.918510331 +0300
@@ -1763,11 +1766,39 @@
     pn_link_set_rcv_settle_mode(link, messenger->rcv_settle_mode);
   }
   if (pn_streq(name, "#")) {
+    pn_data_t  *properties;
+
     if (pn_link_is_sender(link)) {
       pn_terminus_set_dynamic(pn_link_target(link), true);
+      properties = pn_terminus_properties(pn_link_target(link));
     } else {
       pn_terminus_set_dynamic(pn_link_source(link), true);
+      properties = pn_terminus_properties(pn_link_source(link));
+    }
+    pn_data_rewind(properties);
+    pn_data_next(properties);
+    if (pn_data_type(properties) == PN_EOS)
+       pn_data_put_map(properties);
+    if (pn_data_type(properties) == PN_MAP) {
+      static pn_bytes_t _exclusive = { 9, "exclusive" };
+      static pn_bytes_t _lifetime_policy = { 15, "lifetime-policy" };
+      static pn_bytes_t _delete_on_close = { 25, "amqp:delete-on-close:list" };
+
+      pn_data_enter(properties);
+       pn_data_put_symbol(properties, _lifetime_policy);
+       pn_data_put_described(properties);
+       pn_data_enter(properties);
+        pn_data_put_symbol(properties, _delete_on_close);
+        pn_data_put_list(properties);
+       pn_data_exit(properties);
+       pn_data_put_symbol(properties, _exclusive);
+       pn_data_put_bool(properties, true);
+      pn_data_exit(properties);
     }
+    else
+      pn_logf("%s: unexpected TERMINUS PROPERTIES type [%d], MAP expected",
+        __func__, pn_data_type(properties));
+    pn_data_rewind(properties);
   } else {
     pn_terminus_set_address(pn_link_target(link), name);
     pn_terminus_set_address(pn_link_source(link), name);

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org

Reply via email to