diff --git a/application/src/main/java/org/gxf/soapbridge/application/services/PlatformCommunicationService.java b/application/src/main/java/org/gxf/soapbridge/application/services/PlatformCommunicationService.java index 7b3e027..9e90185 100644 --- a/application/src/main/java/org/gxf/soapbridge/application/services/PlatformCommunicationService.java +++ b/application/src/main/java/org/gxf/soapbridge/application/services/PlatformCommunicationService.java @@ -50,11 +50,6 @@ public void handleIncomingRequest(final ProxyServerRequestMessage proxyServerReq final String commonName = proxyServerRequestMessage.getCommonName(); final String soapPayload = proxyServerRequestMessage.getSoapPayload(); - final boolean result = soapClient.sendRequest(connectionId, context, commonName, soapPayload); - if (!result) { - LOGGER.error("Unsuccessful at sending request to platform."); - } else { - LOGGER.debug("Successfully sent response message to queue"); - } + soapClient.sendRequest(connectionId, context, commonName, soapPayload); } } diff --git a/application/src/main/java/org/gxf/soapbridge/soap/clients/SoapClient.java b/application/src/main/java/org/gxf/soapbridge/soap/clients/SoapClient.java index b4f0716..15c9d89 100644 --- a/application/src/main/java/org/gxf/soapbridge/soap/clients/SoapClient.java +++ b/application/src/main/java/org/gxf/soapbridge/soap/clients/SoapClient.java @@ -17,6 +17,7 @@ import org.gxf.soapbridge.valueobjects.ProxyServerResponseMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; /** This {@link @Component} class can send SOAP messages to the Platform. */ @@ -54,10 +55,9 @@ public SoapClient( * @param context The part of the URL indicating the SOAP web-service. * @param commonName The common name (organisation identification). * @param soapPayload The SOAP message to send to the platform. - * @return True if the request has been sent and the response has been received and written to a - * queue, false otherwise. */ - public boolean sendRequest( + @Async + public void sendRequest( final String connectionId, final String context, final String commonName, @@ -70,7 +70,7 @@ public boolean sendRequest( connection = createConnection(context, soapPayload, commonName); if (connection == null) { LOGGER.warn("Could not create connection for sending SOAP request."); - return false; + return; } // Send the SOAP payload to the server. @@ -89,13 +89,11 @@ public boolean sendRequest( // Send queue message. proxyReponseSender.send(responseMessage); - return true; } catch (final Exception e) { if (connection != null) { connection.disconnect(); } LOGGER.error("Unexpected exception while sending SOAP request", e); - return false; } } diff --git a/application/src/main/kotlin/org/gxf/soapbridge/SoapBridgeApplication.kt b/application/src/main/kotlin/org/gxf/soapbridge/SoapBridgeApplication.kt index 93685e6..b2f354d 100644 --- a/application/src/main/kotlin/org/gxf/soapbridge/SoapBridgeApplication.kt +++ b/application/src/main/kotlin/org/gxf/soapbridge/SoapBridgeApplication.kt @@ -7,10 +7,12 @@ package org.gxf.soapbridge import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.context.properties.ConfigurationPropertiesScan import org.springframework.boot.runApplication +import org.springframework.scheduling.annotation.EnableAsync import org.springframework.web.servlet.config.annotation.EnableWebMvc @SpringBootApplication @EnableWebMvc +@EnableAsync @ConfigurationPropertiesScan class SoapBridgeApplication