Category Archives: learning spring boot

Learning Spring Boot – 2nd edition on its way from @PacktPub

learning-spring-boot-2nd-edition-contract-headerlearning-spring-bootI just signed a contract to write Learning Spring Boot – 2nd Edition. This will nicely dovetail the Learning Spring Boot Video Tutorial I’m currently recording.

The 1st edition had five chapters. The goal was to get to market, fast, and gauge reader’s reactions, so we kept it short and sweet, focused on the most critical bits. The results were a SMASH HIT! That book catapulted forward faster than my previous titles. Packt Publishing approached me a few months ago to record a video, and at the same time, discuss doing a 2nd edition. Suffice it to say, we’ve hammered out a solid lineup.

What’s the plan? The 2nd edition will be composed of ten chapters, and is squarely aimed at Spring Boot 2.0 (which comes with Spring Framework 5.0). Spring 5 will include lots of goodness including Project Reactor support for reactive data access as well as reactive Spring MVC. In this day and age, people want stuff that scales. Spring has already proven that, but as more and more people start using things like Project Reactor, RxJava, and other stuff to squeeze more out of their servers, the Spring team has stepped up to improve things once again.

learning-spring-boot-2nd-edition-chapter-hintWe’re shooting to have it out next Spring (see how I did that?). It’s not a rehash, but some of the key lessons will re-appear. For example, a Quick Start with Java is always cool. Just see one of Josh Long’s many presentations!

We’ll dive into Spring’s support for reactive web and data access that’s in motion right now. But other hot stuff is coming as well. (This is just half of the ten chapters coming)

Stay tuned!

 

learning-spring-boot-2nd-edition-signature

 

Demo app built for #LearningSpringBoot

I’ve spent the last few days building the app I will use in the new Learning Spring Boot video. I was able to actually move quickly thanks to the power of Spring Boot, Spring Data, and some other features I’ll dive into in more detail in the video itself.

It’s really fun to sit down and BUILD an application with Spring Boot. The Spring Framework has always been fun to develop apps. But Spring Boot takes that fun and excitement to a whole new level. The hardest part was saying, “this is all I need. This covers the case” and stopping. While I have it mostly in place. Just a few bits left.

Having been inspired a couple years ago by this hilarious clip, I sought the most visually stunning and audacious demo I could think of: snapping a picture and uploading for others to see.

springone2gx2014_banner_speaking_125x125I created one based on Spring Data REST for various conferences and eventually turned it into a scaleable microservice based solution. (See my videos on the side bar for examples of that!) That was really cool and showed how far you could get with a domain model definition. But that path isn’t the best route for this video. So I am starting over.

platform-spring-bootOnce again, I take the same concept, but rebuild it from scratch using the same focus I used in writing the original Learning Spring Boot book. Take the most often used bits of Spring (Spring MVC, Spring Data, and Spring Security), and show how Spring Boot accelerates the developer experience while prepping you for Real World ops.

DSC05391I have chatted with many people including those within my own company, and those outside. They have all given me a consistent message: it helped them with some of the most common situations they face on a daily basis. That’s what I was shooting for!  Hopefully, this time around I can trek along the same critical path but cover ground that was missed last time. And also prune out things that turned out to be mistakes. (e.g. This time around, I’m not spending as time on JavaScript.)

fight1Now it’s time to knuckle down and lay out the scripts and start recording video. That part will be new ground. I have recorded screencasts and webinars. But not on this scale. I hope to build the best video for all my readers (and soon to be viewers).

Wish me luck!

 

#LearningSpringBoot Video is on its way!


I just signed a contract to produce a video-based sequel to Learning Spring Boot, a veritable 2nd edition!

This will move a lot faster than its predecessor. Schedule says primary recording should be done sometime in August, so hopefully you can have it in your hands FAST! (I know Packt has quick schedules, but this is even faster).

This won’t be some rehash of the old book. Instead, we’ll cover a lot of fresh ground including:

  • Diving into Spring’s start.spring.io website.
  • Building a rich, fully functional web app using Spring Boot, Spring Data JPA, Spring Security, and more.
  • Using Boot’s latest and greatest tools like: Actuator, DevTools, and CRaSH.

I’ve written three books. Recording video will be a new adventure. If you want to stay tuned for updates, be sure to sign up for my newsletter.

Can’t wait! Hope you’re as excited as me.

Spring Boot is still a gem…waiting to be discovered

devnexusLast week, I had the good fortune of speaking twice at the DevNexus conference, the 2nd largest Java conference in North America. It was awesome! Apart from being a total geek fest with international attendance, it was a great place to get a bigger picture of the state of the Java community.

intro-to-spring-data-devnexus-2016A bunch of people turned up for my Intro to Spring Data where we coded up an employee management system from scratch inside of 45 minutes. You can see about 2/3 of the audience right here.

It was a LOT of fun. It was like pair programming on steroids when people helped me handle typos, etc. It was really fun illustrating how you don’t have to type a single query to get things off the ground.

platform-spring-bootWhat I found interesting was how a couple people paused me to ask questions about Spring Boot! I wasn’t expecting this, so it caught me off guard when asked “how big is the JAR file you’re building?” “How much code do you add to make that work?” “How much code is added to support your embedded container?”

learning-spring-bootSomething I tackled in Learning Spring Boot was showing people the shortest path to get up and running with a meaningful example. I didn’t shoot for contrived examples. What use is that? People often take code samples and use it as the basis for a real system. That’s exactly the audience I wrote for.

People want to write simple apps with simple pages leveraging simple data persistence. That is Spring Boot + Spring Data out of the running gate. Visit http://start.spring.io and get off the ground! (Incidentally, THIS is what my demo was about).

I-heart-spring-AidenI was happy to point out that the JAR file I built contained a handful of libraries along with a little “glue code” to read JAR-within-a-JAR + autoconfiguration stuff. I also clarified that the bulk of the code is actually your application + Tomcat + Hibernate. The size of Boot’s autoconfiguration is nothing compared to all that. Compare that to time and effort to write deployment scripts, maintenance scripts, and whatever else glue you hand write to deploy to an independent container. Spring Boot is a life saver in getting from concept to market.

It was fun to see at least one person in the audience jump to an answer before I could. Many in the audience were already enjoying Spring Boot, but it was fun to see someone else (who by the way came up to ask more questions afterward) discovering the gem of Spring Boot for the first time.

CedricTo see the glint in someone’s eye when they realize Java is actually cool. Well, that’s nothing short of amazing.

Debug and Maintain your Spring Boot App

It’s out! My webinar, Debug and Maintain Your Spring Boot App, is now available to watch right here. Learn how to:

  • Figure out what Spring Boot has done, so you can tweak things as needed.
  • Discover property override settings, and not be done in by out-of-date docs.
  • Merge metrics and commands as needed for DevOps support.

I hope you enjoy this meme-tastic, code-filled webinar I hosted.

If you’re interested, the code for it can be found at https://github.com/gregturn/debug-your-spring-boot-app. The basis of this code is Chapter 3 of Learning Spring Boot. If you’re interested, you can sign up today for my technical newsletter and hear up-to-date news including alerts about Learning Spring Boot.

Today is “Day against DRM”. My fine friends @PacktPub are offering a 24-hour flash sale. #AgainstDRM

I have written three books for Packt Publishing over the past five years (Learning Spring Boot being the latest). They have supported me well. Many of you are aware of DRM (Digital Rights Management). That is coder speak for “wrapping content you bought with controls left in the hands of supplies”. I don’t dig DRM. I cheered it when free market competition brought out DRM-free music from certain vendors.

I believe in paying for content to support creators, but also having the freedom to put content I purchased on any of my devices. It’s another reason I like Packt. Their e-books have been DRM-free since Day 1 (2004). That is über cool.

Whereas I would leap for joy if you bought a copy of my book, I sincerely ask that you search their vast list of titles and pick out something you enjoy.

Happy reading!2015 Banner

 

Announcing the winner of our #LearningSpringBoot contest…. /cc @PacktPub

Over the past month, we have had several entries. We have rallied together an international set of both contestants and judges. And here are the results!

The contestants

First of all, let’s list the applications that were submitted (in alphabetical order).

1. Mercury

This app is used for piping various types of traffic over different systems. It leverages Spring Boot’s conditional settings, allowing the user to customize as needed. It also has a hypermedia-based RESTful API.

2. Polaromatic

This application shows cute eye candy. It ingests files and manipulates them to look like “Polaroid” snaphots and dynamically displays them on the screen. It has a Spring Boot CLI script to fetch pictures from Flickr. It is Groovy all the way (all the way to the web templates). It uses websockets, Spring Integration, has nice Spock test cases, and

3. VotesApp

This application is a bot that listens in on chat sessions to count votes for/against spontaneous activities. That way, they can quickly get a tally of who all is going/not going on the fly. It has a pluggable architecture, comes with a video demo on an Android smartphone, uses Project Reactor, and leverages Spring’s profile support.

The results

Each of these apps was top notch. The contestants showed real skill. As judges, it was very hard because each team went in a different direction. Spring Boot offers a lot of concise and flexible power, and each of the entries used it well, just differently.

The winner **drum roll**

And the winner is…..Polaromatic! If you want to see, the winner has a running copy here. Visit it and simply wait a few seconds to see the outcome. The team behind Polaromatic has won a free copy of Learning Spring Boot.

Thanks for all who entered!

Valuable things I have learned while writing three books for @PacktPub

I recently had a friend of mine ask me about the viability of writing a book for his open source project. He had questions about how to submit a proposal as well as the money involved. I wrote him a detailed response, but decided to post some of my lessons learned here.

Don’t write a book for the money

This is definitely a worn out expression. I have seen people get this starry gleam in their eye, Sorry, but that only happens when you write a best selling, fictional trade novel. Not everyone can be J.K. Rowling. In fact, there are actually a very small number of authors who make it big. The real name of the game in writing is to write LOTS of books, such that over time, people that like your material end up buying all your titles.

When writing technical books, you still need to sell a bunch to really make any money, but we are forever cursed by books going out-of-date in just a few years. Trade novels last a lot longer.

That may sound a tad depressing. So why write book? Because it can open doors you never knew would happen. When you are a published author, it can impact interviews, speaking engagements, consulting opportunities, and other things. It is always a major +1 to your CV to have written a title. Even more if you get several under your belt. It also increases your overall name recognition and personal brand.

Understand what you’re getting into

Before expending any effort in writing, I made sure we had a contract in place that we both agreed to. I’ve read article where people keep writing chapter after and yet have not signed an agreed upon contract. I don’t work that way. You are taking on risk by doing that. Until a contract is in place, the publisher can bring onboard other writers.

I have historically preferred to write my titles by myself. It lets me control the content 100% and not have to deal with interacting with another author, one who might/might not be as motivated as me. As a nice side effect, it also ensures that I get all the money. Since we’re already talking about a small pile of money, it feels counter production to split it up amongst two or three people.

Packt’s contracts include an option of first refusal for your next two titles. I understand Packt’s desire to get first dibbs on future work. It make business sense, so I had no issue with this in my first two titles. But on the third one, I had decided they had made enough money on me. I asked that this clause be removed to liberate me for future works. I have no hard feelings nor have I felt any malice from anyone at Packt.

Be sure to understand that the contract includes deadlines and exactly how much money you’ll be paid and when. If you sign the contract, you are agreeing to everything stated. Understand what you are agreeing to.

It’s your title. Act accordingly

Every publisher out there will probably tell you how glorious their marketing and sales team is. But for you to write a book and make no mention on Twitter/FaceBook/Google+, nor to write a peep on your blog site is ridiculous. You should be blogging all the time as you write and beyond publishing. Don’t assume that your publisher will automatically sell 1000 copies of your book and be fired up to order another batch!

Another aspect of “acting accordingly” is to remember this will reflect first and foremost on YOU. If you have a certain voice or a style of presentation when you speak at conferences, then by all means, try to write that into your manuscript. Your editors may try to edit that out. If you give them the upper hand, they can reduce your effuse writing into boring humdrum. I’ve seen editors edit out some of my sassy writing. My response? I edit it back in! They don’t usually push back too hard.

It’s important that the publisher have a certain level of quality. But there needs to be enough of YOU in whatever you write that makes it stand out.

Go and read other people’s technical books. Part of this inspiration for me came from a couple other technical books I read. The style these author’s wrote knocked me out of my chair. I LOVED the small jokes, clever class names, and funny material they injected into their writing. And it told me I could do the same, as long as it wasn’t offensive or obnoxious. Again, my editors pushed back, but I paid keen attention to EVERY edit, and undid several of these. I wanted my book to be fun.

Making your book fun is no one’s job but yours.

Take credit for your work – give credit to others

In my latest title, I started each chapter with a quote from twitter. “Spring Boot” was so hot, that I started collecting tweets as I wrote. I would launch a chapter, and include a link to that user’s twitter handle. Their comments were inspirational. I hope they picked up new followers.

At the same time, I gave a presentation that pre-dated release of my book. I mocked up a logo of the book with the title in it, and included that in my profile slide at the beginning. This was a PR moment I wouldn’t pass up. I wanted everyone in that audience to know a book was coming, and hopefully they all bought a copy!

That same week, my colleagues and I trekked to a JUG meeting. Someone in the group asked, “Is there a book on Spring Boot coming?” Everyone turned to me, and I happily gave them the estimated release date. More free PR. I also was sure to cc more than a handful of tweets to that group’s twitter handle. Hopefully they each bought a copy! (Not likely, but one can dream, right?)

Finally, I wrote my last title using asciidoctor thanks to Dan Allen. This was by far the best option. It allowed me to focus on quality content and not idiotic Word Processor issues.

Knuckle down and write

Okay, all these suggestions up to this point are nice and all, but it’s all for naught unless you put in the hours to actually write your book. I read someone’s blog article where they thought the deadlines were crazy since they only planned to write on the weekends.

Sorry, but I don’t have much sympathy there. I wrote each of my books while we also had a newborn baby. I quickly adopted the style of writing every night after everyone had gone to bed. This way, I could focus with no distractions, and then take the weekend off. Writing every night from 10pm-midnight can be exhausting when you mix it with feeding a baby at 2 AM, but this ensured that I got my book finished and out the door. It also cut down on the risk of my technology moving away from me too quickly and making the material invalid, or avoiding massive rewrites due to mega-changes.

Another thing you have to be ready to do is carry your book all by yourself. You can’t depend on certain reviewers to fix things for you. Instead, you need to be ready to proof read in the event your book reviewers don’t actually give you any feedback until the last minute. It’s sad, but this still reflects on you.

There were times when I hit bugs in my sample code, and had to simply pack up for the night. There were other times when I had no choice but to work an extra two hours to hammer out a problem that no one else could help me with, either in my asciidoctor backend, or in my sample code. After all, no one was going to pick this up and fix it, right? Leaning on pull requests, etc. is no excuse for not writing your book.

I demoed Spring Social GItHub in my latest book, and had to go to press using version 1.0.0.BUILD-SNAPSHOT because the project lead was simply too backed up to fix the milestone release already published which broke my book’s sample code. Them’s the breaks.

So by now, if I haven’t smashed your dream of writing a technical book too badly, I wish you only the best in going out, submitting a proposal, and snagging a contract.