org.estonlabs:mongo-utils

Mongo java utilities. Currently includes a wrapper around the oplog monitor for notification subscription.

License

License

GroupId

GroupId

org.estonlabs
ArtifactId

ArtifactId

mongo-utils
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

org.estonlabs:mongo-utils
Mongo java utilities. Currently includes a wrapper around the oplog monitor for notification subscription.
Project URL

Project URL

https://github.com/antlen/mongo-utils
Source Code Management

Source Code Management

https://github.com/antlen/mongo-utils

Download mongo-utils

How to add to project

<!-- https://jarcasting.com/artifacts/org.estonlabs/mongo-utils/ -->
<dependency>
    <groupId>org.estonlabs</groupId>
    <artifactId>mongo-utils</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.estonlabs/mongo-utils/
implementation 'org.estonlabs:mongo-utils:1.0.0'
// https://jarcasting.com/artifacts/org.estonlabs/mongo-utils/
implementation ("org.estonlabs:mongo-utils:1.0.0")
'org.estonlabs:mongo-utils:jar:1.0.0'
<dependency org="org.estonlabs" name="mongo-utils" rev="1.0.0">
  <artifact name="mongo-utils" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.estonlabs', module='mongo-utils', version='1.0.0')
)
libraryDependencies += "org.estonlabs" % "mongo-utils" % "1.0.0"
[org.estonlabs/mongo-utils "1.0.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.mongodb : mongodb-driver jar 3.2.2
org.slf4j : slf4j-api jar 1.6.6
ch.qos.logback : logback-classic jar 1.0.7

provided (1)

Group / Artifact Type Version
org.slf4j : slf4j-log4j12 jar 1.6.6

test (2)

Group / Artifact Type Version
junit : junit jar 4.11
org.easymock : easymock jar 3.4

Project Modules

There are no modules declared in this project.

mongo-utils

A utility for subscribing to a mongo collction for updates whenever there is an insert, update or delete.

	<dependency>
	   <groupId>org.estonlabs</groupId>
	  <artifactId>mongo-utils</artifactId>
	  <version>1.0.0</version>
    </dependency>
	 final MongoClient mongoClient = new MongoClient("localhost" , 3001 );	
     final OplogMonitor mongo = new OplogMonitor(mongoClient);
     mongo.start();
	
	 final Namespace namespace = new Namespace( "meteor", "markets" );		

	//only listen to the insert and delete events.  
	mongo.listenToNameSpace(namespace, this, OplogEventType.INSERT, OplogEventType.DELETE);
 
 
 	  //sometime later when finished monitoring call
      mongo.stop();

Versions

Version
1.0.0