Questions tagged [ratpack]

Ratpack a toolkit for creating high performance web applications built on Java and Netty.

Ratpack is a set of Java libraries that facilitate fast, efficient, evolvable and well tested HTTP applications.

It is built on the highly performant and efficient Netty event-driven networking engine. The API is optimized for Groovy and Java 8.

Optional Google Guice integration provides a foundation for scaling your application in size in a managed way.

Optional Gradle build time support makes building and testing applications a breeze.

Ratpack focuses on allowing HTTP applications to be efficient, modular, adaptive to new requirements and technologies, and well-tested over time.

enter image description here

Ratpack Introduction provides a quick comparison with similar products.

Github

88 questions
2
votes
0 answers

Ratpack, RxJava, Hystrix, and Blocking - Thread pools and boundaries

I am using ratpack, together with ratpack-hystrix, and have something akin to the following: return RxRatpack.promiseSingle( new HystrixObservableCommand>( …
Anvar
  • 1,110
  • 2
  • 10
  • 22
2
votes
1 answer

loading and compiling template in ratpack: blocking or not?

I'm adding Pebble template support to my ratpack application, and there is one matter that bothers me: should my RendererSupport instance use ratpack's Blocking.get() or not? As PebbleEngine has it's own cache, i can't say whether it would be…
leetwinski
  • 17,408
  • 2
  • 18
  • 42
2
votes
1 answer

How list all Ratpack endpoints?

What's the easiest way to list all endpoints in Ratpack? My app includes quite a few modules, so simply scanning Ratpack.groovy is not a good solution. Are there any existing tools to show all the exposed endpoints for the running app?
Dan Tanner
  • 2,229
  • 2
  • 26
  • 39
2
votes
1 answer

Token based authentication and authorization with ratpack and pac4j

I've used to securing rest api with spring security + spring session. This way allows me to auth client and generate his own session token which includes in every further request in header or cookie instead of login and password. I want to use this…
Tymur Yarosh
  • 553
  • 1
  • 6
  • 19
2
votes
1 answer

Where can ratpack-jackson version 1.1.1 be resolved?

I have jcenter () included in my Gradle repositories using ratpack-gradle-1.1.1 plugin but 'compile ratpack.dependency ("Jackson")' results in unable to resolve dependency. I have searched several repositories and have only located ratpack-jackson…
TeamDitto
  • 507
  • 1
  • 6
  • 18
1
vote
2 answers

DslContext Jooq update timestamp with time zone column as null

I have Customer table in postgres DB with id as primary key and below columns id -> Integer(PK) name -> Varchar2 details-> jsonb created_timestamp -> TIMESTAMP WITH TIME ZONE I'm trying to update table based on primary key using…
Ryuzaki L
  • 37,302
  • 12
  • 68
  • 98
1
vote
2 answers

Using Optional's ifPresentOrElse method but return promise instead of void

I'm trying to get my around a current issue I'm facing. I have a function that returns an Optional type (an object with a few properties) One of the properties is an url that might be present or not. I extract that url in order to make an HTTP…
Jorge Guerreiro
  • 682
  • 6
  • 22
1
vote
0 answers

How could be Ratpack asynchrony implemented, how does it work?

I read about ratpack and my-first-ratpack-app-what-i-learned states: The threadpool is sized to the number of processor cores available in the system. This will typically mean a much smaller threadpool than with Spring Boot and Tomcat, for…
bastiat
  • 1,799
  • 2
  • 19
  • 38
1
vote
1 answer

How do I set POST Parameters in a TestHttpClient

I'm using Ratpack's TestHttpClient to send a POST request in a Spock test for a REST API. The API's endpoint accepts the parameter myPostParam as part of the request body / POST parameter. I see that there is a post method, that performs the POST…
Nijin22
  • 850
  • 13
  • 20
1
vote
0 answers

Ratpack: serving static resources from classpath

My app has a dependency on another project containing a React SPA. When the app builds, all static resources are copied into build dir / jar with the following structure: ../ |- index.html |- webroot |- static | |-…
injecteer
  • 20,038
  • 4
  • 45
  • 89
1
vote
1 answer

How do I write a unit-test to throw an exception from the Mock method of Operation return type?

I would like to write a unit-test to throw an exception from the Mock method of Operation return type. I'm writing the unit-test with Spock in Groovy. There are class A, and B // class A private ClassB b; Promise foo() { return…
1
vote
1 answer

Can I allow DELETE from all origins with groovy-dsl?

Building a quick and dirty REST API with Ratpack script; can't figure out how to allow DELETE from all origins. I've tried setting headers within delete, and using all (as in sample code.) Sending DELETE with curl, postman, everything always…
1
vote
1 answer

Given a Ratpack RequestFixture test, how can I have the fixture invoke Request#beforeSend?

This question is in the context of a Ratpack RequestFixture Spock test, for a Ratpack chain authenticating with RatpackPac4j#requireAuth, and employing a workaround for the missing WWW-Authenticate header (as described in the answer to this…
wu-lee
  • 749
  • 4
  • 17
1
vote
1 answer

Ratpack's Promise.cache with multiple downstream promises in ParallelBatch

I'm running into a NullPointerException in the guts of Ratpack when using Ratpack's Promise.cache in combination with multiple downstream promises and ParallelBatch, and it's not clear to me from the documentation whether my usage is incorrect, or…
grumbler
  • 886
  • 9
  • 20
1
vote
1 answer

How do I mock a Session in Ratpack with RequestFixture?

What I'm trying to do is test an authentication handler, but my problem boils down to having no Session instance in the registry. An example test: package whatever import groovy.transform.CompileStatic import…
wu-lee
  • 749
  • 4
  • 17