Brightbox
  • Home
  • Pricing & Sign up
  • Why Brightbox?
  • Products & Services
  • FAQs
  • About
  • Blog
  • Wiki
  • Contact

You are currently browsing the Brightbox Blog weblog archives for April, 2010

Blog RSS feed
twitter_banner

Flickr


more images...

Recent Posts

  • New deployment gem release, better bundler support
  • Passenger 3.0.11 Ubuntu Packages
  • Brightbox Cloud - general availability
  • It's a new brand day!
  • Apache Denial-of-Service Vulnerability

Archives

  • December 2011 (1)
  • November 2011 (1)
  • October 2011 (1)
  • September 2011 (2)
  • August 2011 (2)
  • May 2011 (1)
  • March 2011 (3)
  • January 2011 (1)
  • November 2010 (6)
  • September 2010 (4)
  • August 2010 (1)
  • June 2010 (3)
  • May 2010 (1)
  • April 2010 (3)
  • March 2010 (2)
  • February 2010 (3)
  • January 2010 (6)
  • December 2009 (4)
  • November 2009 (6)
  • October 2009 (2)
  • September 2009 (3)
  • August 2009 (4)
  • July 2009 (3)
  • June 2009 (3)
  • May 2009 (5)
  • April 2009 (4)
  • March 2009 (4)
  • February 2009 (3)
  • January 2009 (6)
  • December 2008 (8)
  • November 2008 (7)
  • October 2008 (8)
  • September 2008 (3)
  • August 2008 (5)
  • July 2008 (1)
  • June 2008 (4)
  • May 2008 (4)
  • April 2008 (3)
  • March 2008 (3)
  • February 2008 (3)
  • January 2008 (4)
  • December 2007 (4)
  • November 2007 (3)
  • October 2007 (1)
  • August 2007 (7)
  • July 2007 (1)
  • June 2007 (3)

Popular tags

    • announcements
    • apache
    • beta
    • deployment
    • hardy
    • packages
    • passenger
    • performance
    • phusion
    • rack
    • rails
    • ruby
    • ruby on rails
    • security
    • ubuntu

Archive: posts from April 2010

Ubuntu Lucid beta box offer 15 Apr 10

With the impending launch of Ubuntu “Lucid” (10.04 LTS), we are preparing our new Lucid-based Brightboxes.

We’ll still be offering Hardy-based Brightboxes, of course.

We’re now looking for volunteers beta test Lucid Brightboxes. If you’d like one to test, please email lucidbeta@brightbox.co.uk.

Beta test Brightboxes are free, but Lucid isn’t finished and there are still bugs, so you shouldn’t plan on running your live customer-facing sites on one yet. Once we launch Lucid-based boxes for all, we’ll be switching off the beta boxes.

Space on the test platform is limited, so don’t delay! There are Brightbox-goodies on offer for the best bug reports. We’ll be giving priority to existing Brightbox customers.

Posted 15 April 2010 by George Hills • Comments Off

Load Balancing with Stomp and ActiveMessaging 14 Apr 10

Inevitably with modern distributed software architecture you’re going to end up talking to a message queue at some point. We’ve been using ActiveMQ as the message broker, STOMP as the message protocol of choice and the ActiveMessaging gem so that we can talk to the message broker from Rails.

ActiveMessaging is a great piece of code, but at first glance it appears to have a couple of wrinkles

  • The standard configuration doesn’t support load balancing (so that you can talk to another broker if your normal one isn’t responding).
  • The queues and topics you want to speak to are defined at class level – which is a problem if you want the queues to be dynamically defined based upon data values.

But thanks to Ruby, YAML and a bit of lateral thinking you can get around these issues.

ActiveMessaging uses the Stomp Gem under the hood, and that can do load balancing by itself. So all you have to do is get ActiveMessaging to pass the relevant incantations down to the Stomp Gem – intact. And you do that with a bit of fancy YAML. The trick is to add your host configurations to the login configuration entry in hash format like this:

 production:
    adapter: stomp
    login:
      :randomize: true
      :hosts:
      - :login: myloginid1
        :passcode: mypassword1
        :host: broker-host-1.somedomain.co.uk
      - :login: myloginid2
        :passcode: mypassword2
        :host: broker-host-2.somedomain.co.uk

The Stomp Connection class checks login to see if it is a hash and if it is uses that in preference to anything else. You can setup anything Stomp understands within that Hash. Check the class code for details.

The beauty of this approach is that it is entirely in the configuration. Your Rails code doesn’t need to know about it. The reconnection happens automatically in the background.

I’ve used an observer class within Rails to handle the message sending. It watches a model and sends messages when stuff is created and updated – nicely separating the concerns. But I wanted to talk to different queues depending upon what was in the model. So the standard ActiveMessaging::MessageSender approach didn’t seem appropriate.

After a bit of digging around it turns out that you can get hold of the broker connection directly rather than going via the Gateway.

client = ActiveMessaging::Gateway.connection

Then you can send to any queue you like, not just the ones defined up front in messaging.rb:

client.send("/queue/#{some_variable}", body, headers)

This is a lower level connection and you lose the filter chains and some error checking. However if you need it, it’s there.

Posted 14 April 2010 by Neil Wilson • 1 comment

activemessaging+ activemq+ rails+ ruby+ stomp

Timezones on your Brightbox 6 Apr 10

You may have thought the time is wrong on your server. Well, it isn’t really, it is just that we prefer to set the default time on Brightboxes to Coordinated Universal Time (UTC).

This is generally considered to be best practice where ever a server is geographically located, however, it may  cause a problem if you are hosting a  geographically specific web application.

If your web application requires a different time-zone such as CET, BST or PST, or Daylight Saving Time is giving you a headache,  take a look at our Wiki page for a timely introduction to the subject of time-zones on Brightboxes.

Posted 6 April 2010 by james • Comments Off

brightbox+ linux+ modrails+ rails+ ruby+ ruby on rails+ ubuntu


Recent blog posts

  • New deployment gem release, better bundler support
    2 months ago
  • Passenger 3.0.11 Ubuntu Packages
    2 months ago
  • Brightbox Cloud – general availability
    4 months ago
  • It’s a new brand day!
    4 months ago
  • Apache Denial-of-Service Vulnerability
    5 months ago
  • Pricing for Brightbox Cloud (and last call for private beta)
    5 months ago

Join our email list

Flickr (more...)

RSS feeds

Blog feed

Flickr feed

Recent Wiki updates

System Status feed




Wiki | Forums | Terms & Conditions | Privacy | Site Map

Copyright © 2011 Brightbox Systems Ltd. All rights reserved