bwaldvogel / mongo-java-server

Fake implementation of MongoDB in Java that speaks the wire protocol.
BSD 3-Clause "New" or "Revised" License
284 stars 88 forks source link

replica set support #38

Open hafarooki opened 5 years ago

hafarooki commented 5 years ago

I need to be able to test client sessions, but only replica sets support that. Is that possible with this?

bwaldvogel commented 5 years ago

It’s not yet supported.

It could probably help implementation, if you could add a (simple) test case.

snava10 commented 4 years ago

We can easily simulate a replica set without really implementing it by adding a few fields to the isMaster response, for example

response.put("setName", "rs0");
response.put("hosts", Collections.singleton(serverAddress));
response.put("me", serverAddress);
response.put("primary", serverAddress);
response.put("logicalSessionTimeoutMinutes", 100);

but this wont do to support sessions, for that we need support for OP_MSG #71