Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-2833

Qpid Broker Not Auto Delete Exchange Created Corresponding Queue

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Information Provided
    • proton-dotnet-1.0.0-M10
    • None
    • proton-dotnet
    • None
    • centos7.9 C++ Broker 1.39.0

    Description

      using using Apache.Qpid.Proton.Client create Receiver connect to C++ Broker,
      After close connection, C++ Broker did not auto delete  auto created queue (Receiver connected Exchange  Address Created Queue)

      Steps to reproduce:

      1) centos: qpid-config -b localhost:6656 queues

      Show following:

      Queue Name                                                                                            Attributes
      =============================================================================================================================
      038154c3-daf7-4fad-ad45-4eef738bccba:0.0                                                              auto-del excl 
      ID:02eafb79-b51e-4fef-b242-f86d453debb1:1:1_receiver-ID:02eafb79-b51e-4fef-b242-f86d453debb1:1:1:1:1  
      ID:f78b1699-d494-4f43-8413-d1e7e00e20fa:1:1_receiver-ID:f78b1699-d494-4f43-8413-d1e7e00e20fa:1:1:1:1  excl  

      2) run window dotnot receive to receive message,C# code snippet 

      static void Main(string[] args)
      {
          string serverHost = Environment.GetEnvironmentVariable("HOST") ?? "192.168.1.34";
          int serverPort = Convert.ToInt32(Environment.GetEnvironmentVariable("PORT") ?? "6656");
          string address = Environment.GetEnvironmentVariable("ADDRESS") ?? "ryan_test3_ex";

          IClient client = IClient.Create();
          ConnectionOptions options = new ConnectionOptions();
          //options.User = Environment.GetEnvironmentVariable("USER");
          //options.Password = Environment.GetEnvironmentVariable("PASSWORD");
          using IConnection connection = client.Connect(serverHost, serverPort, options);
          using IReceiver receiver = connection.OpenReceiver(address);

          for (int i = 0; i < MessageCount; ++i)
          {
              IDelivery delivery = receiver.Receive();
              IMessage<object> received = delivery.Message();
              string contenttype = received.ContentType;
              if (string.IsNullOrEmpty(contenttype))
              {
                  if (received.HasProperty("content-type"))
                 

      {                 contenttype = received.GetProperty("content-type") as string;                 Console.WriteLine("Received message with content-type: " + contenttype);             }

              }
              Console.WriteLine("Received message tpye:[" + contenttype + "] BodyType:[" +  received.Body.GetType() + "]");
              if(contenttype == "amqp/map")
              {
                  Dictionary<object, object> content = received.Body as Dictionary<object, object>;
                  if (content != null)
                  {
                      foreach (KeyValuePair<object, object> entry in content)
                     

      {                     Console.WriteLine("   Key: " + entry.Key as string + ", Value: " + entry.Value as string);                     //Console.WriteLine("   Key: " + (entry.Key as string) + ", Value: " + (Int64)entry.Value);                 }

                  }
              }
              else if (contenttype == "text/plain")
             

      {             Console.WriteLine("    Received Message : " + Encoding.UTF8.GetString(received.Body as Byte[]));         }

              else
             

      {         }

          }

          connection.Close();
          Console.WriteLine("    Connection close OK !!");

       

      test code has attaced

       

      3)Centos run: qpid-config -b localhost:6656 queues

      qpid-config -b localhost:6656 queues
      Queue Name                                                                                            Attributes
      =============================================================================================================================
      038154c3-daf7-4fad-ad45-4eef738bccba:0.0                                                              auto-del excl 
      ID:02eafb79-b51e-4fef-b242-f86d453debb1:1:1_receiver-ID:02eafb79-b51e-4fef-b242-f86d453debb1:1:1:1:1  
      ID:f78b1699-d494-4f43-8413-d1e7e00e20fa:1:1_receiver-ID:f78b1699-d494-4f43-8413-d1e7e00e20fa:1:1:1:1  excl  
      ID:ff934946-f75f-49e2-bef6-ecd56fc9c979:1:1_receiver-ID:ff934946-f75f-49e2-bef6-ecd56fc9c979:1:1:1:1 

       

      queue:

      ID:ff934946-f75f-49e2-bef6-ecd56fc9c979:1:1_receiver-ID:ff934946-f75f-49e2-bef6-ecd56fc9c979:1:1:1:1   would not auto delete

       

      we using qpid tool:
      spout send message, drain receive message, is ok.

       

       

      Attachments

        1. Program.cs
          3 kB
          ryanwei
        2. ConsoleApp2.csproj
          0.5 kB
          ryanwei

        Activity

          People

            tabish Timothy A. Bish
            wei6rong ryanwei
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: