Tag Archives: JRebel

Adding WebSocket endpoints on the fly with JRebel and Spring Boot

via Adding WebSocket endpoints on the fly with JRebel and Spring Boot | zeroturnaround.com.

Enough REST! Leap by switching to WebSockets with JRebel and Spring Boot

REST and RESTful web services are awesome with a number of benefits, though WebSockets are on a whole new level and solve a number of problems that RESTful HTTP really can’t. The number one benefit of WebSockets is that fast full duplex bi-directional communication channel, that will deliver all your goods with lightning speeds, making all your RESTing buddies seem like a herd of snails traveling through peanut butter. If you’d like to see the numbers behind the claim you can take a look at these comparison benchmarks.

While Spring in general is the most popular java web framework out there, it’s also one of the largest and most feature-rich frameworks. It’s quite easy to get lost in the Spring Universe and forget why you even set off to write some code in the first place. Spring Boot is a project created to make sure you never get lost and even gives a helpful nudge now and then to speed you along. It consists of Starter POMs, which you can easily add to your project to add another piece from the Spring Universe, while not worrying about dependency versions and keeping your sanity.

And finally to rocket propel us forward, we’re going to use JRebel to make changes on the fly without waiting for Spring Boot to restart. JRebel replaces code in the running JVM and integrates with Spring and over 80 other frameworks, so you can view code changes instantly.

A JRebel Ticket Monster on OpenShift

via JBoss Tools – A JRebel Ticket Monster on OpenShift.

JBoss Developer Studio allows you publish and run your Eclipse projects on OpenShift. This post shows you how to get started using the JBoss Developer Ticket Monster demo application.
In a 2nd part I will show you how to change your code in Eclipse and have those changes instantly available on OpenShift using the JRebel cartridge.

Updating code at runtime (spring-loaded demystified)

via Updating code at runtime (spring-loaded demystified) | Java Code Geeks.

When the development cycle from compile over deployment up to testing takes too long, one wishes to be able to replace the running code just in time without the need for restarting an application server and waiting until deployment has been finished. Commercial solutions like JRebel or open source frameworks like Grails help in such kind of situations.

Replacing code at runtime is not supported out of the box by the JVM in a kind like you can dynamically load classes with for exampleClass.forName(). Basically you have the following options:

  • HotSwap: A technolog introduced with Java 1.4 that allows you to redefine classes within a debugger session. This approach is very limited as it only allows you to change the body of a method but not the addition of new methods or classes.
  • OSGi: This technology allows you to define bundles. At runtime a bundle can be replaced by a newer version of this bundle.
  • Throwaway classloaders: By wrapping a separate Classloader over all classes of your module, you can throw away the Classloader and replace it, once a new version of your module is availalbe.
  • Instrumenting classes with a Java Agent: A Java Agent can instrument classes before they are defined. This way it can inject code into loaded classes that connects this class with one version of the class file. Once a new version is available, the new code gets executed.

Configure JRebel with Docker containers

via Configure JRebel with Docker containers – Tech Tip #81 – Miles to go 2.0 ….

JRebel allows you to skip build and redeploy process by instantly deploying your application to the application server of your choice. It is supported in all the major IDEs such as NetBeans, Eclipse, and IntelliJ. It is also supported in a wide variety of application servers such as JBoss EAP, WildFly, WebLogic, WebsFear (err, WebSphere), Tomcat, and many others.

You can easily get started with JRebel in JBoss Developer Studio  or Integrate JRebel with JBoss on your local desktop. It can also be easily used with JBoss Developer Studio and Ticket Monster on OpenShift.

This Tech Tip will explain how do you set up JRebel with Docker containers. Specifically, we’ll use the sample application provided by Java EE 7 Hands-on Lab (jrebel branch), JBoss Tools with Eclipse Mars M5, and running the sample application in WildFly Docker container.

Many thanks to Adam Koblentz (@akoblentz) for helping me through the steps!

Lets get started!

Video: Spring Boot and JRebel 6.0

Slides: https://speakerdeck.com/joshlong/boot…
Spring Boot, the new convention-over-configuration centric framework from the Spring team at Pivotal, marries Spring’s flexibility with conventional, common sense defaults to make application development not just fly, but pleasant! Spring Boot gives you a huge leg up over normal starter projects, now let’s give you another boost by adding JRebel. With JRebel, the average Java developer saves over 1 work-month per year by using JRebel to skip rebuild, restart, and redeploys of their application. JRebel 6 launches on November 4, 2014 and includes complete Spring Boot integration. Join Spring’s Josh Long and ZeroTurnaround’s Adam Koblentz and learn how to combine Boot with JRebel and get more done, in less time with less configuration.

Video: NetBeans Debugger Intro

This video is a quick introduction to using JRebel with the NetBeans debugger. JRebel takes the Apply Code Changes functionality to the next level. No more redeploys, rebuilds, or application restarts while coding. With JRebel, you can view code changes instantly. Grab a trial here:http://0t.ee/netbeansvideo