Easy integration with Spring Integration

So I’ve had the opportunity to use Spring Integration recently and I thought I’d do a blog post about it – partly for my own review/recap/learning but also for anyone out there looking to play around with it. In a nutshell Spring Integration lets you integrate with other systems without having to deal with all the boilerplate concerns of your typical enterprise integration solutions. It provides a number of integration adapters straight out of the box for common integration methods such as: files, jms, jdbc, ftp and so on (take a look at the Spring doco for the full set).

The general gist of things has you defining a series of channels of which the endpoint may be the entry or exit to the system. One endpoint may be the entry point to another channel. E.g. in the following A<——–>B is a channel with A as the input and B as the output endpoints. B<——–>C is another channel where the output B from the A<——–>B channel is the input and C the output.

A<——–>B<——–>C

To really see how it all hangs together I’ve knocked together a little working example to integrate with Twitter using the built in Twitter Adapter. The app basically polls Twitter with a search on a hashtag, adds a field to the header then passes the message on to a service to be dealt with – in this case we are just going to print out to System.out. Sounds complicating, but Spring makes it easy – take a look at src/main/resources/twitter-integration.xml.

[xml]
<channel id="inboundMentionsChannel"/>
<channel id="inputServiceActivatorChannel"/>
[/xml]

This defines the channels, note that we haven’t actually specified what the endpoints are yet…

[xml]

<twitter:search-inbound-channel-adapter query="#springintegration" channel="inboundMentionsChannel">
<poller fixed-rate="5000" max-messages-per-poll="3"/>
</twitter:search-inbound-channel-adapter>

<header-enricher input-channel="inboundMentionsChannel" output-channel="inputServiceActivatorChannel">
<header name="headerField1" value="dummy header value"/>
</header-enricher>

[/xml]

This is the interesting stuff where we link all the endpoints and channels together. Lines 1-3 define the inbound adapter (endpoint) which connects the system with Twitter. This is a search-inbound-adapter that polls for a twitter search using the specified query – in this case the hashtag #springintegration.

Lines 4-7 defines a header enricher. This allows us to pop values into the message header that can be used downstream. For this example we’re just populating a field called ‘headerField1’ with a dummy value. We’re not actually going to use this field for anything in the example but I wanted to show how easy it was to add info to the message header. The header enricher also has an input channel and output channel specified. As you may have worked out the input to the header enricher is from the endpoint of the ‘inboundMentionsChannel’, which in this case will contain the results from the Twitter search. And the outbound channel is to a service activator which references the TwitterService bean (bean is autowired).

If you take a look at TwitterService.java you’ll see that it prints out to System.out and adds the tweet to a list. Running the test case TwitterIntegrationTest.java you can check that the output matches the expected tweet search result count of 3.

twitter-integration.zip

Back to WordPress

So after a bit of procrastination I finally bit the bullet and attempted the migration of my website back to using WordPress as the CMS. For those tech dudes out there, or those who follow my happenings, you might remember I started out on Blogger, migrated to WordPress than on to Drupal. My main reason for moving back to WordPress is that whilst Drupal was awesome as a CMS I predominantly use my website to blog, and for that WordPress  excels. If I had to run a fully fledged website, I’d definitely fall back to Drupal though as there are things that it excels at there.

I’d put off the migration for ages as there is no quick and easy way to migrate from Drupal to WordPress. You have no choice but to run SQL commands. On top of that I still had my original WordPress blog that I wanted to ‘keep’. I’d never bothered to migrate these into my Drupal site, but now I was going back to WordPress I wanted them all in the same site.

So for anyone on the web thinking of making the move back (or to)… here are the steps that I followed… Do make sure you take a backup of your database before hand though, as whilst these steps seemed to work successfully for me, they may not necessarily work for everyone. Hence take these steps as a guide only…

  1. Take a look at Convert – Import A Drupal 6 Based Website To WordPress v2.7 and follow the instructions there. Some differences for my setup is that I installed WordPress (Version 3.0.3) instead and didn’t bother to delete the Drupal tables as I was going to get my data back into Prod a different way.
  2. Check your development WordPress install and ensure it looks right
  3. OPTIONAL STEP: If you have a previous WordPress site that you want to keep content from as well, use the Export function in the previous install to download a WordPress export file. Import this into your new WordPress site using the Import function.
  4. On your development WordPress use the Export function to download a WordPress export file. This export files will contain all the data you want to use in your new site. E.g. in my case this was all my Drupal content plus the content from my original WordPress site.
  5. Install WordPress to your Production server
  6. Use the Import functionality to import the export file you downloaded in Step 4.
  7. Check that your Production WordPress looks correct.

As 2010 comes to a close…

Well it’s the 1st of December and the end of 2010 is almost here. I think that feeling of the year going by faster each year you get older definitely holds true.

So what has 2010 been for me? 2010 has been a mixed bag of things. Some good, some not so good. But coming up to the end of the year I’d have to say for the most part things have worked out all right in the end. And I guess ultimately I’m happy with that 🙂 If I had to pick two highlights of the year, I’d reckon I’d have to pick the big trip of USA2010 and finally making a decision on my pottering.

All in all, I’m looking forward to 2011! And if I don’t post again before the end of the year… Merry Christmas & Happy New Year (though if you’re reading this blog I’m fairly sure I’ll see you before then :-p )

Change is in the air

So its only been a month since coming back from holidays yet it feels so long ago. There’s been a bit happening in my life at the moment, but everything’s all good.

Without delving too much into it though, the main change in my life is that I’m starting a job at a different organisation in a few weeks. Whilst it will be sad to leave where I’m at now I am quite excited and looking forward to the new role. It’s going to bring a new set of challenges, and I’m sure there is going to be many fun and challenging experiences along the way.

Almost homeward bound

So it’s time tomorrow for a flight down the west coast back to Vegas which means the USA 2010 adventures are almost at an end.

The time here in Seattle has been rather nice. Good food and coffee and time to relax and recover from hectic adventures. Made the trip up the Space Needle and out to the Boeing factory and also did a ferry trip out to Bainbridge Island for breakfast and a walkabout.

As there’s not really any free wifi in Vegas, you’ll probably hear from me when I’m back home…

The epic Disney rundown

First things first though… Have made it to Seattle with yet more fun of sorts. After an early start, made it to Orlando airport and got on our flight all okay. Flight took off on time and landed in Chicago a bit before schedule. Which seemed great seeing we only had a 40 min connection window. Until the plane had to be gated… Storm had just been through and all the ramps/gates had been closed so we had to sit and wait for ages in the queue as time ticked away. Checked madly on mobiles to see what the status of the next flight was (hoping it was delayed) and it said it had moved 15 mins. But getting of the plane took time. Fly domestically in the US and you’ll soon find out why – carry ons are huge!

Finally got off at 9:51am which was the time of the next flight. Airport was still showing a 9:51am departure so a mad dash was made for the next gate in diminishing hope. Bear in mind Chicago is the 3rd busiest airport in the world based on passenger traffic, and to add to that our gate wasn’t even in the same concourse! So ensured crazy 2 mins of running with a backpack, muppet and drink bottle in tow with me coughing and wheezing along the way. And made it just in time! Funnily enough after checking email in Seattle, United themselves had already assumed a missed connection at 9:45am and autobooked for the next flight.

Now for the Disney rundown – apologies for the super long blog but I know some people might be interested in the adventures (hi mum!). So did the Disney World thing as a vacation package – staying at a Disney resort, 5 day park hopper and the Disney dining plan for the duration of the stay. A great experience and would recommend it anyone. It’s not really what I’d call cheap but if you can make use of one of their special offers it does help (e.g. we had an offer than gave the dining plan for free). What was awesome, was we didn’t have to worry about anything apart from what theme park to go to. It felt like a vacation!

Had to do some planning about which theme parks to hit on which days though, as Columbus weekend was happening when we were there which means massive crowds. Seemed to work out all good though as don’t think I queued any longer than 30min for a ride over the 5 days. In fact most times I only queued 5 – 15 mins!

I’ll leave the rest of the rundown to the pics…Have organised by park, resort etc for ease

Magic Kingdom

P1020681
Welcome to the Magic Kingdom

P1020275
Always a fave, Splash Mountain

P1020691
End of Splash Mountain ride

P1020278
Cinderella Castle

P1020291
Goofy

P1020296
If you keep you’re eyes peeled you can spot ‘hidden mickeys’ like these

P1020301
Celebrate A Dream Come True Parade

P1020650
Electrical Parade – this wasn’t that great…

P1020660
Wishes Nighttime Spectacular

P1020662
Wishes Nighttime Spectacular

P1020675
Wishes Nighttime Spectacular

Animal Kingdom

P1020378
Slightly lopsided photo of the entry

P1020390
On the ride Kilimanjaro Safaris passengers ride in an open air vehicle through the Africa part of Animal Kingdom hopefully spotting animals such as this giraffe

P1020395
Or an 8 week baby elephant! Heaps of other animals too, but bit hard to photo take from a moving vehicle…

P1020398
Bad photo of me, but hey I was trying to co-pose with the dude from A Bug’s Life

P1020405
Expedition Everest, a really good coaster even if bits of it did make me feel a bit sick

P1020422
The ‘Tree of Life’, yes placed in the middle of the park

Epcot

P1020313
Wasn’t sure if I’d enjoy Epcot, but I’m suprised to admit it probably was my 2nd fave park.

P1020314
Food and Wine festival was on… maybe why I liked the park more than I expected?

P1020340
And Tigger was bouncing the whole time…

The next 4 photos documents what begins the excessive amount of food… this constitutes a table service dinner for two… not to mention the soft drink and coffee!

P1020344

P1020347

P1020348

P1020349

P1020368
Character photos at 11:30 at night are fun…

P1020477
Epcot IllumiNations: Reflections of Earth show

P1020499
Epcot IllumiNations: Reflections of Earth show

P1020501
Epcot IllumiNations: Reflections of Earth show

Following lot of pics are from Food and Wine Festival and again highlight the absurdity of the dining plan as all of these bar the drink count as a ‘snack credit’

P1020510

P1020511

P1020512
Tasty frozen Bacardi Limon Mojito

P1020518

P1020519

P1020524
Didn’t try this – but this is a snack?!? That’s a lot of food…

P1020531

P1020535

P1020536

P1020537
These scoops were huge… (and yes the ice cream was a snack credit). It’s impossible to get through one scoop alone!

Hollywood Studios

P1020568

P1020564
Tower of Terror

P1020577
Toy Story Mania, if you want to ride this make sure you go here first… at 9:30am FastPast return times were after 4pm already!

P1020582
Piglet

P1020592
This is 2 quick service meals… That thing on the right is a turkey leg… best described as tasting like a giant salty christmas ham leg…

P1020593
Yes it really is that big. I reckon it’s enough to make turkey sandwiches for a week!

Port Orleans, Riverside resort
The resort stayed in…

P1020437

P1020439

P1020440

P1020442

P1020445

P1020465

Grand Floridian Resort & Spa
Luxury resort that dinner was eaten at one night

P1020600

P1020604

P1020606

P1020607

P1020621

P1020622

P1020623

P1020628

P1020629

P1020627

Disney World Resort = one epic awesome adventure!

So in the end it was no internet for the 5 days at Disney World. The days were just too long and epic to comprehend using a computer at night.

All I can say to sum up the 5 days is the word AWESOME! And after 5 days of awesome I’m a little worse for wear – somewhat sick with a really sore throat. I’ll have to do a post Disney rundown at a later stage, but all 4 parks (not counting the water parks) were visited, many rides ridden and an awful lot of food eaten. Don’t underestimate the Disney Dining Plan… trust me you won’t go hungry. If anything thinking about the immense amount of food on offer is enough to make you cringe at times. Times such as when lunch includes a dessert!

Gonna have to leave it here, as need to rest and rid myself of this dreaded cold/sore throat thing.

It’s nice and sunny in Orlando

So made it to sunny Orlando yesterday evening with only minor delays out of New York City’s LaGuardia airport (yes it rained again!). The agenda of the next week is pretty much theme parks, theme parks, theme parks, shopping, more shopping and Kennedy Space Center (NASA).

Today the theme park extravaganza started with Universal’s Islands of Adventure theme park. There’s two Universal parks in Orlando, but we chose the Islands one as it has more thrill rides, plus it has the Wizarding World of Harry Potter. First stop was Hogwarts and Hogsmeade as the queues get fairly long later in the day. First ride of the day was the flagship ride Harry Potter and the Forbidden Journey a indoor robocoaster/dark ride. Now the ride did warn those with motion sickness (but most rides do this anyway), so when it came to loading and it was an over-the-shoulder harness I then realised that maybe this was a thrill ride of sorts. And it was, as it killed of the idea of riding any other ‘thrill’ rides, making me feel really sick within the first 30 seconds. Had to keep my eyes closed for more than half of it, and actually started thinking of how I could elegantly be sick if I had too! That said what I saw of it was excellently done, and the waiting line areas were brillant. Talking portraits, hallways, the classroom.

After a pause to recover – and realising age must be catching up with me as I never use to feel sick on rides – headed on to ride other somewhat more passive rides in the park. Some awesome water rides were ridden and at one point I was soaked all over.

Finished up mid afternoon and headed to the outlet mall nearby. And left a little bit poorer. Tomorrow morning up early to cart selves and stuff over to Walt Disney World for the next 5 days.

Blogs may be light on pictures the next week… days are pretty long/tiring…. but expect a typed post 😀

Finally New York City… and just in time

So if you follow my Twitter updates, you probably saw that the flight to NYC from Buffalo didn’t exactly go as planned. The leftovers of Hurricane Nicole hit the east coast and pretty much caused chaos in the north east region on the USA with heavy winds and stacks of rain. Didn’t know how bad it was as after clearing security grabbed something to eat before heading in the general direction of the gates. Where it soon became apparent that air travel hell was about to begin. Flight before us to JFK was cancelled, and pretty much every other airline had cancelled there flights to NYC and upper NY state with only a lucky few delayed. At first all was okay and the flight just kept getting delayed, but when the ATC system then went down it was pretty much over. With all the bad weather there were less slots into JFK and eventually the flight got cancelled.

Then it was trying to get to NYC the next day as had tickets to Rock of Ages in the evening. The system had rebooked us for like 6:45pm which would not have worked at all. But luckily there are 3 airports in the NYC region so after letting the guy know we didn’t care which airport we flew in, he managed to get us on a flight. Except it went via Atlanta which actually required flying south to about halfway to Orlando, then back north to NYC. Got the flight to Atlanta all okay in the morning and everything seemed good. Then the next flight got delayed… and got more delayed. Storm had intensified and La Guardia had high winds and 3+ hour delays! Started seeming like NYC was never going to happen as by this stage had lost a night, plus half a day (and growing). Eventually we got confirmation we could depart and let’s say I was quite glad when the plane was finally in the air.

After a very grey and rainy arrival into NYC it was off to the hotel to dump bags before picking up the Rock of Ages tickets for that night. Some food and a stroll through Times Square and it was back at the theatre. All I can say is that Rock of Ages definitley rocked! Highly recommend it. Don’t know if the Australian version (starting in November I think?) is going to be as good though.

As for today, looks like the remanants of the hurricane have gone. Blue sky all around. As this is the second time to NYC and compounded with the loss of days due to the delay getting in, kind of taking it as it is. Not really doing the touristy things as have done them before. But did make it to Grimaldi’s in Brooklyn and yes the pizza is really good. Joined the queue and got in when they opened which was good timing. In the afternoon trawled some shops and made a muppet at the Muppet Whatnot workshop at FAQ Schwarz. That was good fun… don’t know how I’ll get my muppet home yet though but I’m sure I’ll work out a way.

As for tomorrow, think it’s the American Museum of Natural History (the Night at the Museum museum) and a visit to the High Line park. Then shopping.

No pics from NYC as the hotel does’t have free wireless… so I’ve typed this blog up before hand and am now posting it from a museum (except a day later from when I typed it)…