Skip to content

Commit

Permalink
Merge pull request #422 from brian-swan/sb-fixes
Browse files Browse the repository at this point in the history
Fixed issues with SB topics
  • Loading branch information
mollybostic committed Oct 12, 2012
2 parents b757a7f + 55eba80 commit 96853cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 29 deletions.
10 changes: 6 additions & 4 deletions DevCenter/PHP/HowTo/service-bus-queues.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ messages**, and **deleting queues**.
- [How to: Handle application crashes and unreadable messages](#HandleCrashes)
- [Next steps](#NextSteps)

<div chunk="../../shared/chunks/howto-service-bus-queues.md" />
<div chunk="../../Shared/Chunks/howto-service-bus-queues.md" />

<h2 id="CreateApplication">Create a PHP application</h2>

Expand Down Expand Up @@ -62,7 +62,7 @@ In the examples below, the `require_once` statement will be shown always, but on

To instantiate a Windows Azure Service Bus client you must first have a valid connection string following this format:

Endpoint=[yourEndpoint];SharedSecretIssuer=[yourWrapAuthenticationName];SharedSecretValue=[yourWrapPassword]
Endpoint=[yourEndpoint];SharedSecretIssuer=[Default Issuer];SharedSecretValue=[Default Key]

Where the Endpoint is typically of the format `https://[yourNamespace].servicebus.windows.net`.

Expand All @@ -79,6 +79,8 @@ For the examples outlined here, the connection string will be passed directly.

use WindowsAzure\Common\ServicesBuilder;

$connectionString = "Endpoint=[yourEndpoint];SharedSecretIssuer=[Default Issuer];SharedSecretValue=[Default Key]";

$serviceBusRestProxy = ServicesBuilder::getInstance()->createServiceBusService($connectionString);


Expand Down Expand Up @@ -186,7 +188,7 @@ The example below demonstrates how a message can be received and processed using
try {
// Set the receive mode to PeekLock (default is ReceiveAndDelete).
$options = new ReceiveMessageOptions();
$options->setPeekLock(true);
$options->setPeekLock();
// Receive message.
$message = $serviceBusRestProxy->receiveQueueMessage("myqueue", $options);
Expand All @@ -197,7 +199,7 @@ The example below demonstrates how a message can be received and processed using
Process message here.
----------------------------*/
// Delete message.
// Delete message. Not necessary if peek lock is not set.
echo "Message deleted.<br />";
$serviceBusRestProxy->deleteMessage($message);
}
Expand Down
30 changes: 5 additions & 25 deletions DevCenter/PHP/HowTo/service-bus-topics.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,6 @@ In this guide, you will use service features which can be called within a PHP ap

<div chunk="../../Shared/Chunks/get-client-libraries.md" />

<h2 id="GetDefaultCredentials">Obtain the default management credentials for the namespace</h2>

In order to perform management operations on the new namespace (such as creating a topic or subscription), you need to obtain the management credentials for the namespace.

1. In the left navigation pane, click the **Service Bus** node, to display the list of available namespaces:

![Available Namespaces screenshot][]

2. Select the namespace you just created from the list shown:

![Namespace List screenshot][]

3. The right-hand **Properties** pane will list the properties for the new namespace:

![Properties Pane screenshot][]

4. The **Default Key** is hidden. Click the **View** button to display the security credentials:

![Default Key screenshot][]

5. Make a note of the **Default Issuer** and the **Default Key** as you will use this information below to perform operations with the namespace.

<h2 id="ConfigureApp">Configure your application to use Service Bus</h2>

To use the Windows Azure Service Bus topic APIs, you need to:
Expand All @@ -84,7 +62,7 @@ In the examples below, the `require_once` statement will be shown always, but on

To instantiate a Windows Azure Service Bus client you must first have a valid connection string following this format:

Endpoint=[yourEndpoint];SharedSecretIssuer=[yourWrapAuthenticationName];SharedSecretValue=[yourWrapPassword]
Endpoint=[yourEndpoint];SharedSecretIssuer=[Default Issuer];SharedSecretValue=[Default Key]

Where the Endpoint is typically of the format `https://[yourNamespace].servicebus.windows.net`.

Expand All @@ -100,6 +78,8 @@ For the examples outlined here, the connection string will be passed directly.
require_once 'vendor\autoload.php';

use WindowsAzure\Common\ServicesBuilder;

$connectionString = "Endpoint=[yourEndpoint];SharedSecretIssuer=[Default Issuer];SharedSecretValue=[Default Key]";

$serviceBusRestProxy = ServicesBuilder::getInstance()->createServiceBusService($connectionString);

Expand Down Expand Up @@ -275,7 +255,7 @@ The example below demonstrates how a message can be received and processed using
try {
// Set receive mode to PeekLock (default is ReceiveAndDelete)
$options = new ReceiveMessageOptions();
$options->setPeekLock(true);
$options->setPeekLock();

// Get message.
$message = $serviceBusRestProxy->receiveSubscriptionMessage("mytopic",
Expand All @@ -288,7 +268,7 @@ The example below demonstrates how a message can be received and processed using
Process message here.
----------------------------*/
// Delete message.
// Delete message. Not necessary if peek lock is not set.
echo "Deleting message...<br />";
$serviceBusRestProxy->deleteMessage($message);
}
Expand Down

0 comments on commit 96853cc

Please sign in to comment.