Skip to content

Commit

Permalink
Merge 3a008b2 into f817956
Browse files Browse the repository at this point in the history
  • Loading branch information
allanmckenzie committed Nov 4, 2022
2 parents f817956 + 3a008b2 commit 6b32f45
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 126 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ on [Keep a CHANGELOG](http://keepachangelog.com/). This project adheres to
- Added support for feature toggling with an integration test showing it working
- Added healthcheck integration test

### Security
- Updates to various libraries to address security alerts:
- wildfly to version 26.1.2.Final
- artemis to version 2.20.0
- resteasy-client to version 4.7.7.Final

## [2.0.0] - 2019-08-19
### Added
- Update to framework 6.0.6
Expand Down
2 changes: 1 addition & 1 deletion example-context/example-service/example-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@
</property>
</activation>
<properties>
<server.config>standalone-single.xml</server.config>
<server.config>standalone.xml</server.config>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,23 @@ public Querier(final Client client) {
}

public ApiResponse queryForRecipe(final String recipeId) {
final Response jaxrsResponse = client.target(RECIPES_RESOURCE_QUERY_URI + recipeId).request().accept(QUERY_RECIPE_MEDIA_TYPE).get();
return ApiResponse.from(jaxrsResponse);
try(final Response jaxrsResponse = client.target(RECIPES_RESOURCE_QUERY_URI + recipeId).request().accept(QUERY_RECIPE_MEDIA_TYPE).get()) {
return ApiResponse.from(jaxrsResponse);
}
}

public ApiResponse queryForOrder(final String orderId) {
final Response jaxrsResponse = client.target(ORDERS_RESOURCE_QUERY_URI + orderId).request().accept(QUERY_ORDER_MEDIA_TYPE).get();
return ApiResponse.from(jaxrsResponse);
try(final Response jaxrsResponse = client.target(ORDERS_RESOURCE_QUERY_URI + orderId).request().accept(QUERY_ORDER_MEDIA_TYPE).get()) {
return ApiResponse.from(jaxrsResponse);
}
}

public ApiResponse queryForIndex(final String recipeId) {
final Response jaxrsResponse = client.target(INDEXES_RESOURCE_QUERY_URI + recipeId).request().accept(QUERY_INDEX_MEDIA_TYPE).get();
return ApiResponse.from(jaxrsResponse);
try (final Response jaxrsResponse = client.target(INDEXES_RESOURCE_QUERY_URI + recipeId).request().accept(QUERY_INDEX_MEDIA_TYPE).get()) {
return ApiResponse.from(jaxrsResponse);
}
}

public ApiResponse recipesQueryResult() {
return recipesQueryResult(singletonList(new BasicNameValuePair("pagesize", "50")));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.jboss.resteasy.client.jaxrs.ResteasyClient;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine;
import org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient43Engine;
import org.jboss.resteasy.client.jaxrs.internal.ResteasyClientBuilderImpl;

public class RestEasyClientFactory {

Expand All @@ -14,7 +14,7 @@ public ResteasyClient createResteasyClient() {
final CloseableHttpClient httpClient = HttpClients.custom().setConnectionManager(cm).build();
cm.setMaxTotal(200); // Increase max total connection to 200
cm.setDefaultMaxPerRoute(20); // Increase default max connection per route to 20
final ApacheHttpClient4Engine engine = new ApacheHttpClient4Engine(httpClient);
return new ResteasyClientBuilder().httpEngine(engine).build();
final ApacheHttpClient43Engine engine = new ApacheHttpClient43Engine(httpClient);
return new ResteasyClientBuilderImpl().httpEngine(engine).build();
}
}
Loading

0 comments on commit 6b32f45

Please sign in to comment.