Skip to content

Commit

Permalink
ACS-8120: fix Spring config
Browse files Browse the repository at this point in the history
  • Loading branch information
krdabrowski committed Jun 21, 2024
1 parent e382b4c commit 361490c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
import static org.alfresco.hxi_connector.common.util.ErrorUtils.UNEXPECTED_STATUS_CODE_MESSAGE;

import java.net.URI;
import java.util.Collections;
import java.util.Map;
import java.util.Optional;
import java.util.Set;

import lombok.RequiredArgsConstructor;
Expand All @@ -47,6 +49,7 @@
import org.apache.camel.model.dataformat.JsonLibrary;

import org.alfresco.hxi_connector.common.adapters.auth.config.properties.AuthProperties;
import org.alfresco.hxi_connector.common.config.properties.Retry;
import org.alfresco.hxi_connector.common.util.EnsureUtils;
import org.alfresco.hxi_connector.common.util.ErrorUtils;

Expand Down Expand Up @@ -136,7 +139,7 @@ private String createEncodedBody(String providerId)
private void wrapErrorIfNecessary(Exchange exchange)
{
Exception cause = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class);
Set<Class<? extends Throwable>> retryReasons = authProperties.getRetry().reasons();
Set<Class<? extends Throwable>> retryReasons = Optional.ofNullable(authProperties.getRetry()).map(Retry::reasons).orElse(Collections.emptySet());

ErrorUtils.wrapErrorIfNecessary(cause, retryReasons);
}
Expand Down
2 changes: 1 addition & 1 deletion prediction-applier-extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
<include>org.apache.camel:camel-http-base</include>
<include>org.apache.camel:camel-http-common</include>
<include>org.apache.camel:camel-http</include>
<include>org.apache.httpcomponents.client5:httpclient5</include>
<include>org.apache.httpcomponents.core5:httpcore5</include>
</includes>
</artifactSet>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,6 @@
</entry>
</map>
</property>
<property name="retry">
<bean class="org.alfresco.hxi_connector.common.config.properties.Retry">
<property name="reasons">
<set merge="false">
<value>org.alfresco.hxi_connector.common.exception.EndpointServerErrorException</value>
<value>java.net.UnknownHostException</value>
<value>java.net.MalformedURLException</value>
<value>com.fasterxml.jackson.core.io.JsonEOFException</value>
<value>com.fasterxml.jackson.databind.exc.MismatchedInputException</value>
<value>org.apache.hc.core5.http.NoHttpResponseException</value>
<value>org.apache.hc.core5.http.MalformedChunkCodingException</value>
</set>
</property>
</bean>
</property>
</bean>

<bean id="hxInsightAuthClient" class="org.alfresco.messaging.camel.routes.HxInsightAuthClient">
Expand Down

0 comments on commit 361490c

Please sign in to comment.