Categories
Development

Replacing legacy systems: Proxy to learn and control

TL;DR – Create a custom proxy to make sure you know how the old system behaves and can transition off it in a controlled manner.

A couple of weeks back I held a talk at JavaZone about replacing legacy systems (Norwegian only, sorry). One of the techniques I talked about that seemed to spark an interest was creating a custom proxy to take control and figure out what the old system does.

Not a dedicated proxy like Nginx or Apache, a custom proxy in the language and technology you are comfortable with. It can ease the replacement and transition a lot.

For us that was KTor Server+Client.

What?

When you have a system with a Webapp, Mobileapp and API like this:

You can take control of the system by introducing a proxy like this:

Simple as that. 😉 HTTP request in, HTTP request out, receive response and send response back to the source. A bit of fiddling around, but you essentially copy everything forward and back. Headers, Method, response codes and of course body.

The figure above also shows how we used the proxy to double check some data results in the DB before switching out the legacy system (the dotted lines).

Why?

By creating a custom proxy you can monitor, log, analyze and even compare results. All in your preferred development language.

When you gain insights into how your system is working, you can manage which parts controls and receives each call.

Wan’t to switch over based on user-id? That’s a simple conditional statement in your proxy code.

Switch gradually based on endpoints? Even easier, just change which system is the recipient for your call.

Subscribe new content:

How?

We used KTor Server+Client because it made it easier to know that coroutines were handled correctly but you could also use OKHttp as a client if you wanted.

Be careful with big payloads though, stream the results as a default, and only load the body into memory if you know the size and actually need to analyze or modify (don’t) it.

I don’t have the proxy as an example myself but this doesn’t look like a bad starting point: https://github.com/ranbims/ktor-server-proxy/blob/main/src/main/kotlin/org/ranbi/HttpProxy.kt

No HTTP?

Yeah, that’s harder. But still just streams of bytes back and forth. Even Cobol Copybooks has a format that can be parsed. 🙂

Happy migrating 😉

What’s your best techniques for migrating off legacy systems?

Categories
General OS tricks

Powerpoint presenters mode in VirtualBox

After switching to Linux as my main operating system I was expecting problems. Even though it has come far, it’s not really your granny’s operating system. 😉 I don’t use much Windows only software, but one of the problems was definitely going to be working with Powerpoint.

So I figured VirtualBox with Windows and Powerpoint would be a decent solution. And it has worked like a charm.

But I did miss presenters mode when doing the talks, and never really thought it would be possible. Until I discovered that you can change the number of displays associated with your VM. 🙂

It’s not without it’s quirks, but doable if you get used to it. So you can do:

  • Plug in your external monitor
  • Make sure the Linux settings are correct with resolution and placement
  • Make sure the VM isn’t started
  • Go into settings > Display on you VirtualBox VM
  • Set the VM to have 2 displays
  • Boot the VM
  • Go full screen with the VM
  • Configure windows settings to reflect multiple displays and resolution and position
  • Start PowerPoint and do F5 for presentation

It should work now. 🙂 Good luck with your presentation… 😉

Categories
Development

XP2010

So last week I was lucky enough to attend XP2010 in Trondheim. It was an intense week with great people and great content. It’s kind of hard to process all this content, but it’s time to try.

After listening to the excellent advice of Ole Christian I attended the workshop of Chris Matts on Feature Injection . It was absolutely one of my best sessions at XP2010 and it turned out to be really relevant to what I’m doing at my current client. I think I’ll be able to use a lot of this when it comes to working with the requirements and really understanding what matters.

After an intense workshop it’s always good to listen to Mary Poppendieck talk about Lean in a nutshell . I’ve heard or read a lot of her stuff before, but she has a really unique way of explaining and selling her point of view. I always learn a lot from listening to her.

Ole Ellnestam and Daniel Brolund rounded off the day in a nice way with Mikado refactoring . It’s an interesting and structured way of doing large refactorings. I’ve done something similar with rolling back changes when I get stuck, but this is a nice structured way to approach it. Now if only my computer hadn’t been acting up I would actually be able to practice it a bit more.

The second day started out with a bang, first with a keynote by Scott Page, then listening to Cory Foy talk about craftsmanship. Head over to the program page of XP2010 to see the videos. It’s really worth the time. While you’re there also check out the talks by Mary Poppendieck and Marcus Ahnve.

Now I must admit that most of thursday was lost to my nerves, as I was holding two lightning talks that day. Of the ones I saw and really liked was the talk of Jonas Follesø about the Blackbox Recorder . This sparked quite an interest in the Java crowd, so some started the Java version: Jackbox Recorder . Sadly one of my talks was at the same time as the My Agile Suitcase Pecha Kucha, so I didn’t get to see it. I heard great things about it. Luckily there’s video out.

On the last day, conference fatigue were setting in. But I got a great session of Coding Katas. Interesting to both see other languages and other people code. I really also liked the workshop Cory Foy gave on innovation games. It opened my eyes on how to do facilitation around requirements and features, and tied quite nicely into the stuff from the first day with Feature Injection.

Well, this is just a try at writing down what I remember and process some of the information. I know it’s summary, just let me know if there’s something I should expand ont.

It was really a great conference, like none I’ve attended before. Thank you to all the brilliant people that I met and the organizers.