Browsing Service Bus Resources with the Visual Studio Server Explorer
Updated: January 22, 2014
Windows Azure Tools for Microsoft Visual Studio includes Server Explorer support for managing Service Bus messaging entities, such as queues and topics. You can use the Service Bus node in Server Explorer to create, delete, and modify the properties of messaging entities in a given service namespace.
To display Server Explorer in Visual Studio, from the menu bar choose View, then click Server Explorer. A Windows Azure node appears within the Server Explorer hierarchy. You can expand this node to display the Service Bus hierarchy, as in the following figure:
Connect to a service namespace
To connect Server Explorer to a Service Bus service namespace, right-click Service Bus, then click Add New Connection. The Add Connection dialog enables you to choose whether to connect using a connection string, or manually enter the credentials. You can also choose between connecting to a service namespace in Windows Azure Service Bus (cloud service) or Service Bus for Windows Server (on-premises).
For manual entry, type the name of the service namespace, the issuer name, and the issuer key. Alternatively, you can enter the connection string. You can obtain all of these values from the Windows Azure Management Portal. For more information, see How To: Create or Modify a Service Bus Service Namespace. Then click OK. For example:
After you connect, a list of queues and topics you have created on that service namespace appears.
Manage Messaging Entities
You can use Server Explorer to create new queues and topics, and to delete existing ones. You can also send and receive test messages.
To create a new queue, right-click Queues in the Server Explorer hierarchy, then click Create New Queue. The New Queue dialog appears, in which you can set properties on the queue. For example:
Click OK to create the queue.
To create a topic in Server Explorer, follow the same procedure as above, but right-click Topics, then Create New Topic. To create a subscription to that topic, right-click the name of the topic, then click Create New Subscription. You can also use Server Explorer to create rules within each subscription.
Update Messaging Entities
You can also use Server Explorer to update the properties of existing messaging entities. To do so, right-click the name of the entity, then click Update.
The same Properties dialog appears as pictured in “Manage Messaging Entities.” In this dialog, you can make changes to the properties of the entity.
Send and Receive Test Messages
You can send and receive test messages to and from Service Bus messaging entities that use Server Explorer. For example, to send a test message to a queue, right-click the name of the queue in Server Explorer, and then click Send a test message. To receive the message, right-click the queue again, then click Receive message. You can send multiple messages, and receive them in the order in which they were sent (first in, first out).
You can send one or more test messages to a topic by using Server Explorer, but to receive them, you must create a subscription. You cannot receive messages directly from a topic. For example, you can do the following:
In Server Explorer, double-click the name of a topic to expand its hierarchy.
Under the topic name, right-click Subscriptions, then click Create New Subscription.
Repeat step 2 if you want to create more subscriptions to the topic.
In the New Subscription dialog, give the subscription a name and set any desired properties.
Right-click the name of the topic in Server Explorer, and then click Send a test message.
Right-click the subscription you created in step 2, then click Receive message. You can repeat this step for every subscription you created in step 3, and each subscription receives a copy of the same message.