diff --git a/translation-service-etranslation/src/main/java/eu/europeana/api/translation/service/etranslation/ETranslationTranslationService.java b/translation-service-etranslation/src/main/java/eu/europeana/api/translation/service/etranslation/ETranslationTranslationService.java index 9c82f50a..5078ca63 100644 --- a/translation-service-etranslation/src/main/java/eu/europeana/api/translation/service/etranslation/ETranslationTranslationService.java +++ b/translation-service-etranslation/src/main/java/eu/europeana/api/translation/service/etranslation/ETranslationTranslationService.java @@ -166,7 +166,11 @@ private void createRedisMessageListenerAndWaitForResults(List tr if(LOGGER.isDebugEnabled()) { LOGGER.debug("Received message from redis message listener is: {}", response); } - if(response!=null) { + if(response.contains(ETranslationTranslationService.eTranslationErrorCallbackIndicator)) { + //eTtransl error callback received + throw new TranslationException(response); + } + else if(response!=null) { //extractTranslationsFromETranslationHtmlResponse(translationObjs, redisMessageListenerAdapter, response); extractTranslationsFromETranslationResponse(translationObjs, redisMessageListenerAdapter, response); } diff --git a/translation-service-etranslation/src/main/java/eu/europeana/api/translation/service/etranslation/RedisMessageListener.java b/translation-service-etranslation/src/main/java/eu/europeana/api/translation/service/etranslation/RedisMessageListener.java index 7a11252f..47f8f73d 100644 --- a/translation-service-etranslation/src/main/java/eu/europeana/api/translation/service/etranslation/RedisMessageListener.java +++ b/translation-service-etranslation/src/main/java/eu/europeana/api/translation/service/etranslation/RedisMessageListener.java @@ -23,7 +23,7 @@ public void onMessage(Message message, byte[] pattern) { String messageBody=new String(message.getBody(), StandardCharsets.UTF_8); if(messageBody.contains(ETranslationTranslationService.eTranslationErrorCallbackIndicator)) { //if we enter here, means the eTranslation error callback is called - this.message=null; + this.message=messageBody; } else { /*