Giriş
XML ile eklenen Data Connection bir daha silinemez
Örnek - JDBC
Şöyle yaparız
<hazelcast> <data-connection name="my-mysql-database"> <type>JDBC</type> <properties> <property name="jdbcUrl">jdbc:mysql://mysql.example.org:3306</property> <property name="user">my_user</property> <property name="password">my_password</property> </properties> <shared>true</shared> </data-connection> </hazelcast>
Şöyle yaparız
hazelcast:data-connection:my-mongodb:type: Mongoproperties:connectionString: mongodb+srv://myusername:mypass@foo.mongodb.net/?retryWrites=true&w=majoritydatabase: hazelcastcollection: supplementsshared: truemap:supplements:map-store:enabled: trueclass-name: com.hazelcast.mapstore.GenericMapStoreproperties:data-connection-ref: my-mongodb
Açıklaması şöyle
mongodb+srv: - The scheme that indicates this is a connection string for MongoDB Atlas.myusername - The username for the user that will be connecting to the database.mypass - The password for the user that will be connecting to the database.foo.mongodb.net - The hostname of the MongoDB Atlas cluster.retryWrites=true - Indicates that the driver should retry writes if they fail.w=majority - Indicates that the driver should wait for a majority of nodes in the cluster to acknowledge a write before returning.
Hiç yorum yok:
Yorum Gönder