Jeff,
Thanks, I tried that and can see org.bson.codecs.configuration.CompoundCodecRegistry with "firstCodecRegistry" set to SingleCodecRegistry with expected UuidCodec.
Unfortunately even though execution goes through CompoundCodecRegistry constructor "public <T> Codec<T> get(final Class<T> clazz)" never gets called :-(. As a result added codec is never used.
I am using the following version of the driver:
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.0.0-beta3</version>
And use this code to configure MongoClient:
ServerAddress serverAddress = new ServerAddress(getMongoHost(), getMongoPortNumber());
MongoCredential mongoCredential = MongoCredential.createMongoCRCredential(getMongoUser(), getDatabaseName(),
getMongoPassword().toCharArray());
MongoClientOptions.Builder builder = MongoClientOptions.builder();
builder.codecRegistry(fromRegistries(fromCodec(new UuidCodec(UuidRepresentation.STANDARD)),
MongoClient.getDefaultCodecRegistry()));
MongoClientOptions options = builder.build();
MongoClient client = new MongoClient(serverAddress, Arrays.asList(mongoCredential), options);
Any ideas would be appreciated
Alex