File tree Expand file tree Collapse file tree 4 files changed +21
-5
lines changed
aws-serverless-jersey-archetype/src/main/resources/archetype-resources/src/main/java
src/main/java/com/amazonaws/serverless/sample/jersey Expand file tree Collapse file tree 4 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 88
99import org .glassfish .jersey .jackson .JacksonFeature ;
1010import org .glassfish .jersey .server .ResourceConfig ;
11+ import org .glassfish .jersey .server .ServerProperties ;
1112
1213import java .io .IOException ;
1314import java .io .InputStream ;
1819
1920public class StreamLambdaHandler implements RequestStreamHandler {
2021 private static final ResourceConfig jerseyApplication = new ResourceConfig ()
21- .register (PingResource .class )
22- .register (JacksonFeature .class );
22+ // properties to speed up Jersey start time
23+ .property (ServerProperties .FEATURE_AUTO_DISCOVERY_DISABLE ,true )
24+ .property (ServerProperties .WADL_FEATURE_DISABLE ,true )
25+ .property (ServerProperties .METAINF_SERVICES_LOOKUP_DISABLE ,true )
26+ .property (ServerProperties .BV_FEATURE_DISABLE ,true )
27+ .property (ServerProperties .JSON_PROCESSING_FEATURE_DISABLE ,true )
28+ .property (ServerProperties .MOXY_JSON_FEATURE_DISABLE ,true )
29+ .register (PingResource .class )
30+ .register (JacksonFeature .class );
2331 private static final JerseyLambdaContainerHandler <AwsProxyRequest , AwsProxyResponse > handler
2432 = JerseyLambdaContainerHandler .getAwsProxyHandler (jerseyApplication );
2533
Original file line number Diff line number Diff line change @@ -13,13 +13,13 @@ dependencies {
1313 ' io.symphonia:lambda-logging:1.0.1'
1414 )
1515
16- implementation(" org.glassfish.jersey.media:jersey-media-json-jackson:2.30.1 " ) {
16+ implementation(" org.glassfish.jersey.media:jersey-media-json-jackson:2.35 " ) {
1717 exclude group : ' com.fasterxml.jackson.core' , module : " jackson-annotations"
1818 exclude group : ' com.fasterxml.jackson.core' , module : " jackson-databind"
1919 exclude group : ' com.fasterxml.jackson.core' , module : " jackson-core"
2020 }
2121
22- implementation(" org.glassfish.jersey.inject:jersey-hk2:2.30.1 " ) {
22+ implementation(" org.glassfish.jersey.inject:jersey-hk2:2.35 " ) {
2323 exclude group : ' javax.inject' , module : " javax.inject"
2424 }
2525}
Original file line number Diff line number Diff line change 3434 <dependency >
3535 <groupId >com.amazonaws.serverless</groupId >
3636 <artifactId >aws-serverless-java-container-jersey</artifactId >
37- <version >[0.1 ,)</version >
37+ <version >[1.0 ,)</version >
3838 </dependency >
3939
4040 <dependency >
Original file line number Diff line number Diff line change 1111
1212import org .glassfish .jersey .jackson .JacksonFeature ;
1313import org .glassfish .jersey .server .ResourceConfig ;
14+ import org .glassfish .jersey .server .ServerProperties ;
1415
1516import java .io .IOException ;
1617import java .io .InputStream ;
1920
2021public class StreamLambdaHandler implements RequestStreamHandler {
2122 private static final ResourceConfig jerseyApplication = new ResourceConfig ()
23+ // properties to speed up Jersey start time
24+ .property (ServerProperties .FEATURE_AUTO_DISCOVERY_DISABLE ,true )
25+ .property (ServerProperties .WADL_FEATURE_DISABLE ,true )
26+ .property (ServerProperties .METAINF_SERVICES_LOOKUP_DISABLE ,true )
27+ .property (ServerProperties .BV_FEATURE_DISABLE ,true )
28+ .property (ServerProperties .JSON_PROCESSING_FEATURE_DISABLE ,true )
29+ .property (ServerProperties .MOXY_JSON_FEATURE_DISABLE ,true )
2230 .packages ("com.amazonaws.serverless.sample.jersey" )
2331 .register (JacksonFeature .class );
2432 private static final JerseyLambdaContainerHandler <AwsProxyRequest , AwsProxyResponse > handler
You can’t perform that action at this time.
0 commit comments