I created android native(java) todo app using couchbase-lite. My couchbase server and gatway are running on EC2 instance. On this todo app, replicator push is working. After I add todo to the app, it’s appearing on the couchbase collection. But it not appearing on the second client app (pull is not working). Followings are the my configurations.
Database config on sync-gateway
curl --location --request PUT 'http://127.0.0.1:4985/testdbone/' \
--header 'Authorization: Basic $DIGEST' \
--header 'Content-Type: application/json' \
--data-raw '{"bucket": "testbucone",
"scopes": {
"_default": {
"collections": {
"exmpl": {
"import_filter": "function(doc) { return true; }",
"sync": "function(doc){channel(\"exmpl\");}"
}
}
}
},
"num_index_replicas": 0,
"enable_shared_bucket_access": true,
"import_docs": true}'
User on sync-gateway
curl --location -g --request POST 'http://localhost:4985/testdbone/_user/' \
--header 'Content-Type: application/json' \
--header "Authorization: Basic $DIGEST" \
--data-raw '{
"name": "user3",
"password": "pass123"
}'
Replicate method on app
public ListenerToken replicate(DocumentReplicationListener listener) throws URISyntaxException {
ReplicatorConfiguration replConfig =
new ReplicatorConfiguration(
new URLEndpoint(new URI("ws://xx.xx.xx.xx:4984/testdbone")))
.setType(ReplicatorType.PUSH_AND_PULL)
.addCollection(collection, null)
.setContinuous(true)
.setAutoPurgeEnabled(true)
.setHeartbeat(150)
.setMaxAttempts(20)
.setMaxAttemptWaitTime(300)
.setAuthenticator(new BasicAuthenticator("user3", "pass123".toCharArray()));
replicator = new Replicator(replConfig);
ListenerToken token = replicator.addDocumentReplicationListener(listener);
return token;
}
Can anyone help me with Identifying the issue. I’m using community versions of (couchbase-lite, server, and gateway)
Also, are we only able to use _default scope on sync-gateway community version ?