locked
CreateFromConnectionString not creating queue RRS feed

  • Question

  • I have a Service Bus in Azure, and I'm trying to use `QueueClient.CreateFromConnectionString(myString, queueName)` to create the queue on the bus. A client is returned just fine, however, when I call `QueryClient.Send(msg)`, I get an error that the endpoint isn't found

    40400: Endpoint not found., Resource:sb://crm1-dev-bus.servicebus.windows.net/jdbmcsv_crmdataapirequest_inbox. TrackingId:a915ae00-9d4f-4585-ad46-dc76680f0a21_G1, SystemTracker:crm1-dev-bus.servicebus.windows.net:jdbmcsv_crmdataapirequest_inbox, Timestamp:4/20/2018 5:48:33 PM

    I've ensured the access policy I'm getting the connection string from has the proper permissions (Manage). If I create the queue through the Azure Portal, everything is good and sending the message works just fine. It's just the creation of the queue through code that is failing, even though it looks like it's successful when the client is returned.

    Friday, April 20, 2018 5:57 PM

All replies

  • Could you share complete Exception detail you are getting?
    Saturday, April 21, 2018 3:28 AM
  • Here is an ObjectDump of the MessagingEntityNotFound exception:

    {Microsoft.ServiceBus.Messaging.MessagingEntityNotFoundException(HashCode:47962264)}
        Detail: { }
            {Microsoft.ServiceBus.Messaging.MessagingExceptionDetail(HashCode:10818254)}
                ErrorCode: 40400
                Message: "40400: Endpoint not found., Resource:sb://crm1-dev-bus.servicebus.windows.net/prefix_queueName_inbox. TrackingId:6f8b0d42-9a4a-4159-b6a3-32b211166b5f_G5, SystemTracker:crm1-dev-bus.servicebus.windows.net:prefix_queueName_inbox, Timestamp:4/23/2018 2:29:02 PM"
                ErrorLevel: UserError
        Timestamp: 4/23/2018
        IsTransient: False
        Data: ...
            System.Collections.DictionaryEntry
            System.Collections.DictionaryEntry
        Message: "40400: Endpoint not found., Resource:sb://crm1-dev-bus.servicebus.windows.net/prefix_queueName_inbox. TrackingId:6f8b0d42-9a4a-4159-b6a3-32b211166b5f_G5, SystemTracker:crm1-dev-bus.servicebus.windows.net:prefix_queueName_inbox, Timestamp:4/23/2018 2:29:02 PM"
        InnerException: { }
            {System.ServiceModel.FaultException(HashCode:17059405)}
                Action: "http://schemas.microsoft.com/servicebus/2010/08/protocol/Fault"
                Code: { }
                Message: "40400: Endpoint not found., Resource:sb://crm1-dev-bus.servicebus.windows.net/prefix_queueName_inbox. TrackingId:6f8b0d42-9a4a-4159-b6a3-32b211166b5f_G5, SystemTracker:crm1-dev-bus.servicebus.windows.net:prefix_queueName_inbox, Timestamp:4/23/2018 2:29:02 PM"
                Reason: { }
                Data: ...
                InnerException: { }
                TargetSite: { }
                StackTrace: "   at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.ThrowIfFaultMessage(Message wcfMessage)
       at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.HandleMessageReceived(IAsyncResult result)
    --- End of stack trace from previous location where exception was thrown ---
       at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at Microsoft.ServiceBus.Messaging.Sbmp.DuplexRequestBindingElement.DuplexRequestSessionChannel.EndRequest(IAsyncResult result)
       at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.RequestAsyncResult.<>c.<GetAsyncSteps>b__9_3(RequestAsyncResult thisPtr, IAsyncResult r)
       at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
    --- End of stack trace from previous location where exception was thrown ---
       at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at Microsoft.ServiceBus.Common.AsyncResult`1.End(IAsyncResult asyncResult)
       at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.EndRequest(IAsyncResult result)
       at Microsoft.ServiceBus.Messaging.Sbmp.RedirectBindingElement.RedirectContainerChannelFactory`1.RedirectContainerSessionChannel.RequestAsyncResult.<>c__DisplayClass8_1.<GetAsyncSteps>b__4(RequestAsyncResult thisPtr, IAsyncResult r)
       at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
    --- End of stack trace from previous location where exception was thrown ---
       at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at Microsoft.ServiceBus.Common.AsyncResult`1.End(IAsyncResult asyncResult)
       at Microsoft.ServiceBus.Messaging.Sbmp.RedirectBindingElement.RedirectContainerChannelFactory`1.RedirectContainerSessionChannel.EndRequest(IAsyncResult result)
       at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.RequestAsyncResult.<>c.<GetAsyncSteps>b__9_3(RequestAsyncResult thisPtr, IAsyncResult r)
       at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
    --- End of stack trace from previous location where exception was thrown ---
       at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at Microsoft.ServiceBus.Common.AsyncResult`1.End(IAsyncResult asyncResult)
       at Microsoft.ServiceBus.Messaging.Channels.ReconnectBindingElement.ReconnectChannelFactory`1.RequestSessionChannel.EndRequest(IAsyncResult result)
       at Microsoft.ServiceBus.Messaging.Sbmp.SbmpTransactionalAsyncResult`1.<>c.<GetAsyncSteps>b__18_3(TIteratorAsyncResult thisPtr, IAsyncResult a)
       at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
    --- End of stack trace from previous location where exception was thrown ---
       at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at Microsoft.ServiceBus.Messaging.Sbmp.SbmpMessageSender.EndSendCommand(IAsyncResult result)"
                HelpLink: null
                Source: "Microsoft.ServiceBus"
                HResult: -2146233087
        TargetSite: { }
            {System.Reflection.RuntimeMethodInfo(HashCode:18251340)}
                Name: "End"
                DeclaringType: { }
                ReflectedType: { }
                MemberType: Method
                MetadataToken: 100676908
                Module: { }
                IsSecurityCritical: True
                IsSecuritySafeCritical: False
                IsSecurityTransparent: False
                MethodHandle: System.RuntimeMethodHandle
                Attributes: PrivateScope, Family, Static, HideBySig
                CallingConvention: Standard
                ReturnType: { }
                ReturnTypeCustomAttributes: { }
                ReturnParameter: { }
                IsGenericMethod: True
                IsGenericMethodDefinition: True
                ContainsGenericParameters: True
                MethodImplementationFlags: IL
                IsPublic: False
                IsPrivate: False
                IsFamily: True
                IsAssembly: False
                IsFamilyAndAssembly: False
                IsFamilyOrAssembly: False
                IsStatic: True
                IsFinal: False
                IsVirtual: False
                IsHideBySig: True
                IsAbstract: False
                IsSpecialName: False
                IsConstructor: False
                CustomAttributes: ...
        StackTrace: "   at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
       at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.RunSynchronously()
       at Microsoft.ServiceBus.Messaging.MessageSender.OnSend(TrackingContext trackingContext, IEnumerable`1 messages, TimeSpan timeout)
       at Microsoft.ServiceBus.Messaging.MessageSender.Send(TrackingContext trackingContext, IEnumerable`1 messages, TimeSpan timeout)
       at Microsoft.ServiceBus.Messaging.MessageSender.Send(BrokeredMessage message)
       at Microsoft.ServiceBus.Messaging.QueueClient.Send(BrokeredMessage message)
       at MyCode.SendMessage(IInternalMessage obj, String id, String queueName, String replyTo, Int32 attempt) in C:\PathToCode.cs:line 243"
        HelpLink: null
        Source: "Microsoft.ServiceBus"
        HResult: -2146233088

    Monday, April 23, 2018 2:38 PM
  • QueueClient.CreateFromConnectionString creates the QueueClient not the actual 'queue' entity. You need to create the queue either on the portal, or by using a management client such as NamespaceManager.CreateQueueAsync https://docs.microsoft.com/en-us/dotnet/api/microsoft.servicebus.namespacemanager.createqueueasync?view=azure-dotnet
    Wednesday, April 25, 2018 4:07 PM