[wildfly-dev] A few questions about the NoSQL MongoDB client subsystem configuration...

Scott Marlow smarlow at redhat.com
Wed Jun 8 10:39:36 EDT 2016


[1] is an example of the MongoDB subsystem configuration (work in 
progress), that specifies three different connection profiles 
(mongodbtestprofile_ack, mongodbtestprofile_unack, 
mongodbtestprofile_custom).  It should be easy for users to specify one 
of the MongoDB constants for the write-concern setting, for each of the 
MongoDB profiles.  Specifying a custom write-concern is also possible 
(see mongodbtestprofile_custom and underlying MongoDB java driver api [2]).

In [1], I prefer the first configuration example that names the custom 
write-concern element "custom-write-concern", as I thought it might be 
confusing if users used the same "write-concern" name in two different 
places, however, using "write-concern" for both, could be more consistent.

Should we use "custom-write-concern" or "write-concern" for the custom 
configuration element?

It comes down to a choice between:

<mongo ...>
   ...
   <custom-write-concern name="default” w=“1” j=“true” wtimeout=“1”/>
</mongo>

OR

<mongo ...>
   ...
   <write-concern name="default” w=“1” j=“true” wtimeout=“1”/>
</mongo>

For those not reading [1], we also can support one of the predefined 
write-concern constants via:

<mongo ... write-concern="ACKNOWLEDGED">
   ...
</mongo>

Also, is the 'name="default"' setting required for addressing specific 
elements with the CLI tool?  I assume this is the case but don't 
remember for sure.

Thanks for the input/discussion!  :-)

Scott

[1] https://gist.github.com/scottmarlow/6895f15219ca16a5bc95fc19ef5b397e

[2] 
https://api.mongodb.com/java/3.1/com/mongodb/WriteConcern.html#WriteConcern-int-int-boolean-boolean-


More information about the wildfly-dev mailing list