You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by Everett Toews <no...@github.com> on 2013/12/24 19:23:05 UTC

[jclouds-examples] Examples for Rackspace Cloud Queues (#27)

You can merge this Pull Request by running:

  git pull https://github.com/rackerlabs/jclouds-examples rax-cloud-queues

Or you can view, comment on it, or merge it online at:

  https://github.com/jclouds/jclouds-examples/pull/27

-- Commit Summary --

  * Examples for Rackspace Cloud Queues

-- File Changes --

    M rackspace/README.md (5)
    M rackspace/pom.xml (10)
    M rackspace/src/main/java/org/jclouds/examples/rackspace/SmokeTest.java (7)
    A rackspace/src/main/java/org/jclouds/examples/rackspace/cloudqueues/Constants.java (46)
    A rackspace/src/main/java/org/jclouds/examples/rackspace/cloudqueues/ProducerConsumer.java (220)
    A rackspace/src/main/java/org/jclouds/examples/rackspace/cloudqueues/PublisherSubscriber.java (231)
    A rackspace/src/main/java/org/jclouds/examples/rackspace/cloudqueues/StreamMessages.java (190)

-- Patch Links --

https://github.com/jclouds/jclouds-examples/pull/27.patch
https://github.com/jclouds/jclouds-examples/pull/27.diff

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Andrew Phillips <no...@github.com>.
> +   private void createQueue() {
> +      queueApi.create(NAME);
> +   }
> +
> +   private void createMessages() throws ExecutionException, InterruptedException {
> +      System.out.format("Create Messages%n");
> +
> +      MessageApi messageApi = marconiApi.getMessageApiForZoneAndClientAndQueue(ZONE, PRODUCER_ID, NAME);
> +      List<CreateMessage> createMessages = Lists.newArrayList();
> +
> +      for (int i=0; i < 10; i++) {
> +         for (int j=0; j < 10; j++) {
> +            StringBuilder bodyBuilder = new StringBuilder();
> +            bodyBuilder.append(format("%s=%s%n", PRODUCER_NAME, PRODUCER_ID));
> +            bodyBuilder.append(format("%s=%d%n", MESSAGE_NUM, i*10+j));
> +            bodyBuilder.append(format("%s=%s%n", MESSAGE_TEXT, "Hear Ye! Hear Ye!"));

See above comment about `.append(..)` chain

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8550792

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Everett Toews <no...@github.com>.
> @@ -71,6 +71,11 @@ The [clouddatabases package](https://github.com/jclouds/jclouds-examples/tree/ma
>    * [TestDatabase.java](https://github.com/jclouds/jclouds-examples/blob/master/rackspace/src/main/java/org/jclouds/examples/rackspace/clouddatabases/TestDatabase.java) - An example of connecting to the database from the public Internet and making a simple request.
>    * Other examples include deleting instances, databases, and users, and granting root access.
>  
> +The [cloudqueues package](https://github.com/jclouds/jclouds-examples/tree/master/rackspace/src/main/java/org/jclouds/examples/rackspace/cloudqueues) demonstrates how to accomplish common tasks for working with queues in the cloud.
> +
> +  * [ProducerConsumer.java](https://github.com/jclouds/jclouds-examples/blob/master/rackspace/src/main/java/org/jclouds/examples/rackspace/cloudqueues/ProducerConsumer.java) - An example of the Producer and Consumer pattern.

Fixed.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8624350

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Andrew Phillips <no...@github.com>.
> +      private final MessageApi messageApi;
> +      private int consecutiveSleepCount = 0;
> +
> +      protected Subscriber(String subscriberName) {
> +         this.subscriberName = subscriberName;
> +         messageApi = marconiApi.getMessageApiForZoneAndClientAndQueue(ZONE, SUBSCRIBER_ID, NAME);
> +      }
> +
> +      /**
> +       * Process messages off the queue until we haven't seen any messages 3 times in a row.
> +       */
> +      public void run() {
> +         StreamMessagesOptions streamMessagesOptions = limit(2);
> +         MessageStream stream = messageApi.stream(streamMessagesOptions);
> +
> +         while (consecutiveSleepCount != 3) {

`while (... < 3)`?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8550783

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Everett Toews <no...@github.com>.
> +   // To use the Rackspace Cloud (UK) set the system property or default value to "rackspace-cloudqueues-uk"
> +   public static final String PROVIDER = System.getProperty("provider.cbs", "rackspace-cloudqueues-us");
> +   public static final String ZONE = System.getProperty("zone", "IAD");
> +
> +   public static final UUID PRODUCER_ID = UUID.fromString("3381af92-2b9e-11e3-b191-71861300734a");
> +   public static final UUID CONSUMER_ID = UUID.fromString("3381af92-2b9e-11e3-b191-71861300734b");
> +   public static final UUID PUBLISHER_ID = UUID.fromString("3381af92-2b9e-11e3-b191-71861300734c");
> +   public static final UUID SUBSCRIBER_ID = UUID.fromString("3381af92-2b9e-11e3-b191-71861300734d");
> +   public static final String NAME = "jclouds-example";
> +
> +   public static final int NUM_THREADS = 3;
> +
> +   public static final String PRODUCER_NAME = "producer.name";
> +   public static final String PUBLISHER_NAME = "publisher.name";
> +   public static final String MESSAGE_TEXT = "message.text";
> +   public static final String MESSAGE_NUM = "message.num";

Indeed they are. Fixed.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8624416

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Everett Toews <no...@github.com>.
> @@ -71,6 +71,11 @@ The [clouddatabases package](https://github.com/jclouds/jclouds-examples/tree/ma
>    * [TestDatabase.java](https://github.com/jclouds/jclouds-examples/blob/master/rackspace/src/main/java/org/jclouds/examples/rackspace/clouddatabases/TestDatabase.java) - An example of connecting to the database from the public Internet and making a simple request.
>    * Other examples include deleting instances, databases, and users, and granting root access.
>  
> +The [cloudqueues package](https://github.com/jclouds/jclouds-examples/tree/master/rackspace/src/main/java/org/jclouds/examples/rackspace/cloudqueues) demonstrates how to accomplish common tasks for working with queues in the cloud.
> +
> +  * [ProducerConsumer.java](https://github.com/jclouds/jclouds-examples/blob/master/rackspace/src/main/java/org/jclouds/examples/rackspace/cloudqueues/ProducerConsumer.java) - An example of the Producer and Consumer pattern.
> +  * [PublisherSubscriber.java](https://github.com/jclouds/jclouds-examples/blob/master/rackspace/src/main/java/org/jclouds/examples/rackspace/cloudqueues/PublisherSubscriber.java) - An example of the Publisher and Subscriber pattern.

Fixed. This is how it's more commonly known. I updated the class name too.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8624374

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Everett Toews <no...@github.com>.
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.NUM_THREADS;
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.PRODUCER_ID;
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.PRODUCER_NAME;
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.PROVIDER;
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.ZONE;
> +
> +/**
> + * Setting up a Producer-Consumer model in Cloud Queues consists of posting messages to your queue, consumers claiming
> + * messages from that queue, and then deleting the completed message.
> + * <p/>
> + * The producer-consumer mode has the following characteristics:
> + * <p/>
> + * 1. Messages are acted upon by one (and only one) worker.
> + * 2. Worker must delete message when done.
> + * 3. TTL restores message to unclaimed state if worker never finishes.
> + * 4. Ideal for dispatching jobs to multiple processors.

I meant "These are *not* meant to be read as Javadoc." Still I'd prefer to leave the /** style as is.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8625037

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Everett Toews <no...@github.com>.
> +         this.publisherName = publisherName;
> +         messageApi = marconiApi.getMessageApiForZoneAndClientAndQueue(ZONE, PUBLISHER_ID, NAME);
> +      }
> +
> +      public void run() {
> +         for (int i = 0; i < 32; i++) {
> +            messageApi.create(publish(i));
> +            sleep(200);
> +         }
> +      }
> +
> +      private List<CreateMessage> publish(int messageNum) {
> +         StringBuilder bodyBuilder = new StringBuilder();
> +         bodyBuilder.append(format("%s=%s%n", PUBLISHER_NAME, publisherName));
> +         bodyBuilder.append(format("%s=%d%n", MESSAGE_NUM, messageNum));
> +         bodyBuilder.append(format("%s=%s%n", MESSAGE_TEXT, "Read all about it"));

Fixed.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8624781

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Everett Toews <no...@github.com>.
> +   private void createQueue() {
> +      queueApi.create(NAME);
> +   }
> +
> +   private void createMessages() throws ExecutionException, InterruptedException {
> +      System.out.format("Create Messages%n");
> +
> +      MessageApi messageApi = marconiApi.getMessageApiForZoneAndClientAndQueue(ZONE, PRODUCER_ID, NAME);
> +      List<CreateMessage> createMessages = Lists.newArrayList();
> +
> +      for (int i=0; i < 10; i++) {
> +         for (int j=0; j < 10; j++) {
> +            StringBuilder bodyBuilder = new StringBuilder();
> +            bodyBuilder.append(format("%s=%s%n", PRODUCER_NAME, PRODUCER_ID));
> +            bodyBuilder.append(format("%s=%d%n", MESSAGE_NUM, i*10+j));
> +            bodyBuilder.append(format("%s=%s%n", MESSAGE_TEXT, "Hear Ye! Hear Ye!"));

Fixed.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8624872

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Everett Toews <no...@github.com>.
> +
> +            messageApi.deleteByClaim(message.getId(), message.getClaimId().get());
> +         }
> +      }
> +
> +      private Properties loadStringProperties(String body) {
> +         Properties properties = new Properties();
> +
> +         try {
> +            properties.load(new StringReader(body));
> +         }
> +         catch (IOException e) {
> +            e.printStackTrace();
> +         }
> +
> +         return properties;

Ahhh...the fun of checked exceptions. We know an IOException will never occur because we're loading directly from a String. I'll replace the e.printStackTrace() with a comment to that effect.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8624719

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Andrew Phillips <no...@github.com>.
> +         streamMessages.deleteQueue();
> +      } catch (Exception e) {
> +         e.printStackTrace();
> +      } finally {
> +         streamMessages.close();
> +      }
> +   }
> +
> +   public StreamMessages(String username, String apiKey) {
> +      // If this application we're running *inside* the Rackspace Cloud, you would want to use the InternalUrlModule
> +      // as below to have all of the Cloud Queues traffic go over the internal Rackspace Cloud network.
> +      // Iterable<Module> modules = ImmutableSet.<Module> of(new InternalUrlModule());
> +
> +      marconiApi = ContextBuilder.newBuilder(PROVIDER)
> +            .credentials(username, apiKey)
> +                  // .modules(modules)

To prevent the user from having to comment out in two places, how about:
```
ContextBuilder.newBuilder(PROVIDER)
  .credentials(username, apiKey)
   // .modules(ImmutableSet.<Module>of(new InternalUrlModule()))
...
```
?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8550789

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Everett Toews <no...@github.com>.
> +            System.out.format("  Subscriber %s Message %s:%s (%s)%n", subscriberName,
> +                  props.getProperty(PUBLISHER_NAME), props.getProperty(MESSAGE_NUM), props.getProperty(MESSAGE_TEXT));
> +         }
> +      }
> +
> +      private Properties loadStringProperties(String body) {
> +         Properties properties = new Properties();
> +
> +         try {
> +            properties.load(new StringReader(body));
> +         }
> +         catch (IOException e) {
> +            e.printStackTrace();
> +         }
> +
> +         return properties;

As above, commented instead.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8624832

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Andrew Phillips <no...@github.com>.
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.NUM_THREADS;
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.PRODUCER_ID;
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.PRODUCER_NAME;
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.PROVIDER;
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.ZONE;
> +
> +/**
> + * Setting up a Producer-Consumer model in Cloud Queues consists of posting messages to your queue, consumers claiming
> + * messages from that queue, and then deleting the completed message.
> + * <p/>
> + * The producer-consumer mode has the following characteristics:
> + * <p/>
> + * 1. Messages are acted upon by one (and only one) worker.
> + * 2. Worker must delete message when done.
> + * 3. TTL restores message to unclaimed state if worker never finishes.
> + * 4. Ideal for dispatching jobs to multiple processors.

[minor] Use an `<ol>`?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8550763

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Andrew Phillips <no...@github.com>.
> +
> +            messageApi.deleteByClaim(message.getId(), message.getClaimId().get());
> +         }
> +      }
> +
> +      private Properties loadStringProperties(String body) {
> +         Properties properties = new Properties();
> +
> +         try {
> +            properties.load(new StringReader(body));
> +         }
> +         catch (IOException e) {
> +            e.printStackTrace();
> +         }
> +
> +         return properties;

Is this intended to return an empty Properties object even if an exception occurs?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8550773

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Everett Toews <no...@github.com>.
> +         streamMessages.deleteQueue();
> +      } catch (Exception e) {
> +         e.printStackTrace();
> +      } finally {
> +         streamMessages.close();
> +      }
> +   }
> +
> +   public StreamMessages(String username, String apiKey) {
> +      // If this application we're running *inside* the Rackspace Cloud, you would want to use the InternalUrlModule
> +      // as below to have all of the Cloud Queues traffic go over the internal Rackspace Cloud network.
> +      // Iterable<Module> modules = ImmutableSet.<Module> of(new InternalUrlModule());
> +
> +      marconiApi = ContextBuilder.newBuilder(PROVIDER)
> +            .credentials(username, apiKey)
> +                  // .modules(modules)

I know what you're saying but I really like to keep my ContextBuilder code super clean. Putting the Set directly in there makes it very messy. Plus, if they want to add another Module (like logging) then it gets really ugly.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8625002

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Andrew Phillips <no...@github.com>.
> +            System.out.format("  Subscriber %s Message %s:%s (%s)%n", subscriberName,
> +                  props.getProperty(PUBLISHER_NAME), props.getProperty(MESSAGE_NUM), props.getProperty(MESSAGE_TEXT));
> +         }
> +      }
> +
> +      private Properties loadStringProperties(String body) {
> +         Properties properties = new Properties();
> +
> +         try {
> +            properties.load(new StringReader(body));
> +         }
> +         catch (IOException e) {
> +            e.printStackTrace();
> +         }
> +
> +         return properties;

See comment above about empty props object

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8550784

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Andrew Phillips <no...@github.com>.
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.NUM_THREADS;
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.PRODUCER_ID;
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.PRODUCER_NAME;
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.PROVIDER;
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.ZONE;
> +
> +/**
> + * Setting up a Producer-Consumer model in Cloud Queues consists of posting messages to your queue, consumers claiming
> + * messages from that queue, and then deleting the completed message.
> + * <p/>
> + * The producer-consumer mode has the following characteristics:
> + * <p/>
> + * 1. Messages are acted upon by one (and only one) worker.
> + * 2. Worker must delete message when done.
> + * 3. TTL restores message to unclaimed state if worker never finishes.
> + * 4. Ideal for dispatching jobs to multiple processors.

Do you mean "These are meant to be read as Javadoc." or "These are **not** meant to be read as Javadoc."? If the latter, perhaps just make them a
```
/*
 *
 */
``
rather than a
``
/**
 *
 */
``
? But it's a minor point - also happy to ignore ;-)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8624847

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Andrew Phillips <no...@github.com>.
> +      private final MessageApi messageApi;
> +
> +      protected Producer(String producerName) {
> +         this.producerName = producerName;
> +         messageApi = marconiApi.getMessageApiForZoneAndClientAndQueue(ZONE, PRODUCER_ID, NAME);
> +      }
> +
> +      public void run() {
> +         for (int i = 0; i < 32; i++) {
> +            messageApi.create(produce(i));
> +            sleep(250);
> +         }
> +      }
> +
> +      private List<CreateMessage> produce(int messageNum) {
> +         StringBuilder bodyBuilder = new StringBuilder();

tee hee ;-)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8550771

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Andrew Phillips <no...@github.com>.
> +         this.publisherName = publisherName;
> +         messageApi = marconiApi.getMessageApiForZoneAndClientAndQueue(ZONE, PUBLISHER_ID, NAME);
> +      }
> +
> +      public void run() {
> +         for (int i = 0; i < 32; i++) {
> +            messageApi.create(publish(i));
> +            sleep(200);
> +         }
> +      }
> +
> +      private List<CreateMessage> publish(int messageNum) {
> +         StringBuilder bodyBuilder = new StringBuilder();
> +         bodyBuilder.append(format("%s=%s%n", PUBLISHER_NAME, publisherName));
> +         bodyBuilder.append(format("%s=%d%n", MESSAGE_NUM, messageNum));
> +         bodyBuilder.append(format("%s=%s%n", MESSAGE_TEXT, "Read all about it"));

Any reason not to simply do
```
StringBuilder bodyBuilder = new StringBuilder();
bodyBuilder.append(...)
                 .append(...)
                 ...
```
?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8550781

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Everett Toews <no...@github.com>.
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.NUM_THREADS;
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.PRODUCER_ID;
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.PRODUCER_NAME;
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.PROVIDER;
> +import static org.jclouds.examples.rackspace.cloudqueues.Constants.ZONE;
> +
> +/**
> + * Setting up a Producer-Consumer model in Cloud Queues consists of posting messages to your queue, consumers claiming
> + * messages from that queue, and then deleting the completed message.
> + * <p/>
> + * The producer-consumer mode has the following characteristics:
> + * <p/>
> + * 1. Messages are acted upon by one (and only one) worker.
> + * 2. Worker must delete message when done.
> + * 3. TTL restores message to unclaimed state if worker never finishes.
> + * 4. Ideal for dispatching jobs to multiple processors.

Nope. These are meant to be read as Javadoc. They're meant to be read as source code only. Including markup just makes it look bad. The real mistake was including the <p/>. I've removed those now.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8624468

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Everett Toews <no...@github.com>.
> +      private final MessageApi messageApi;
> +      private int consecutiveSleepCount = 0;
> +
> +      protected Subscriber(String subscriberName) {
> +         this.subscriberName = subscriberName;
> +         messageApi = marconiApi.getMessageApiForZoneAndClientAndQueue(ZONE, SUBSCRIBER_ID, NAME);
> +      }
> +
> +      /**
> +       * Process messages off the queue until we haven't seen any messages 3 times in a row.
> +       */
> +      public void run() {
> +         StreamMessagesOptions streamMessagesOptions = limit(2);
> +         MessageStream stream = messageApi.stream(streamMessagesOptions);
> +
> +         while (consecutiveSleepCount != 3) {

Fixed.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8624815

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Andrew Phillips <no...@github.com>.
> +   // To use the Rackspace Cloud (UK) set the system property or default value to "rackspace-cloudqueues-uk"
> +   public static final String PROVIDER = System.getProperty("provider.cbs", "rackspace-cloudqueues-us");
> +   public static final String ZONE = System.getProperty("zone", "IAD");
> +
> +   public static final UUID PRODUCER_ID = UUID.fromString("3381af92-2b9e-11e3-b191-71861300734a");
> +   public static final UUID CONSUMER_ID = UUID.fromString("3381af92-2b9e-11e3-b191-71861300734b");
> +   public static final UUID PUBLISHER_ID = UUID.fromString("3381af92-2b9e-11e3-b191-71861300734c");
> +   public static final UUID SUBSCRIBER_ID = UUID.fromString("3381af92-2b9e-11e3-b191-71861300734d");
> +   public static final String NAME = "jclouds-example";
> +
> +   public static final int NUM_THREADS = 3;
> +
> +   public static final String PRODUCER_NAME = "producer.name";
> +   public static final String PUBLISHER_NAME = "publisher.name";
> +   public static final String MESSAGE_TEXT = "message.text";
> +   public static final String MESSAGE_NUM = "message.num";

Are these implicitly `public static` already..?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8550759

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Andrew Phillips <no...@github.com>.
> @@ -71,6 +71,11 @@ The [clouddatabases package](https://github.com/jclouds/jclouds-examples/tree/ma
>    * [TestDatabase.java](https://github.com/jclouds/jclouds-examples/blob/master/rackspace/src/main/java/org/jclouds/examples/rackspace/clouddatabases/TestDatabase.java) - An example of connecting to the database from the public Internet and making a simple request.
>    * Other examples include deleting instances, databases, and users, and granting root access.
>  
> +The [cloudqueues package](https://github.com/jclouds/jclouds-examples/tree/master/rackspace/src/main/java/org/jclouds/examples/rackspace/cloudqueues) demonstrates how to accomplish common tasks for working with queues in the cloud.
> +
> +  * [ProducerConsumer.java](https://github.com/jclouds/jclouds-examples/blob/master/rackspace/src/main/java/org/jclouds/examples/rackspace/cloudqueues/ProducerConsumer.java) - An example of the Producer and Consumer pattern.
> +  * [PublisherSubscriber.java](https://github.com/jclouds/jclouds-examples/blob/master/rackspace/src/main/java/org/jclouds/examples/rackspace/cloudqueues/PublisherSubscriber.java) - An example of the Publisher and Subscriber pattern.

"Publish/Subscribe"?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8550756

Re: [jclouds-examples] Examples for Rackspace Cloud Queues (#27)

Posted by Andrew Phillips <no...@github.com>.
> @@ -71,6 +71,11 @@ The [clouddatabases package](https://github.com/jclouds/jclouds-examples/tree/ma
>    * [TestDatabase.java](https://github.com/jclouds/jclouds-examples/blob/master/rackspace/src/main/java/org/jclouds/examples/rackspace/clouddatabases/TestDatabase.java) - An example of connecting to the database from the public Internet and making a simple request.
>    * Other examples include deleting instances, databases, and users, and granting root access.
>  
> +The [cloudqueues package](https://github.com/jclouds/jclouds-examples/tree/master/rackspace/src/main/java/org/jclouds/examples/rackspace/cloudqueues) demonstrates how to accomplish common tasks for working with queues in the cloud.
> +
> +  * [ProducerConsumer.java](https://github.com/jclouds/jclouds-examples/blob/master/rackspace/src/main/java/org/jclouds/examples/rackspace/cloudqueues/ProducerConsumer.java) - An example of the Producer and Consumer pattern.

"Producer/Consumer"?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/27/files#r8550754