Welcome to JoshLong.com, home of my personal blog
<< Last | Next >>
October 4, 2010

Ubuntu 10.10 (Maverick Meerkat) on a MacBook Pro

I have long used rEFIt to install Ubuntu on a MacBook Pro. Simply install rEFIt as instructed on the site and then install Ubuntu on the newly created partition. No weirdness. Depending on your hardware, you may need to make sure that the Ubuntu installer program uses nomemset. This wasn't the case for me.

This setup lets me have my favorite operating system on (admittedly) fairly nice (albeit overpriced) Intel x86 machines. However, the latest generation of MacBook Pros have caused me no end of grief with Ubuntu 10.04. Ubuntu 10.10, Maverick Meerkat, remies everthing and I'm happy to report I'm running the release candidate of Ubuntu 10.10 on my Macbook Pro as I type this.

Everything seems to be working fairly well. I put this post out to confirm it can work for you on a Mac, and to also point people to this page if they're having trouble getting VMware's excellent VMware Player product working on 10.10.

Java2Days 2010

I'll be speaking (again) in Sofia, Bulgaria at the Java2Days conference on the 7th and 8th of October. I was there last year and quite enjoyed the conference. What a wonderful group! I'll be copresenting two talks with Oleg Zhurakousky (we'll be talking about Spring Integration 2 as well as RabbitMQ and AMQP), and another with James Ward (we'll be talking about Spring BlazeDS and Flex, naturally). Finally, I'll be giving another presentation on using Spring and the Apache 2 licensed BPMN 2 solution Activiti (simialar to the talk I gave at JavaZone recently). Java2Days is the only conference of its kind in the Balkans and I sincerely hope to see you there!

September 3, 2010

Spring for Force.com Developers

I did a webinar with Quinton Wall, the Developer Evangelist for Salesforce.com and specifically on the VMforce collaboration. The talk went very well (thanks for all the questions and good feedback, guys!) and we have the recorded webinar, code and slides up here. This first webinar was more about introducing developers to the Spring framework, and establishing basic skills to enable developers to use VMforce.com. Stay tuned for the next webinar, coming Sept 9, that will expand on the details of VMForce.com as an opportunity for Spring developers.

Spring and the Activiti BPMN2 engine at JavaZone 2010

I'll be speaking at JavaZone in Oslo, Norway on using Spring and Activiti together. If you want to learn a bit about Business Process Management using Activiti in conjunction with the Spring framework, then this talk is for you! We'll explore using Spring from Activiti's BPMN 2 engine, and we'll explore connecting your business processes to other interesting systems and offloading work using Spring Integration, SpringSource's framework for building event driven applications and connecting your applications to your data and services.

We'll talk a little bit about Spring Integration, but you won't want to miss Spring Integration lead Mark Fisher's talk on Spring Integration either! If you're new to the wide of world of Java configuration in Spring 3, then be sure to check out Costin Leau's talk on Spring 3 Java Config.

People may know about JavaZone from their excellent Java 4-Ever trailer or their Lady Java video. If you haven't seen these, then check them out!

August 24, 2010

(Secure) File Transfer, the Only Way to Fly... err Copy

I've recently posted a piece on using the file-transfer adapters in Spring Integration 2.0 on the SpringSource blog. Check it out and leave a comment!

July 17, 2010

Spring Integration at OSCON!

Whew! Time sure flies!

I've been working 'round the clock of late with my fellow authors Daniel Rubio and Gary Mak to wrap up the writing for Spring Recipes, 2nd Edition (more on that as it goes to press). This book's going to be second to none, folks. Spring Roo, Grails, Spring Integration, Spring Batch, Flex, REST and many (16, in fact!) other awesome chapters to bring you to the wide world of Spring 3. As a user of the Spring framework first and an author second, just trust me when I say I'd be very, very interested in buying this book if I wasn't already entitled to a free copy as an author. I digress. The book - all consuming though it is - isn't even why I'm writing this post!

Mark Fisher - lead of the Spring Integration project and all around nice guy (I'm going to throw in brilliant, as well, just in case you haven't had a chance to scour the code behind Spring Integration and come to that conclusion yourself) has been kind enough to let me contribute some adapters to the Spring Integration project - these adapters are centered around bridging communication between systems normally used by humans and automated systems. We have built support for XMPP and Twitter thus far. More's most assuredly coming, too! Looking into the crystal ball, I see ATOM and RSS playing a big part along with IRC. These adapters round out the support already provided for user-facing services like e-mail.

There's a lot of power and promise here. First, in a system with variable states, XMPP is a very promising technology because - besides being a good way for diffent entities to exchange messages (it is, after all, the backing protocol behind Google Talk and Facebook chat) - it lets you add the notion of availability to actors in your system. Imagine a game, with users joining and leaving the game, or a chat room, or a grid of grid-nodes that may be taken off-line. XMPP provides a natural way of representing availability, which is increasingly important in a system with many fluctuating agents and states.

Twitter, ATOM/RSS and others are important because they let you consume human-synthesized events. Trends, volume, etc, are all interesting metrics that can be very valuable to your business. I can see a lot of power in having a Twitter account that responds to queries or commands - in much the same way as the Smarter Child IM bot work (-s,-ed).

In some sense, these adapters are only the beginning. They let your application drink from the proverbial firehose of events, but what to do with them once you have them? Graph them? Send them to Splunk? Send them through a message broker (and, depending on the volume, which one?)? Why not send them through a complex event processing (CEP) engine like Esper using this fantastic third party Spring Integration adapter for Esper? There, you can can process and analyze these events, and synthesize more interesting, complex events.

If this all sounds interesting to you (and why wouldn't it?), you should check out OSCON next week in Portland, OR. I'll be there giving a talk called the "The Social Enterprise Service Bus." I'll be with some colleagues and friends from Shopzilla, too. If you'd like to grab a beer, ping me on Twitter (@starbuxman) and we'll see what we can do! This is my first time presenting at OSCON, so I'm looking forward to attending some of the other talks almost as much as I am about getting a chance to talk to you guys. Hope to see you there!

July 16, 2010

Is This Thing On?

Hello, world! Nothing to see here, simply conducting a few tests of the software. Move along...

May 4, 2010

Idempotent Queues With HornetQ (or: the 'Last Value Header')

Often times, a message queue is used as a way to publish "events" to other services in the enterprise. The publish/subscribe architecture decouples clients from the senders and alleviates the publisher from specific knowledge of the consumers of the messages. This, plus the asynchronous nature of a message queue - the publisher does not block while clients consume the events - makes it ideal for publishing events to keep other systems aware of the state of a given system.

Now, let's establish the use case: we want to consume events in a very busy system. In our case, it's possible to receive multiple events. Or, perhaps in your system you've positioned the message queue as a way to deliver commands - "pings" - using the "command bus" pattern. It may - and quite often is - be acceptable to ignore duplicate requests in architectures like these. For example, a "command" message notifying a system that it can being processing a batch of data for the day only needs to be handled once per day, not 10 times, even if 10 different events are published. It'd be ghastly and inefficient to process the load 10x a day. What's required is some way to make message submission idempotent for certain messages - to make them indifferent to duplicate message submission.

Backstory: I've been playing with JBoss' HornetQ a lot recently. It's a very fast message queue: it recently bested ActiveMQ in the SpecJMS2007 benchmark by more than 300%!. It is able to perform these feats because it uses a native, asynchronous IO layer on Linux centered around the kernel's libaio functionality. On all other platforms, it's just gosh darned fast, regardless, but doesn't benefit from the native code acceleration.

So, imagine my surprise when I found out that HornetQ supports something it calls a Last-Value Header - a well known message header that - when the value is duplicated by other messages - causes the submitted message to override the existing message: the latest message with a duplicate header wins.

Here's how code submission to the queue looks using Spring's JmsTemplate functionality:

 
this.jmsTemplate.send (this.destination, new MessageCreator () { 
    public Message createMessage (final Session session) throws JMSException { 
        TextMessage textMessage = session.createTextMessage ( ... ); 
        textMessage.setStringProperty ("_HQ_LVQ_NAME", 
someUniqueStringThatYouSpecify);  
        return textMessage; 
    } 
}); 

So, it's often easy to find a business value that can be used to derive a semantically correct, unique key to identify duplicate events. Processing a customer's order with 3 items in the shopping cart at 12:30:30s PM? Build a key combining the 30 second window, the customer ID, the count of items, and the order ID. This provides a service-level mechanism to prevent nasty double submit issues, for example.

You need to enable this characteristic on the queue itself in the configuration files.

In HornetQ there are a few files under the $HORNETQ/config/ folder that you need to be aware of to configure HornetQ: hornrtq-jms.xml, hornetq-configuration.xml, and hornetq-users.xml. In this scenario, we need to only modify the hornetq-configuration.xml.

For a queue configured in hornetq-jms.xml

 
   <queue name="dupesQueue"> 
        <entry name="/queue/dupesQueue"/> 
        <durable>true</durable> 
    </queue> 

... you'll need to make the following changes to hornetq-configuration.xml:

 
  <address-setting match="jms.queue.dupesQueue"> 
          
<last-value-queue>true</last-value-queue> 
        </address-setting> 

Simple, right? So, go ahead, send all the messages you want - only one will remain (unless of course that message is consumed. This only guards against duplicate submissions assuming the messages haven't been delivered yet. Enjoy!

April 26, 2010

A New Post on Artima.com Called 'SOA, 5 Years In'

I've just posted a blog on Artima.com called SOA, 5 Years In. In it, I talk about some of the core value principals behind Thomas Erl's excellent Service Oriented Architecture: Concepts, Technology, and Design. Check it out!

March 20, 2010

The ServerSide Java Symposium 2010 Recap

I'm in my hotel room thinking about the last 3 days here at The ServerSide Java Symposium. I've had a fantastic time. I gave and/or participated in two talks: one was a talk on jBPM and Spring, the other was participation (representing Spring Integration) in a panel with Jeff Genender (representing ServiceMix) and Ross Mason (representing Mule) on ESBs. I enjoyed that process and enjoyed talking to Jeff and Ross gentlemen to the last. The 400+ people in the audience were invigorating too. Im pretty sure anybody would tell you this year was a welcome, marked improvement over previous years, especially in attendance numbers. It also heralded the introduction of a new editorial lineup, with Cameron Mckenzie taking the lead-editors position. Hes got his work cut out for him, but Im confident hes up to the task.

Rod Johnson gave a "zepo" (zero-powerpoint) Spring / Roo keynote, which was very impressive until it seemed to have failed him at the end. A post mortem revealed that the demo was fine, just a simple error. It was interesting to note that he misplaced his wedding ring and still gave a 99% performance without slides in front of 400+ people! Well done! Spring Roo seemed to garner a lot of attention from the audience and the Twitterati. Matt Raible and James Wards talk on Flex vs. GWT was fun, as expected. Jeff Genender and Keath Hesler both turned in good talks on ServiceMix. Ted Neward and Scott Davis gave their talks to great reception, as usual. Finally, my old friends Reza Rahman, Kito Mann, etc., did very well too. I missed some of the JBoss crowd (Emmanuel Bernard and Dan Allen, notably) this year, however.

It was nice meeting James Gosling, too. Can't help but feel a little in-awe. The final treat was partaking in the festivities, libations, etc., with my colleagues at Shopzilla. Tim Morrow, Senior Architect at Shopzilla, gave a very well received talk about the scale story at Shopzilla.

<< Last | Next >>