-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
G11n java client [BUG 754] Performance impact on the very first L3 fetch for a non-supported locale #823
Merged
jessiejuachon
merged 224 commits into
vmware:g11n-java-client
from
jessiejuachon:g11n-java-client-754
Oct 28, 2020
Merged
G11n java client [BUG 754] Performance impact on the very first L3 fetch for a non-supported locale #823
Changes from 215 commits
Commits
Show all changes
224 commits
Select commit
Hold shift + click to select a range
f4c1214
Loading configuration from the JSON configuration file
jessiejuachon 1a4d95e
Removing code that is not yet ready to be used from the sample applic…
jessiejuachon 5e72b73
fixing failing code scan
jessiejuachon 73d85ca
Adding a cache properties map to hold cache details such as etag and …
jessiejuachon 2a38107
Removing white space
jessiejuachon c7f5d4f
Fixing failing unit test
jessiejuachon 056891a
Parse headers, response code, response message from an HTTP response …
jessiejuachon a2ba98b
Storing response headers in Map of cache properties
jessiejuachon 17978bd
Fixing failing unit test due to NullPointerException when doing Map.p…
jessiejuachon 6c69170
Changes after code review.
jessiejuachon 41a8aa1
Removing exception handling for now
jessiejuachon dd2455d
Deprecating VIPCfg.initialize; cleaning up code
jessiejuachon e26d372
Storing the http response code in the cache
jessiejuachon 01ab69e
Using cached etag as if-none-match request header value in the reques…
jessiejuachon 750c9d2
Handling 404 response from Singleton service
jessiejuachon 529e5cc
Using HTTP repsonse's Cache-Control max-age and timestamp to dertermi…
jessiejuachon b40fcf9
Moving constants to URLUtils
jessiejuachon fa123f9
Fixing failing test
jessiejuachon 30b2054
Fixing failing code scan
jessiejuachon 0c69787
Merge branch 'g11n-java-client' into g11n-java-client
Xiaochao8 ffc0a74
Cleaning up import in ComponentService,java
jessiejuachon d8450e4
Cleaning up code - caching/expiry
jessiejuachon d7f7641
Merge branch 'g11n-java-client' of https://github.com/jessiejuachon/s…
jessiejuachon 0dcd827
Adding tests for new caching workflow; enabling old caching workflow …
jessiejuachon d06adb3
Fixing a failing test
jessiejuachon 48c8558
Adding mock server response
jessiejuachon 4e45bed
Removing unused file sampleconfig.json
jessiejuachon 6a40dc8
Changes from code review
jessiejuachon 4c3c12d
Value of VIPCfg.cacheExpiredTime is -1 when value is not set in confi…
jessiejuachon 7e0d939
Changing a LinkedHashMap to a HashMap because insertion order does no…
jessiejuachon baef0d0
Adding CacheItem object to contain map of data and a another map for …
jessiejuachon 02a96e9
Fixing failing unit test
jessiejuachon 78d88f7
Fixing code scan issues
jessiejuachon 655c223
Code cleanup
jessiejuachon 8746915
Lazily instantiating cacheProps; code clean up and comments
jessiejuachon 897a03c
Changes after code review
jessiejuachon 3a4e183
Adding header to CacheItem.java
jessiejuachon b08feb4
Fixing code san issue. Synchronize on a final field
jessiejuachon 8f57e24
Fixing code scan bug
jessiejuachon 72c8799
Changes after code review
jessiejuachon 92edfc8
Updating CasheService.isContainComponent to return false if cache key…
jessiejuachon 2042554
HttpRequester if-none-match header and other customized headers are a…
jessiejuachon ae707ff
Code clean up; keep old caching expiration logic
jessiejuachon 82818d5
Fixing code scan bug
jessiejuachon 31d4ff6
Merge branch 'g11n-java-client' into g11n-java-client
jessiejuachon c9f83d7
code clean up
jessiejuachon 78dcc1c
Removing response code and response msg from cache; Passing cacheItem…
jessiejuachon 9281c64
Changes after code review
jessiejuachon 2657762
Adding header to CacheItem.java file
jessiejuachon 9e80f09
Fixing failing unit test
jessiejuachon 68467f3
Changes after code review
jessiejuachon d67c72e
Fixing code scan bugs
jessiejuachon 8591973
Not storing anything in cache if response is neither 200 nor 304
jessiejuachon 22a5b29
Loading messages from specified offline resource bundles
jessiejuachon ce2488b
Merge branch 'g11n-java-client' of https://github.com/vmware/singleto…
jessiejuachon 1092963
Adding header
jessiejuachon 35d1d97
Fixing failing unie test
jessiejuachon ada17f1
Code changes after review; code clean up
jessiejuachon fc60eef
Using java.nio.file.Paths
jessiejuachon 3e70449
Offline mode as fallback when service fetch fails
jessiejuachon 609d8e4
Resetting VIPCfg and I18nFactory instances for each test
jessiejuachon dd19b1c
Resetting VIPCfg and I18nFactory after test
jessiejuachon 7389f8b
Fixing tests
jessiejuachon 5b92e44
Limit to wiremock test logging
jessiejuachon dfb41b5
Decreasing unit test log
jessiejuachon 21a7105
this test is timing out and trying to connect 70+ times
jessiejuachon 84343d5
Adding comments to code
jessiejuachon be8e443
Merge branch 'g11n-java-client' of https://github.com/vmware/singleto…
jessiejuachon b805d36
Adding timestamp to cache fromn local bundle
jessiejuachon 17bc16c
Deprecating methods in TranslationMessage; adding new method getMessage
jessiejuachon 15da010
Added tests for TranslationMessage.getMessage
jessiejuachon 631de86
Fixing test
jessiejuachon ffd9adb
Fixing test
jessiejuachon c00f7ae
Fixing test
jessiejuachon d0504c4
Removing comment field because source collection is not supported any…
jessiejuachon 79b18d0
Code clean up
jessiejuachon ec9f5db
Changes from code review
jessiejuachon 2e8bd36
Code clean up
jessiejuachon 4e44a8c
Optional SourceOpt in initialization
jessiejuachon de5c4ee
Fixing test
jessiejuachon 406cb2a
Adding comments to code
jessiejuachon c80696a
Adding comment for javadoc
jessiejuachon 79d111e
Cleaning up code
jessiejuachon 24d8d5d
Code clean up
jessiejuachon 23e62b6
Fixing test
jessiejuachon 369643f
Removing source message fallback from this PR
jessiejuachon 4e67e25
Merge branch 'g11n-java-client' into g11n-java-client
jessiejuachon 636b5b4
Default locale in config file instead of hardcoded; get supported loc…
jessiejuachon 71a87e5
Merge branch 'g11n-java-client' into g11n-java-client
jessiejuachon b9a90e3
Fixing test
jessiejuachon 060666d
Fixing tests
jessiejuachon 52e3695
Default locale to Locale.ENGLISH if not set in config file
jessiejuachon 2858ebc
Changed after code review: code clean up, bug fix
jessiejuachon bbe3047
Update src/main/java/com/vmware/vipclient/i18n/messages/api/opt/local…
jessiejuachon fa56388
Update src/main/java/com/vmware/vipclient/i18n/messages/api/opt/local…
jessiejuachon 08cd96d
code clean up, error logging, bug fix
jessiejuachon e89ff56
Merge branch 'g11n-java-client' of https://github.com/vmware/singleto…
jessiejuachon 119aebd
code clean up
jessiejuachon e8a937d
code clean up
jessiejuachon 9d95cd1
Using messages_source.json for source locale messages.
jessiejuachon 06b60bb
code clean up
jessiejuachon 51b4dfa
Merge branch 'g11n-java-client' of https://github.com/vmware/singleto…
jessiejuachon 778a7a1
Commenting out a test
jessiejuachon 077f19b
code clean up
jessiejuachon 9424346
code clean up
jessiejuachon c25a676
Error logging when fetch failed
jessiejuachon db641b9
bug fix
jessiejuachon 5cd06d6
code clean up
jessiejuachon 6915f11
Updating sample application
jessiejuachon a64be3f
Merge branch 'g11n-java-client' into g11n-java-client
jessiejuachon 7128194
fixing failing smoke test
jessiejuachon c4a388c
Merge branch 'g11n-java-client' of https://github.com/jessiejuachon/s…
jessiejuachon 5ecea93
code clean up
jessiejuachon 4c5b0a1
fixing code scan
jessiejuachon 067d19d
Fixing code scan
jessiejuachon 711ce80
Adding prodMode configuration
jessiejuachon b7dabdb
Merge branch 'g11n-java-client' into g11n-java-client
jessiejuachon d8543ec
code clean up
jessiejuachon e8094f4
Setting default prodMode to true
jessiejuachon 9a5ef77
Removing prodMode configuration and logic. Throwing exception if sour…
jessiejuachon 5011c38
Updating javadoc
jessiejuachon 33432b1
Fixing bug: Fallback shall apply to both TranslationMessage.getMessag…
jessiejuachon c9d3cae
Adding test for Translateion.getMessages, locale not supported
jessiejuachon adb40ec
code comments
jessiejuachon 7ab5c59
code clean up
jessiejuachon 3c10089
Fix issue: https://github.com/vmware/singleton/issues/622
jessiejuachon 76105b7
code clean up
jessiejuachon 49c5648
code clean up
jessiejuachon d543e99
code clean up
jessiejuachon 3ecf958
code clean up
jessiejuachon e6a07a1
code clean up
jessiejuachon 89ff088
code clean up
jessiejuachon f1356ab
code clean up
jessiejuachon c63bc2d
Merge branch 'g11n-java-client' of https://github.com/vmware/singleto…
jessiejuachon beab148
Fix for https://github.com/vmware/singleton/issues/661
jessiejuachon 2cd7713
adding license header
jessiejuachon e13b694
changes after code review
jessiejuachon f1f70b3
Update src/main/java/com/vmware/vipclient/i18n/messages/api/opt/local…
jessiejuachon fe535dc
Update src/main/java/com/vmware/vipclient/i18n/messages/service/Produ…
jessiejuachon 0d22b9f
changes after code review
jessiejuachon 4870782
changes after code review
jessiejuachon f451436
fix for issues: 664, 662, 686
jessiejuachon 89d7b0d
code clean up
jessiejuachon ec6e693
code clean up
jessiejuachon 65f1d08
Adding LocaleDTO
jessiejuachon 60fb3b3
code clean up
jessiejuachon a698f20
code clean up
jessiejuachon eede3b5
changes after code review
jessiejuachon 2dbfc72
Bug fix https://github.com/vmware/singleton/issues/604, https://githu…
jessiejuachon e63ab94
Merge branch 'g11n-java-client' into g11n-java-client
jessiejuachon ae1dccd
code clean up
jessiejuachon 6fbaab4
Mapping to the fallback locale's cache
jessiejuachon ff99a37
code clean up
jessiejuachon 271ee08
changes after code review
jessiejuachon 230e21c
code clean up
jessiejuachon 55764a7
code clean up
jessiejuachon e9214cb
code clean up
jessiejuachon beaa5ef
code clean up
jessiejuachon 673b8fd
code clean up
jessiejuachon e8bb5b7
Fixing bug on reading offline bundles in jar file.
jessiejuachon fe82e31
Merge branch 'g11n-java-client' of https://github.com/vmware/singleto…
jessiejuachon 57aeb9b
sample shared library
jessiejuachon a7f6d36
sample application with shared library
jessiejuachon 423090c
Merge branch 'g11n-java-client' of https://github.com/vmware/singleto…
jessiejuachon 4723dbf
Adding license header
jessiejuachon 203dbb8
Fix for https://github.com/vmware/singleton/issues/746 MsgOriginsQueu…
jessiejuachon 0a755b1
Merge branch 'g11n-java-client' of https://github.com/vmware/singleto…
jessiejuachon ed60327
Merge branch 'g11n-java-client' of https://github.com/vmware/singleto…
jessiejuachon b76346c
Fix for bug 781 - L3's CacheService.getSupportedLocalesFromCache is i…
jessiejuachon a6aa09e
code clean up
jessiejuachon 550de8c
code clean up
jessiejuachon 1599f5c
Fix for issue 781: CacheService.getCacheOfComponent cannot get "match…
jessiejuachon 8f0a9dd
adding test
jessiejuachon 24b8e3a
code clean up
jessiejuachon 22b2159
code clean up
jessiejuachon 4247c99
code clean up
jessiejuachon 88a0a4c
code clean up
jessiejuachon 3d82802
code clean up
jessiejuachon 444b0bf
code clean up
jessiejuachon d975d97
adding test
jessiejuachon d7a9a44
fixing test
jessiejuachon 534137a
fixing test
jessiejuachon 7e540e9
fixing test
jessiejuachon 8899bfe
fixing test
jessiejuachon 5ce2453
code clean up
jessiejuachon c5e9620
code clean up
jessiejuachon d2905e3
code cleanup
jessiejuachon 8b1e4e9
code clean up
jessiejuachon 303957e
Update src/main/java/com/vmware/vipclient/i18n/messages/service/Cache…
jessiejuachon f238d95
adding comments to code
jessiejuachon d5dffd6
clean up code
jessiejuachon f096330
Merge branch 'g11n-java-client-781' of github.com:jessiejuachon/singl…
jessiejuachon ef3c67f
code clean up
jessiejuachon 0c6f313
code clean up
jessiejuachon cfdc289
Adding list of supported locales used by L3 in cache
jessiejuachon 67d6c89
Merge branch 'g11n-java-client' of github.com:vmware/singleton into g…
jessiejuachon 23d7ec8
Merge branch 'g11n-java-client' of github.com:jessiejuachon/singleton…
jessiejuachon 7d51498
Removing logic of adding a cacheItem with an empty dataMap to cache
jessiejuachon 943bb14
Merge branch 'g11n-java-client' of github.com:jessiejuachon/singleton…
jessiejuachon 3f488e0
Merge branch 'g11n-java-client' of github.com:jessiejuachon/singleton…
jessiejuachon 680aab4
code clean up
jessiejuachon b10eec5
code clean up
jessiejuachon 610ffd0
code clean up
jessiejuachon 01e8222
Removing locale property from MessageCacheItem
jessiejuachon e78a92e
Update src/main/java/com/vmware/vipclient/i18n/messages/service/Compo…
jessiejuachon ce6cd77
Merge branch 'g11n-java-client' of github.com:jessiejuachon/singleton…
jessiejuachon 138e1f9
changes based on review comments
jessiejuachon b1a824a
Enablling locale fallback for matched locale
jessiejuachon 6c4bb64
merging changes
jessiejuachon a4ddbdd
Merge branch 'g11n-java-client' into g11n-java-client-754
jessiejuachon a97ccfc
Merge branch 'g11n-java-client' of github.com:vmware/singleton into g…
jessiejuachon eb8b625
Fixing bug 754 - Performance impact on the very first L3 fetch for a …
jessiejuachon dd03ac8
Merge branch 'g11n-java-client-754' of github.com:jessiejuachon/singl…
jessiejuachon f8ce5c1
more test cases
jessiejuachon c2b1fd9
fixing intermittently failing test
jessiejuachon 6bbdfff
code clean up for readability
jessiejuachon d8e70b7
fixing incorrect if statement
jessiejuachon 7d8f943
code optimization
jessiejuachon b3bb30a
Update src/main/java/com/vmware/vipclient/i18n/util/LocaleUtility.java
jessiejuachon bdbae09
rolling back change
jessiejuachon 03bf400
changing Chinese locale matching rule
jessiejuachon 71404e3
Merge branch 'g11n-java-client' into g11n-java-client-754
jessiejuachon 236ab56
correcting incorrect merge
jessiejuachon 7c2535c
Do Locale matching first in Componentservice.getMessages
jessiejuachon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,11 +15,7 @@ | |
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.Locale; | ||
import java.util.Map; | ||
import java.util.*; | ||
import java.util.concurrent.locks.Condition; | ||
import java.util.concurrent.locks.Lock; | ||
import java.util.concurrent.locks.ReentrantLock; | ||
|
@@ -46,34 +42,99 @@ public void init() { | |
public void testPickupLocaleFromList() { | ||
Locale[] supportedLocales = { Locale.forLanguageTag("de"), | ||
Locale.forLanguageTag("es"), Locale.forLanguageTag("fr"), | ||
Locale.forLanguageTag("fr-CA"), | ||
Locale.forLanguageTag("ja"), Locale.forLanguageTag("ko"), | ||
Locale.forLanguageTag("zh"), | ||
Locale.forLanguageTag("zh-Hans"), | ||
Locale.forLanguageTag("zh-Hant") | ||
|
||
}; | ||
Locale[] testLocales = { Locale.forLanguageTag("de"), | ||
Locale.forLanguageTag("es"), Locale.forLanguageTag("fr"), | ||
Locale.forLanguageTag("fr-CA"), Locale.forLanguageTag("fr-FR"), | ||
Locale.forLanguageTag("ja"), Locale.forLanguageTag("ko"), | ||
Locale.forLanguageTag("zh"), Locale.forLanguageTag("zh-CN"), | ||
Locale.forLanguageTag("zh"), | ||
Locale.forLanguageTag("zh-CN"), | ||
Locale.forLanguageTag("zh-TW"), | ||
Locale.forLanguageTag("zh-HANS-CN"), | ||
Locale.forLanguageTag("zh-HANT-TW"), | ||
Locale.forLanguageTag("zh-HANS"), | ||
Locale.forLanguageTag("zh-HANT") }; | ||
|
||
String[] expectedLocales = { "de", "es", "fr", "ja", "ko", "zh", | ||
String[] expectedLocales = { "de", "es", "fr", "fr-CA", "fr", "ja", "ko", "zh", | ||
"zh-Hans", "zh-Hant", "zh-Hans", "zh-Hant", "zh-Hans", "zh-Hant" }; | ||
|
||
for (int i = 0; i < testLocales.length; i++) { | ||
String matchedLanguageTag = LocaleUtility.pickupLocaleFromList( | ||
Arrays.asList(supportedLocales), testLocales[i]) | ||
new HashSet<>(Arrays.asList(supportedLocales)), testLocales[i]) | ||
.toLanguageTag(); | ||
|
||
logger.debug(matchedLanguageTag + "-----" + expectedLocales[i]); | ||
Assert.assertEquals(expectedLocales[i], matchedLanguageTag); | ||
} | ||
} | ||
|
||
@Test | ||
public void testPickupLocaleFromListNotFound() { | ||
Locale[] supportedLocales = { Locale.forLanguageTag("de"), | ||
Locale.forLanguageTag("es"), Locale.forLanguageTag("fr"), | ||
Locale.forLanguageTag("fr-CA"), | ||
Locale.forLanguageTag("ja"), Locale.forLanguageTag("ko"), | ||
Locale.forLanguageTag("zh-Hans"), | ||
Locale.forLanguageTag("zh-Hant") | ||
|
||
}; | ||
Assert.assertNull(LocaleUtility.pickupLocaleFromList(new HashSet<>(Arrays.asList(supportedLocales)), Locale.forLanguageTag("fil"))); | ||
} | ||
|
||
@Test | ||
public void testPickupLocaleFromListZh() { | ||
Locale[] supportedLocales = { | ||
Locale.forLanguageTag("zh") | ||
}; | ||
Locale[] testLocales = { | ||
Locale.forLanguageTag("zh"), | ||
Locale.forLanguageTag("zh-CN"), | ||
Locale.forLanguageTag("zh-TW"), | ||
Locale.forLanguageTag("zh-HANS-CN"), | ||
Locale.forLanguageTag("zh-HANT-TW"), | ||
Locale.forLanguageTag("zh-HANS"), | ||
Locale.forLanguageTag("zh-HANT") }; | ||
|
||
String[] expectedLocales = {"zh" ,"zh", "zh", "zh", "zh", "zh", "zh"}; | ||
|
||
for (int i = 0; i < testLocales.length; i++) { | ||
String matchedLanguageTag = LocaleUtility.pickupLocaleFromList( | ||
new HashSet<>(Arrays.asList(supportedLocales)), testLocales[i]) | ||
.toLanguageTag(); | ||
|
||
logger.debug(matchedLanguageTag + "-----" + expectedLocales[i]); | ||
Assert.assertEquals(expectedLocales[i], matchedLanguageTag); | ||
} | ||
} | ||
|
||
/** | ||
* For any Chinese locale (zh-*) that is not supported, | ||
* return null so that fallback locale will be used even if "zh" is supported. | ||
* For any non-Chinese locale, return the best match (e.g. 'de' if 'de-DE' is not supported). | ||
*/ | ||
@Test | ||
public void testPickupLocaleFromList_special_case_zh_HK() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add one more test case: zh is supported, zh-Hans and zh-Hant aren't supported. Request zh-Hant will return null rather than zh. |
||
Locale[] supportedLocales = { | ||
Locale.forLanguageTag("zh"), | ||
Locale.forLanguageTag("zh-Hans"), | ||
Locale.forLanguageTag("zh-Hant") | ||
|
||
}; | ||
Assert.assertNull(LocaleUtility.pickupLocaleFromList(new HashSet<>(Arrays.asList(supportedLocales)), Locale.forLanguageTag("zh-HK"))); | ||
Assert.assertEquals("zh", LocaleUtility.pickupLocaleFromList(new HashSet<>(Arrays.asList(supportedLocales)), | ||
Locale.forLanguageTag("zh")).toLanguageTag()); | ||
Assert.assertEquals("zh-Hans", LocaleUtility.pickupLocaleFromList(new HashSet<>(Arrays.asList(supportedLocales)), | ||
Locale.forLanguageTag("zh-CN")).toLanguageTag()); | ||
Assert.assertEquals("zh-Hant", LocaleUtility.pickupLocaleFromList(new HashSet<>(Arrays.asList(supportedLocales)), | ||
Locale.forLanguageTag("zh-TW")).toLanguageTag()); | ||
} | ||
|
||
@Test | ||
public void normalizeToLanguageTag() { | ||
String[] testLocaleStrs = { "de", "es", "fr", "ja", "ko", "en-US", "zh-CN", "zh-TW", | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to judge dto locale is same as the fallback locale?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not necessary, but it is an improvement. If we do not check for dto.getLocale == fallback and it happens, it will just try to fetch for the dto locale again and will fail again, and move on to the next item in the queue. Nonetheless, I have added the check for optimization.
Moreover, I hsve removed the following restriction to allow falling back to SOURCE messages:
!dto.getLocale().equals(ConstantsKeys.SOURCE)