Skip to content

Commit

Permalink
Merge pull request #1 from pefernan/upgrade-quarkus-3.15
Browse files Browse the repository at this point in the history
Upgrade quarkus 3.15
  • Loading branch information
RishiRajAnand authored Jan 2, 2025
2 parents 8eefc7e + 2d6b5e9 commit 69f9be7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
4 changes: 2 additions & 2 deletions kogito-build/kogito-dependencies-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<version.net.minidev.jsonsmart>2.4.10</version.net.minidev.jsonsmart>
<version.net.thisptr.jackson-jq>1.0.0-preview.20240207</version.net.thisptr.jackson-jq>
<version.io.quarkiverse.jackson-jq>2.0.2</version.io.quarkiverse.jackson-jq>
<version.io.quarkiverse.openapi.generator>2.6.0-lts</version.io.quarkiverse.openapi.generator>
<version.io.quarkiverse.openapi.generator>2.7.0-lts</version.io.quarkiverse.openapi.generator>
<version.io.quarkiverse.asyncapi>0.3.0</version.io.quarkiverse.asyncapi>
<version.io.quarkiverse.reactivemessaging.http>2.4.1</version.io.quarkiverse.reactivemessaging.http>
<version.io.quarkiverse.embedded.postgresql>0.2.3</version.io.quarkiverse.embedded.postgresql>
Expand Down Expand Up @@ -143,7 +143,7 @@

<version.maven>3.9.6</version.maven>
<version.maven.project>2.2.1</version.maven.project>
<version.maven.plugin>3.7.1</version.maven.plugin>
<version.maven.plugin>3.13.0</version.maven.plugin>
<version.maven.invoker>3.2.0</version.maven.invoker>
<version.maven.plugin.testing.harness>4.0.0-alpha-2</version.maven.plugin.testing.harness>
<version.plexus>2.1.0</version.plexus>
Expand Down
5 changes: 5 additions & 0 deletions quarkus/bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
<artifactId>quarkus-openapi-generator-deployment</artifactId>
<version>${version.io.quarkiverse.openapi.generator}</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.openapi.generator</groupId>
<artifactId>quarkus-openapi-generator-oidc</artifactId>
<version>${version.io.quarkiverse.openapi.generator}</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.asyncapi</groupId>
<artifactId>quarkus-asyncapi</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ quarkus.kafka.devservices.enabled=false
quarkus.kubernetes-client.devservices.enabled=false

# OpenApi client properties, see OperationsMockService, which is mocking these two services
quarkus.rest-client.multiplication.cluster1.url=${multiplication-service-mock.url}
quarkus.rest-client."multiplication.cluster1".url=${multiplication-service-mock.url}
quarkus.rest-client.subtraction.url=${subtraction-service-mock.url}
quarkus.rest-client.petstore_openapi_yaml.url=${petstore-service-mock.url}
quarkus.rest-client.array_yaml.url=${array-service-mock.url}
Expand Down Expand Up @@ -255,4 +255,6 @@ quarkus.http.auth.permission.default.policy=authenticated

quarkus.security.users.embedded.enabled=true
quarkus.security.users.embedded.plain-text=true
quarkus.security.users.embedded.users.buddy=buddy
quarkus.security.users.embedded.users.buddy=buddy

quarkus.test.arg-line=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@
<groupId>io.quarkiverse.openapi.generator</groupId>
<artifactId>quarkus-openapi-generator</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.openapi.generator</groupId>
<artifactId>quarkus-openapi-generator-oidc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.asyncapi</groupId>
<artifactId>quarkus-asyncapi</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.kie.kogito.serverless.workflow.openapi;

import java.io.IOException;
import java.lang.reflect.ParameterizedType;
import java.util.Collections;
import java.util.Map;
Expand All @@ -37,28 +36,23 @@
import io.quarkus.restclient.runtime.RestClientBuilderFactory;

import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.client.ClientRequestContext;
import jakarta.ws.rs.client.ClientRequestFilter;

public abstract class OpenApiWorkItemHandler<T> extends WorkflowWorkItemHandler {

@Override
protected Object internalExecute(KogitoWorkItem workItem, Map<String, Object> parameters) {
Class<T> clazz = getRestClass();
T ref = RestClientBuilderFactory.build(clazz, calculatedConfigKey(workItem, parameters)).register(new ClientRequestFilter() {
@Override
public void filter(ClientRequestContext requestContext) throws IOException {
ProcessMeta.fromKogitoWorkItem(workItem).asMap().forEach((k, v) -> requestContext.getHeaders().put(k, Collections.singletonList(v)));
}
}).build(clazz);
T ref = RestClientBuilderFactory.build(clazz, calculatedConfigKey(workItem)).register(
(ClientRequestFilter) requestContext -> ProcessMeta.fromKogitoWorkItem(workItem).asMap().forEach((k, v) -> requestContext.getHeaders().put(k, Collections.singletonList(v)))).build(clazz);
try {
return internalExecute(ref, parameters);
} catch (WebApplicationException ex) {
throw new WorkItemExecutionException(Integer.toString(ex.getResponse().getStatus()), ex.getMessage());
}
}

private Optional<String> calculatedConfigKey(KogitoWorkItem workItem, Map<String, Object> parameters) {
private Optional<String> calculatedConfigKey(KogitoWorkItem workItem) {
String configKeyExpr = (String) workItem.getNodeInstance().getNode().getMetaData().get("configKey");
if (configKeyExpr == null) {
return Optional.empty();
Expand Down

0 comments on commit 69f9be7

Please sign in to comment.