-
Notifications
You must be signed in to change notification settings - Fork 783
Reactive mongo #2044
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
Reactive mongo #2044
Conversation
Nice! |
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.
There might be a conflict between sync and async driver config, the tests are failing with:
org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.mongodb.client.MongoClient]: Factory method 'mongo' threw exception; nested exception is java.lang.IllegalArgumentException: The contextProvider must be an instance of com.mongodb.client.SynchronousContextProvider when using the synchronous driver
import org.bson.BsonDocument; | ||
import org.junit.jupiter.api.Test; | ||
import org.mockito.BDDMockito; | ||
import org.mockito.Mockito; |
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.
Should we replace BDDMockito
and BDDAssertions
whenever we see them?
childSpanBuilder.remoteIpAndPort(socketAddress.getAddress().getHostAddress(), socketAddress.getPort()); | ||
} | ||
catch (MongoSocketException ignored) { | ||
|
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.
Shouldn't we emit a DEBUG
log here?
private final Map<Object, Object> map = new ConcurrentHashMap<>(); | ||
|
||
TraceRequestContext(ContextView context) { | ||
context.stream().forEach(entry -> map.put(entry.getKey(), entry.getValue())); |
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.
How about creating the map here:
context.stream().forEach(entry -> map.put(entry.getKey(), entry.getValue())); | |
map = context.stream().collect(Collectors.toMap(entry::getKey, entry::getValue)); |
4dfb1f5
to
a4616be
Compare
the sample spring-cloud-samples/spring-cloud-sleuth-samples#15