Код: Выделить всё
myList.parallelStream().forEach(item -> {
//this external api call will use the current
//spring security to populate the headers with values
//that is extracted from jwt token
var response = externalApi.getFoo(item.getAttribute());
..do something..
});
Мне нужно решение, которое НЕ предполагает установку стратегии SecurityContextHolder на MODE_INHERITABLETHREADLOCAL.
Я считаю, что это может вызвать проблемы с безопасностью, если к услуге обращаются несколько пользователей.
Подробнее здесь: https://stackoverflow.com/questions/727 ... llelstream