inthefabric / RexConnect

Connect to Rexster/RexPro via TCP connection.
www.inthefabric.com
Other
10 stars 0 forks source link

RexConnect

RexConnect is Java application that provides access to a Rexster-supported graph database. RexConnect adds a powerful, language-agnostic service layer upon Rexster's RexPro interface. It provides methods of data access: server and console. The server mode responds to incoming TCP requests; the console mode offers an interactive interface.

Current Use Cases

The Fabric API, website, and other related projects are written in C#. This makes it more difficult to interact with the Rexster Server, which is a Java project. RexConnect allows these projects to avoid REST/HTTP as a bottleneck, communicating at a lower level instead. Fabric currently uses three distinct graph database scenarios. These scenarios all currently use Titan 0.3.0 with Rexster 2.3.0.

Server

The RexConnectServer responds to TCP requests. These requests are send as JSON data, using RexConnect's server request format. Requests can contain one or more commands, which execute sequentially. After the request's execution completes, RexConnect responds with JSON data in the server response format. Responses include details and data for each command in the request.

Usage

To start the RexConnectServer, execute the "rexConnectServer" script (.sh or .bat) from the project's root directory.

Applications written in any language can connect to RexConnectServer via TCP. See the RexConnect C# Client Wiki page for details about Fabric's actual C# client implementation.

Console

The RexConnectConsole provides an interactive interface with RexConnect. Each console prompt represents the execution of a single command. The command given at the main prompt leads to one or more sub-prompts, where the additional actions/arguments are provided. For clarity and ease-of-use, these sub-prompts provide information about the requested input.

The responses provided by RexConnectConsole are exactly the same as the individual "command" responses provided by RexConnectServer.

Usage

To start the RexConnectConsole, execute the "rexConnectConsole" script (.sh or .bat) from the project's root directory.

A simple example of console usage:

$ bin/rexConnectConsole.sh

"            ---===##\    
"                --==##\  
"  ---===################>
"                --==##/  
"            ---===##/    

RexConnect Console 0.3.2
{rexpro_port=8184, rexpro_graph_name=FabricTest, rexconnect_port=8184, rexpro_hosts=rexster, rexpro_timeout_ms=120000}

-------------------------------------------------------------

# RexConnect> config
#   ...setting (0; string): pretty
#   ...mode (1; int): 1

{
    "timer": 0
}

# RexConnect> query
#   ...script (0; string): g
#   ...params (1; string; opt): 

{
    "timer": 592, 
    "results": [
        "titangraph[local:data/FabricTest]"
    ]
}

# RexConnect> 

Markdown

The console output was designed to play nicely with GitHub's formatting of the C language. Start code blocks with...

```c

...to take advantage of the syntax highlighting.

Documentation

Please see the following Wiki pages for detailed RexConnect usage information:

githalytics.com alpha