Reactive Programming in Java using RatPack

Posted by Unknown on

For starters, Ratpack is built on the same non blocking, event driven, model as Node.js
This type of non-blocking and asynchronous programming model has become very popular of late
Although, asynchronous programming has many advantages, such as predictive performance behavior under load, it is equally challenging and tricky to implement this style of programming.

Ratpacks value proposition comes from it's ability to abstract some of the complexities associated with asnyc. programming model at the same time provide integration with best in class Java librariries to implement modern day application.

Development Environment
Unbuntu 17.10
Oracle JDK 9.0.1
Sublime V3.0
Groovy

I would strongly recommend SDKMan while programming on Linux as it simplifies management of multiple versions of software packages. 

Getting started with a helloworld code is two step process and takes under a minute.

start with a gradle file definition

File: build.gradle

buildscript {
  repositories {
    jcenter()
  }
  dependencies {
    classpath "io.ratpack:ratpack-gradle:1.5.1"
  }
}

apply plugin: "io.ratpack.ratpack-groovy"
apply plugin: "idea"

repositories {
  jcenter()
}

dependencies {
  runtime "org.slf4j:slf4j-simple:1.7.25"
}

File: src/ratpack/ratpack.groovy

import static ratpack.groovy.Groovy.ratpack

ratpack {
    handlers {
        get {
            render "Hello World!"
        }
        get(":name") {
            render "Hello $pathTokens.name!"
        }
    }
}

Run Ratle server
gradle run


This should bring up the server on http://localhost:5050/

Refer official guide for more details on Ratpack programming
https://ratpack.io/manual/current/quick-start.html


33 comments:

  1. In the event that you are tense in your taekwondo class your body creates more adrenaline. This is your battle flight hormone. It is helpful on the off chance that you are in physical risk. Be that as it may, in class it just consumes your muscle vitality. Also, you are left depleted and tired. You kicks get moderate and substantial.

    Strain additionally makes your muscles solid. Furthermore, firm muscles can't work appropriately. You move more like a robot than a man. Your methods can't stream legitimately. Your kicks get moderate and powerless. What's more, you're more inclined to wounds.itfofindia.com.

    ReplyDelete
  2. Greetings, All the posts are very informative for the people who visit this site. Good work! Carry on.
    We are the Best eCommerce website Design & Development company in Delhi,Noida (Quality Zone Infotech). Please feel free to visit our site. Thank you for sharing.

    ReplyDelete
  3. I got lot of informations from your blog.Please keep us informed like this.And thanks for sharing!!!
    Seo Company in Chennai
    Digital Marketing Company in Chennai

    ReplyDelete

  4. Thanks for sharing such a nice and interesting blog with us...

    SAP ABAP Training in chennai

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete

  6. Nice to see your blog post.. I really enjoyed by reading your blog post.
    Informatica Training Institute in chennai

    ReplyDelete
  7. He informed himself that footed free online movies arrows weren’t so much use in a siege, anyway. What’s the factor of an arrow that doesn’t shatter or crack on impact? That handiest manner the enemy will fire it back at you.

    ReplyDelete
  8. CIITN is the Best Php training institute in Noida and delhi Ncr. You will get Live Project Training on PHP by our PHP expert who have 5+ year industrial experience.Focus on practical and live project training. In our PHP training, we you will learn core PHP, advance PHP, HTML, CSS, JavaScript, jQuery, Bootstrap, Cake PHP and Wordpress.CIITN provides 100% job assistance in PHP training. CIITN is well known PHP coaching center because our 100% PHP students are placed now.


    Ciitnoida provides Core and java training institute in noida. We have a team of experienced Java professionals who help our students learn Java with the help of Live Base Projects. The object-oriented, class-based build of Java has made it one of most popular programming languages and the demand of professionals with certification in Advance Java training is at an all-time high not just in India but foreign countries too.

    By helping our students understand the fundamentals and Advance concepts of Java, we prepare them for a successful programming career. With over 13 years of sound experience, we have successfully trained hundreds of students in Noida and have been able to turn ourselves into an institute for best Java training in Noida.


    php training in noida
    java training institute in noida
    javascript training in noida
    linux training in noida
    linux institute in noida
    red hat linux training in noida

    ReplyDelete
  9. By helping our students understand the fundamentals and Advance concepts of Java, we prepare them for a successful programming career. With over 13 years of sound experience, we have successfully trained hundreds of students in Noida and have been able to turn ourselves into an institute for best Java training in Noida.
    https://topacademictutors.com/

    ReplyDelete
  10. I have really happy to these reading your post. This product control and maintenance of our health.The daily routine can assist you weight lose quickly and safely.My life is completely reworked once I followed this diet.I feeling nice concerning myself.

    Herbalife in Chennai
    Herbalife Nutrition Products
    Nutrition centers in Chennai
    Weight Loss in Chennai
    Weight Gain in Chennai

    ReplyDelete
  11. By helping our students understand the fundamentals and Advance concepts of Java, we prepare them for a successful programming career. With over 13 years of sound experience, we have successfully trained hundreds of students in Noida and have been able to turn ourselves into an institute for best Java training in Noida. https://aiwah.pk/
    http://watchtvdrama.com/
    http://watchtvdrama.com/bigg-boss-12/
    http://dramavideo.co/
    http://dramavideo.co/colors-tv/bigg-boss-12/
    http://www.unikaas.com
    https://unikaas.com/replica-clothing-supplier/
    http://bikeparts.pk
    http://desiseries.com

    ReplyDelete
  12. This is really interesting post, Appreciate the effort in educating us. We do provide
    Web Design Company in Bangalore | Digital Marketing Company in Bangalore

    ReplyDelete
  13. I just see the post i am so happy the post of information's.So I have really enjoyed and reading your blogs for these posts.Any way I’ll be subscribing to your feed and I hope you post again soon.
    best selenium training institute in hyderabad
    best selenium online training institute in hyderabad
    best institute for selenium training in hyderabad
    best selenium training institute in hyderabad

    ReplyDelete
  14. I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog.

    ReplyDelete
  15. An amazing web journal I visit this blog, it's unbelievably wonderful. Oddly, in this blog's content made without a doubt and reasonable. The substance of data is informative.
    Oracle Fusion Financials Online Training
    Oracle Fusion HCM Online Training
    Oracle Fusion SCM Online Training

    ReplyDelete
  16. This comment has been removed by the author.

    ReplyDelete
  17. Good article
    Sanjary Kids is one of the best play school and preschool in Hyderabad,India. The motto of the Sanjary kids is to provide good atmosphere to the kids.Sanjary kids provides programs like Play group,Nursery,Junior KG,Serior KG,and provides Teacher Training Program.We have the both indoor and outdoor activities for your children.We build a strong value foundation for your child on Psychology and Personality development.
    Preschool in hyderabad

    ReplyDelete
  18. Interesting posts good content
    Sanjary Academy provides excellent training for Piping design course. Best Piping Design Training Institute in Hyderabad, Telangana. We have offer professional Engineering Course like Piping Design Course,QA / QC Course,document Controller course,pressure Vessel Design Course, Welding Inspector Course, Quality Management Course, #Safety officer course.
    Piping Design Course in Hyderabad ­

    ReplyDelete
  19. Good blog post information
    Best QA / QC Course in India, Hyderabad. sanjaryacademy is a well-known institute. We have offer professional Engineering Course like Piping Design Course, QA / QC Course,document Controller course,pressure Vessel Design Course, Welding Inspector Course, Quality Management Course, #Safety officer course.
    QA / QC Course in India

    ReplyDelete
  20. Thanks for sharing such an informative post with us. I hope you will share more such post. Please keep sharing.
    HP Service center in Ameerpet, Hyderabad
    Best Laptop Service center in Ameerpet, Hyderabad

    ReplyDelete
  21. Send Gifts Under $10 , Send Gifts to Pakistan , Send Corporate Gifts
    If you are looking for gift delivery in Pakistan? We warmly welcome you to https://www.thewoodvalue.com/ Because we offer you one of the best wooden handmade art & craft decor items to send gifts Pakistan. A variety of Pakistan handicrafts, home decor, office decor, kitchen decor and wall decor are available at our online store. We offer online gift shopping in Pakistan with free delivery. The Wood Value is great way to send wooden handmade gifts as corporate gifts.

    ReplyDelete