Dear readers of our blog, we'd like to recommend you to visit the main page of our website, where you can learn about our product SQLS*Plus and its advantages.
 
SQLS*Plus - best SQL Server command line reporting and automation tool! SQLS*Plus is several orders of magnitude better than SQL Server sqlcmd and osql command line tools.
 

REQUEST COMPLIMENTARY SQLS*PLUS LICENCE

Enteros UpBeat offers a patented database performance management SaaS platform. It proactively identifies root causes of complex revenue-impacting database performance issues across a growing number of RDBMS, NoSQL, and deep/machine learning database platforms. We support Oracle, SQL Server, IBM DB2, MongoDB, Casandra, MySQL, Amazon Aurora, and other database systems.

Run a MongoDB data adapter for Atom Hopper with Netbeans

30 September 2020

Preamble

SQLS*Plus - 1649775874655F96B9723 9577 4BB3 8C6D 5215D90D0753 optimize

​​

Atom Hopper (based on Apache Abdera) for those who may not know is an open-source project sponsored by Rackspace. Today we will figure out how to use the new MongoDB data adapter.

After testing, refactoring, etc. is complete. E. For the MongoDB data adapter, it is likely to be enabled by default, not in the current Hibernate data adapter.
Important note: Be sure to put Index in DateLastUpdated – this will significantly improve HTTP GET requests.

As stated in our wiki, there are several ways to run Atom Hopper. To test a MongoDB adapter with Atom Hopper, let’s consider how to run it from Netbeans 7.1. You will also need a MongoDB running locally on your computer.

Step 1: Get the source code

The source code is open source under an Apache 2 license. You can use Git to easily get the source code. I am on OS X and I tend to use GitHub’s Mac client, but you can also use Git functionality in Netbeans.

Step 2: Compiling the source code

Once you have downloaded the main repository for Atom Hopper, you can use Netbeans 7.1 to download the project. Run Netbeans, if it is not already running, and select: “File” -> “Open Project”, find the Atom-Hopper folder, click “Open required projects” and click “Open”.

After loading a project, right-click the ATOM Hopper – ATOMpub Server Collection project and select “Clean up and build”.

Step 3: Launching the standalone version of Jetty (for testing purposes only)

At this stage, the project should have been successfully built – and it may take some time as all dependencies should be loaded first. Usually, when you run Atom Hopper, you use the resulting WAR file and embed it into something like Apache Tomcat. For simplicity and because it’s only for testing the new MongoDB adapter for Atom Hopper, I’ll just show you how to run the standalone version of Jetty used to debug Atom Hopper.

Right-click the default ATOM Hopper project – Jetty Server and select Properties.

In the opened dialog box “Project Properties” click “Run” in the left part of the categories, and then add the word “start” to the text field “Arguments” on the right.

Click the Ok button and return to the project. Go to the ATOM Hopper – Default Jetty Server project files and find the file atom-server.cfg.xml and application-context.xml.

Let’s add MongoDB as the default adapter to the application-context.xml file. This is done by commenting on the Hibernate adapter and commenting on the MongoDB adapter. The file should look like this:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

<!-- MongoDB -->
<mongo:mongo host="localhost" port="27017"/>

<bean name="mongoTemplate" >
<constructor-arg ref="mongo"/>
<constructor-arg name="databaseName" value="atomhopper"/>
</bean>

<bean name="mongodb-feed-publisher" >
<property name="mongoTemplate" ref="mongoTemplate" />
</bean>

<bean name="mongodb-feed-source" >
<property name="mongoTemplate" ref="mongoTemplate" />
</bean>
</beans>

Now we just need to install the atom-server.cfg.xml file so that it points to the publisher and MongoDB news source:

<?xml version="1.0" encoding="UTF-8"?>

<atom-hopper-config xmlns="http://atomhopper.org/atom/hopper-config/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://atomhopper.org/atom/hopper-config/v1.0 ./.../config/atom-hopper-config.xsd">
<defaults>
<author name="Atom Hopper" />
</defaults>

<host domain="localhost:8080" />

<workspace title="Testing Namespace" resource="/namespace/">
<categories-descriptor reference="workspace-categories-descriptor" />

<feed title="Testing Feed" resource="/feed">
<publisher reference="mongodb-feed-publisher" />
<feed-source reference="mongodb-feed-source" />
</feed>
</workspace>
</atom-hopper-config>

Continue and recompile the default ATOM Hopper – Jetty Server project, then right-click it and select “Run”.

The startup command we installed earlier allows the Jetty server to start at the following default values:
http:// localhost: 8080 / namespace / feed /

Use the above URL to check everything. You can execute HTTP POST or GET for the channel. Here is an example of ATOM XML code that you can use for testing:

<entry xmlns="http://www.w3.org/2005/Atom">
<title type="text">This is the title</title>.
<author>
<name>John Doe</name>
</author>
<content type="text">Hello World</content>
<category term="MyCategory 1" />
<category term="MyCategory 2" />
<category term="MyCategory 3" />
</entry>

Note. You can use a plugin such as XHR Poster for Chrome to easily place it in the Atom Hopper, or a plugin such as Poster for Firefox.

Before running HTTP POST, make sure that the content type is set to application/atom+xml. You can get more information on how to use the plugin to test Atom Hopper, from here.

To terminate a standalone Jetty Server, simply return to the ATOM Hopper – Jetty Server default project, then right-click it and select “Properties”. In the Project Properties dialog box that opens, click “Run” in the left part of the categories and then add the word “stop” to the text field “Arguments” on the right. Then run the ATOM Hopper – Jetty Server project by default, which will send the command to finish the work to the running instance.

MongoDB Tutorial – Connecting to MongoDB

Enteros

About Enteros

Enteros offers a patented database performance management SaaS platform. It proactively identifies root causes of complex business-impacting database scalability and performance issues across a growing number of RDBMS, NoSQL, and machine learning database platforms.

 
Tags: ,

MORE NEWS

 

Preamble​​NoSql is not a replacement for SQL databases but is a valid alternative for many situations where standard SQL is not the best approach for...

Preamble​​MongoDB Conditional operators specify a condition to which the value of the document field shall correspond.Comparison Query Operators $eq...

5 Database management trends impacting database administrationIn the realm of database management systems, moreover half (52%) of your competitors feel...

The data type is defined as the type of data that any column or variable can store in MS SQL Server. What is the data type? When you create any table or...

Preamble​​MS SQL Server is a client-server architecture. MS SQL Server process starts with the client application sending a query.SQL Server accepts,...

First the basics: what is the master/slave?One database server (“master”) responds and can do anything. A lot of other database servers store copies of all...

Preamble​​MongoDB recently introduced its new aggregation structure. This structure provides a simpler solution for calculating aggregated values rather...

FlexibilityOne of the most advertised features of MongoDB is its flexibility.  Flexibility, however, is a double-edged sword. More flexibility means more...

Preamble​​SQLShell is a cross-platform command-line tool for SQL, similar to psql for PostgreSQL or MySQL command-line tool for MySQL.Why use it?If you...

Preamble​​Writing an application on top of the framework on top of the driver on top of the database is a bit like a game on the phone: you say “insert...

Preamble​​Oracle Coherence is a distributed cache that is functionally comparable with Memcached. In addition to the basic function of the API cache, it...

Preamble​​IBM pureXML, a proprietary XML database built on a relational mechanism (designed for puns) that offers both relational ( SQL / XML ) and...

  What is PostgreSQL array? In PostgreSQL we can define a column as an array of valid data types. The data type can be built-in, custom or enumerated....

Preamble​​If you are a Linux sysadmin or developer, there comes a time when you need to manage an Oracle database that can work in your environment.In this...

Preamble​​Starting with Microsoft SQL Server 2008, by default, the group of local administrators is no longer added to SQL Server administrators during the...

Preamble​​When administering PostgreSQL database servers, one of the most common tasks you will probably perform is enumerating databases and their tables....